main
js 29 lines 1.15 KB
Raw
1 /**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 * @flow
8 */
9
10 import type {Request} from 'react-server/src/ReactFlightServer';
11 import type {ReactComponentInfo} from 'shared/ReactTypes';
12
13 export * from 'react-server-dom-webpack/src/server/ReactFlightServerConfigWebpackBundler';
14 export * from 'react-dom-bindings/src/server/ReactFlightServerConfigDOM';
15
16 // For now, we get this from the global scope, but this will likely move to a module.
17 export const supportsRequestStorage = typeof AsyncLocalStorage === 'function';
18 export const requestStorage: AsyncLocalStorage<Request | void> =
19 supportsRequestStorage ? new AsyncLocalStorage() : (null as any);
20
21 export const supportsComponentStorage: boolean =
22 __DEV__ && supportsRequestStorage;
23 export const componentStorage: AsyncLocalStorage<ReactComponentInfo | void> =
24 supportsComponentStorage ? new AsyncLocalStorage() : (null as any);
25
26 export * from '../ReactFlightServerConfigDebugNoop';
27
28 export * from '../ReactFlightStackConfigV8';
29 export * from '../ReactServerConsoleConfigServer';