mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
rename SuspenseList export to unstable_SuspenseList (#27061)
## Summary as we began [discussing yesterday](https://github.com/facebook/react/pull/27056#discussion_r1253282784), `SuspenseList` is not actually stable yet, and should likely be exported with the `unstable_` prefix. the conversation yesterday began discussing this in the context of the fb-specific packages, but changing it there without updating everywhere else leads to test failures, so here the change is made across packages. ## How did you test this change? ``` yarn flow dom-browser yarn test ```
This commit is contained in:
@@ -38,7 +38,7 @@ function Example() {
|
||||
DisplayName,
|
||||
null,
|
||||
x(
|
||||
React.SuspenseList,
|
||||
React.unstable_SuspenseList,
|
||||
null,
|
||||
x(
|
||||
NativeClass,
|
||||
|
||||
@@ -693,13 +693,13 @@ describe('Store', () => {
|
||||
};
|
||||
const Wrapper = ({shouldSuspense}) => (
|
||||
<React.Fragment>
|
||||
<React.SuspenseList revealOrder="forwards" tail="collapsed">
|
||||
<React.unstable_SuspenseList revealOrder="forwards" tail="collapsed">
|
||||
<Component key="A" />
|
||||
<React.Suspense fallback={<Loading />}>
|
||||
{shouldSuspense ? <SuspendingComponent /> : <Component key="B" />}
|
||||
</React.Suspense>
|
||||
<Component key="C" />
|
||||
</React.SuspenseList>
|
||||
</React.unstable_SuspenseList>
|
||||
</React.Fragment>
|
||||
);
|
||||
|
||||
|
||||
@@ -8,7 +8,12 @@
|
||||
*/
|
||||
|
||||
import * as React from 'react';
|
||||
import {Fragment, Suspense, SuspenseList, useState} from 'react';
|
||||
import {
|
||||
Fragment,
|
||||
Suspense,
|
||||
unstable_SuspenseList as SuspenseList,
|
||||
useState,
|
||||
} from 'react';
|
||||
|
||||
function SuspenseTree(): React.Node {
|
||||
return (
|
||||
|
||||
@@ -81,7 +81,7 @@ describe('ReactDOMFizzServer', () => {
|
||||
Suspense = React.Suspense;
|
||||
use = React.use;
|
||||
if (gate(flags => flags.enableSuspenseList)) {
|
||||
SuspenseList = React.SuspenseList;
|
||||
SuspenseList = React.unstable_SuspenseList;
|
||||
}
|
||||
|
||||
PropTypes = require('prop-types');
|
||||
|
||||
@@ -116,7 +116,7 @@ describe('ReactDOMServerPartialHydration', () => {
|
||||
Offscreen = React.unstable_Offscreen;
|
||||
useSyncExternalStore = React.useSyncExternalStore;
|
||||
if (gate(flags => flags.enableSuspenseList)) {
|
||||
SuspenseList = React.SuspenseList;
|
||||
SuspenseList = React.unstable_SuspenseList;
|
||||
}
|
||||
|
||||
const InternalTestUtils = require('internal-test-utils');
|
||||
|
||||
@@ -30,7 +30,7 @@ function initModules() {
|
||||
ReactTestUtils = require('react-dom/test-utils');
|
||||
act = require('internal-test-utils').act;
|
||||
if (gate(flags => flags.enableSuspenseList)) {
|
||||
SuspenseList = React.SuspenseList;
|
||||
SuspenseList = React.unstable_SuspenseList;
|
||||
}
|
||||
|
||||
// Make them available to the helpers.
|
||||
|
||||
@@ -29,7 +29,7 @@ beforeEach(() => {
|
||||
|
||||
Suspense = React.Suspense;
|
||||
if (gate(flags => flags.enableSuspenseList)) {
|
||||
SuspenseList = React.SuspenseList;
|
||||
SuspenseList = React.unstable_SuspenseList;
|
||||
}
|
||||
|
||||
getCacheForType = React.unstable_getCacheForType;
|
||||
|
||||
@@ -23,7 +23,7 @@ describe('ReactIs', () => {
|
||||
ReactIs = require('react-is');
|
||||
|
||||
if (gate(flags => flags.enableSuspenseList)) {
|
||||
SuspenseList = React.SuspenseList;
|
||||
SuspenseList = React.unstable_SuspenseList;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ describe('ReactLazyContextPropagation', () => {
|
||||
useContext = React.useContext;
|
||||
Suspense = React.Suspense;
|
||||
if (gate(flags => flags.enableSuspenseList)) {
|
||||
SuspenseList = React.SuspenseList;
|
||||
SuspenseList = React.unstable_SuspenseList;
|
||||
}
|
||||
|
||||
const InternalTestUtils = require('internal-test-utils');
|
||||
|
||||
@@ -67,7 +67,7 @@ describe('ReactHooksWithNoopRenderer', () => {
|
||||
ContinuousEventPriority =
|
||||
require('react-reconciler/constants').ContinuousEventPriority;
|
||||
if (gate(flags => flags.enableSuspenseList)) {
|
||||
SuspenseList = React.SuspenseList;
|
||||
SuspenseList = React.unstable_SuspenseList;
|
||||
}
|
||||
|
||||
const InternalTestUtils = require('internal-test-utils');
|
||||
|
||||
@@ -19,7 +19,7 @@ describe('ReactSuspenseList', () => {
|
||||
Profiler = React.Profiler;
|
||||
Suspense = React.Suspense;
|
||||
if (gate(flags => flags.enableSuspenseList)) {
|
||||
SuspenseList = React.SuspenseList;
|
||||
SuspenseList = React.unstable_SuspenseList;
|
||||
}
|
||||
|
||||
const InternalTestUtils = require('internal-test-utils');
|
||||
|
||||
@@ -21,7 +21,7 @@ describe('ReactSuspenseyCommitPhase', () => {
|
||||
Scheduler = require('scheduler');
|
||||
Suspense = React.Suspense;
|
||||
if (gate(flags => flags.enableSuspenseList)) {
|
||||
SuspenseList = React.SuspenseList;
|
||||
SuspenseList = React.unstable_SuspenseList;
|
||||
}
|
||||
Offscreen = React.unstable_Offscreen;
|
||||
useMemo = React.useMemo;
|
||||
|
||||
@@ -17,8 +17,6 @@ export {
|
||||
PureComponent,
|
||||
StrictMode,
|
||||
Suspense,
|
||||
SuspenseList,
|
||||
SuspenseList as unstable_SuspenseList, // TODO: Remove once call sights updated to SuspenseList
|
||||
cloneElement,
|
||||
createContext,
|
||||
createElement,
|
||||
@@ -38,6 +36,7 @@ export {
|
||||
unstable_LegacyHidden,
|
||||
unstable_Offscreen,
|
||||
unstable_Scope,
|
||||
unstable_SuspenseList,
|
||||
unstable_getCacheSignal,
|
||||
unstable_getCacheForType,
|
||||
unstable_useCacheRefresh,
|
||||
|
||||
@@ -17,7 +17,6 @@ export {
|
||||
PureComponent,
|
||||
StrictMode,
|
||||
Suspense,
|
||||
SuspenseList,
|
||||
cloneElement,
|
||||
createContext,
|
||||
createElement,
|
||||
@@ -36,6 +35,7 @@ export {
|
||||
unstable_Offscreen,
|
||||
unstable_getCacheSignal,
|
||||
unstable_getCacheForType,
|
||||
unstable_SuspenseList,
|
||||
unstable_useCacheRefresh,
|
||||
unstable_useMemoCache,
|
||||
useId,
|
||||
|
||||
@@ -40,7 +40,6 @@ export {
|
||||
PureComponent,
|
||||
StrictMode,
|
||||
Suspense,
|
||||
SuspenseList,
|
||||
cloneElement,
|
||||
createContext,
|
||||
createElement,
|
||||
@@ -59,6 +58,7 @@ export {
|
||||
unstable_LegacyHidden,
|
||||
unstable_Offscreen,
|
||||
unstable_Scope,
|
||||
unstable_SuspenseList,
|
||||
unstable_TracingMarker,
|
||||
unstable_getCacheSignal,
|
||||
unstable_getCacheForType,
|
||||
|
||||
@@ -17,8 +17,6 @@ export {
|
||||
PureComponent,
|
||||
StrictMode,
|
||||
Suspense,
|
||||
SuspenseList,
|
||||
SuspenseList as unstable_SuspenseList, // TODO: Remove once call sights updated to SuspenseList
|
||||
cloneElement,
|
||||
createContext,
|
||||
createElement,
|
||||
@@ -36,6 +34,7 @@ export {
|
||||
unstable_LegacyHidden,
|
||||
unstable_Offscreen,
|
||||
unstable_Scope,
|
||||
unstable_SuspenseList,
|
||||
unstable_getCacheSignal,
|
||||
unstable_getCacheForType,
|
||||
unstable_useCacheRefresh,
|
||||
|
||||
@@ -130,7 +130,7 @@ export {
|
||||
useTransition,
|
||||
startTransition,
|
||||
useDeferredValue,
|
||||
REACT_SUSPENSE_LIST_TYPE as SuspenseList,
|
||||
REACT_SUSPENSE_LIST_TYPE as unstable_SuspenseList,
|
||||
REACT_LEGACY_HIDDEN_TYPE as unstable_LegacyHidden,
|
||||
REACT_OFFSCREEN_TYPE as unstable_Offscreen,
|
||||
getCacheSignal as unstable_getCacheSignal,
|
||||
|
||||
@@ -17,7 +17,6 @@ export {
|
||||
Profiler,
|
||||
StrictMode,
|
||||
Suspense,
|
||||
SuspenseList,
|
||||
cloneElement,
|
||||
createElement,
|
||||
createRef,
|
||||
@@ -30,6 +29,7 @@ export {
|
||||
cache,
|
||||
startTransition,
|
||||
unstable_DebugTracingMode,
|
||||
unstable_SuspenseList,
|
||||
unstable_getCacheSignal,
|
||||
unstable_getCacheForType,
|
||||
useId,
|
||||
|
||||
Reference in New Issue
Block a user