mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
* [Fizz] Support abort reasons Fizz supports aborting the render but does not currently accept a reason. The various render functions that use Fizz have some automatic and some user-controlled abort semantics that can be useful to communicate with the running program and users about why an Abort happened. This change implements abort reasons for renderToReadableStream and renderToPipeable stream as well as legacy renderers such as renderToString and related implementations. For AbortController implementations the reason passed to the abort method is forwarded to Fizz and sent to the onError handler. If no reason is provided the AbortController should construct an AbortError DOMException and as a fallback Fizz will generate a similar error in the absence of a reason For pipeable streams, an abort function is returned alongside pipe which already accepted a reason. That reason is now forwarded to Fizz and the implementation described above. For legacy renderers there is no exposed abort functionality but it is used internally and the reasons provided give useful context to, for instance to the fact that Suspense is not supported in renderToString-like renderers
154 lines
4.8 KiB
JavaScript
154 lines
4.8 KiB
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
'use strict';
|
|
|
|
module.exports = [
|
|
{
|
|
shortName: 'dom',
|
|
entryPoints: [
|
|
'react-dom',
|
|
'react-dom/unstable_testing',
|
|
'react-dom/src/server/ReactDOMFizzServerNode.js',
|
|
'react-server-dom-webpack/writer.node.server',
|
|
'react-server-dom-webpack',
|
|
],
|
|
paths: [
|
|
'react-dom',
|
|
'react-dom/client',
|
|
'react-dom/src/server/ReactDOMFizzServerNode.js', // react-dom/server.node
|
|
'react-server-dom-webpack',
|
|
'react-server-dom-webpack/writer',
|
|
'react-server-dom-webpack/writer.node.server',
|
|
'react-server-dom-webpack/src/ReactFlightDOMServerNode.js', // react-server-dom-webpack/writer.node.server
|
|
'react-client/src/ReactFlightClientStream.js', // We can only type check this in streaming configurations.
|
|
'react-devtools',
|
|
'react-devtools-core',
|
|
'react-devtools-shell',
|
|
'react-devtools-shared',
|
|
'react-interactions',
|
|
],
|
|
isFlowTyped: true,
|
|
isServerSupported: true,
|
|
},
|
|
{
|
|
shortName: 'dom-browser',
|
|
entryPoints: [
|
|
'react-dom',
|
|
'react-dom/unstable_testing',
|
|
'react-dom/src/server/ReactDOMFizzServerBrowser.js',
|
|
'react-server-dom-webpack/writer.browser.server',
|
|
'react-server-dom-webpack',
|
|
],
|
|
paths: [
|
|
'react-dom',
|
|
'react-dom/client',
|
|
'react-dom/unstable_testing',
|
|
'react-dom/src/server/ReactDOMFizzServerBrowser.js', // react-dom/server.browser
|
|
'react-server-dom-webpack',
|
|
'react-server-dom-webpack/writer.browser.server',
|
|
'react-server-dom-webpack/src/ReactFlightDOMServerBrowser.js', // react-server-dom-webpack/writer.browser.server
|
|
'react-client/src/ReactFlightClientStream.js', // We can only type check this in streaming configurations.
|
|
'react-devtools',
|
|
'react-devtools-core',
|
|
'react-devtools-shell',
|
|
'react-devtools-shared',
|
|
],
|
|
isFlowTyped: true,
|
|
isServerSupported: true,
|
|
},
|
|
{
|
|
shortName: 'dom-legacy',
|
|
entryPoints: [
|
|
'react-dom/src/server/ReactDOMLegacyServerBrowser.js', // react-dom/server.browser
|
|
'react-dom/src/server/ReactDOMLegacyServerNode.js', // react-dom/server.node
|
|
],
|
|
paths: [
|
|
'react-dom',
|
|
'react-server-dom-webpack',
|
|
'react-dom/src/server/ReactDOMLegacyServerImpl.js', // not an entrypoint, but only usable in *Brower and *Node files
|
|
'react-dom/src/server/ReactDOMLegacyServerBrowser.js', // react-dom/server.browser
|
|
'react-dom/src/server/ReactDOMLegacyServerNode.js', // react-dom/server.node
|
|
'react-dom/src/server/ReactDOMLegacyServerNode.classic.fb.js',
|
|
'react-dom/src/server/ReactDOMLegacyServerNodeStream.js', // file indirection to support partial forking of some methods in *Node
|
|
'react-client/src/ReactFlightClientStream.js', // We can only type check this in streaming configurations.
|
|
],
|
|
isFlowTyped: true,
|
|
isServerSupported: true,
|
|
},
|
|
{
|
|
shortName: 'art',
|
|
entryPoints: ['react-art'],
|
|
paths: ['react-art'],
|
|
isFlowTyped: false, // TODO: type it.
|
|
isServerSupported: false,
|
|
},
|
|
{
|
|
shortName: 'native',
|
|
entryPoints: ['react-native-renderer'],
|
|
paths: ['react-native-renderer'],
|
|
isFlowTyped: true,
|
|
isServerSupported: false,
|
|
},
|
|
{
|
|
shortName: 'fabric',
|
|
entryPoints: ['react-native-renderer/fabric'],
|
|
paths: ['react-native-renderer'],
|
|
isFlowTyped: true,
|
|
isServerSupported: false,
|
|
},
|
|
{
|
|
shortName: 'test',
|
|
entryPoints: ['react-test-renderer'],
|
|
paths: ['react-test-renderer'],
|
|
isFlowTyped: true,
|
|
isServerSupported: false,
|
|
},
|
|
{
|
|
shortName: 'dom-relay',
|
|
entryPoints: [
|
|
'react-server-dom-relay',
|
|
'react-server-dom-relay/server',
|
|
'react-server-dom-relay/src/ReactDOMServerFB.js',
|
|
],
|
|
paths: ['react-dom', 'react-server-dom-relay'],
|
|
isFlowTyped: true,
|
|
isServerSupported: true,
|
|
},
|
|
{
|
|
shortName: 'native-relay',
|
|
entryPoints: [
|
|
'react-server-native-relay',
|
|
'react-server-native-relay/server',
|
|
],
|
|
paths: [
|
|
'react-native-renderer',
|
|
'react-server-native-relay',
|
|
// this is included here so that it's not included in the main native check
|
|
// remove this when it's added to the main native renderer.
|
|
'react-native-renderer/src/server',
|
|
],
|
|
isFlowTyped: true,
|
|
isServerSupported: true,
|
|
},
|
|
{
|
|
shortName: 'custom',
|
|
entryPoints: [
|
|
'react-reconciler',
|
|
'react-client/flight',
|
|
'react-server',
|
|
'react-server/flight',
|
|
],
|
|
paths: [
|
|
'react-client/flight',
|
|
'react-server/flight',
|
|
'react-client/src/ReactFlightClientStream.js', // We can only type check this in streaming configurations.
|
|
],
|
|
isFlowTyped: true,
|
|
isServerSupported: true,
|
|
},
|
|
];
|