Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 0 additions & 66 deletions packages/react-dom/src/__tests__/ReactDOMFizzStatic-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,72 +400,6 @@ describe('ReactDOMFizzStatic', () => {
);
});

// @gate enablePostpone
it('does not fatally error when aborting with a postpone during a prerender', async () => {
let postponedValue;
try {
React.unstable_postpone('aborting with postpone');
} catch (e) {
postponedValue = e;
}

const controller = new AbortController();
const infinitePromise = new Promise(() => {});
function App() {
React.use(infinitePromise);
return <div>aborted</div>;
}

const errors = [];
const pendingResult = ReactDOMFizzStatic.prerenderToNodeStream(<App />, {
onError: error => {
errors.push(error);
},
signal: controller.signal,
});
pendingResult.catch(() => {});

await Promise.resolve();
controller.abort(postponedValue);

const result = await pendingResult;

await act(async () => {
result.prelude.pipe(writable);
});
expect(getVisibleChildren(container)).toEqual(undefined);
expect(errors).toEqual([]);
});

// @gate enablePostpone
it('does not fatally error when aborting with a postpone during a prerender from within', async () => {
let postponedValue;
try {
React.unstable_postpone('aborting with postpone');
} catch (e) {
postponedValue = e;
}

const controller = new AbortController();
function App() {
controller.abort(postponedValue);
return <div>aborted</div>;
}

const errors = [];
const result = await ReactDOMFizzStatic.prerenderToNodeStream(<App />, {
onError: error => {
errors.push(error);
},
signal: controller.signal,
});
await act(async () => {
result.prelude.pipe(writable);
});
expect(getVisibleChildren(container)).toEqual(undefined);
expect(errors).toEqual([]);
});

// @gate enableHalt
it('will halt a prerender when aborting with an error during a render', async () => {
const controller = new AbortController();
Expand Down
1 change: 0 additions & 1 deletion packages/react/index.experimental.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export {
cacheSignal,
startTransition,
Activity,
unstable_postpone,
unstable_getCacheForType,
unstable_SuspenseList,
ViewTransition,
Expand Down
1 change: 0 additions & 1 deletion packages/react/index.experimental.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export {
startTransition,
Activity,
Activity as unstable_Activity,
unstable_postpone,
unstable_getCacheForType,
unstable_SuspenseList,
ViewTransition,
Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/ReactClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import {lazy} from './ReactLazy';
import {forwardRef} from './ReactForwardRef';
import {memo} from './ReactMemo';
import {cache, cacheSignal} from './ReactCacheClient';
import {postpone} from './ReactPostpone';
import {
getCacheForType,
useCallback,
Expand Down Expand Up @@ -84,7 +83,6 @@ export {
memo,
cache,
cacheSignal,
postpone as unstable_postpone,
useCallback,
useContext,
useEffect,
Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/ReactServer.experimental.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import {lazy} from './ReactLazy';
import {memo} from './ReactMemo';
import {cache, cacheSignal} from './ReactCacheServer';
import {startTransition} from './ReactStartTransition';
import {postpone} from './ReactPostpone';
import {captureOwnerStack} from './ReactOwnerStack';
import version from 'shared/ReactVersion';

Expand Down Expand Up @@ -76,7 +75,6 @@ export {
cacheSignal,
startTransition,
getCacheForType as unstable_getCacheForType,
postpone as unstable_postpone,
useId,
useCallback,
useDebugValue,
Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/ReactServer.experimental.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import {lazy} from './ReactLazy';
import {memo} from './ReactMemo';
import {cache, cacheSignal} from './ReactCacheServer';
import {startTransition} from './ReactStartTransition';
import {postpone} from './ReactPostpone';
import version from 'shared/ReactVersion';

const Children = {
Expand Down Expand Up @@ -75,7 +74,6 @@ export {
cacheSignal,
startTransition,
getCacheForType as unstable_getCacheForType,
postpone as unstable_postpone,
useId,
useCallback,
useDebugValue,
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/ReactFeatureFlags.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const enableAsyncIterableChildren = __EXPERIMENTAL__;

export const enableTaint = __EXPERIMENTAL__;

export const enablePostpone = __EXPERIMENTAL__;
export const enablePostpone: boolean = false; // Probably won't ship in this form.

export const enableHalt: boolean = true;

Expand Down
Loading