main
js 28 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 import type {Request} from 'react-server/src/ReactFlightServer';
10 import type {ReactComponentInfo} from 'shared/ReactTypes';
11
12 export * from 'react-server-dom-turbopack/src/server/ReactFlightServerConfigTurbopackBundler';
13 export * from 'react-dom-bindings/src/server/ReactFlightServerConfigDOM';
14
15 // For now, we get this from the global scope, but this will likely move to a module.
16 export const supportsRequestStorage = typeof AsyncLocalStorage === 'function';
17 export const requestStorage: AsyncLocalStorage<Request | void> =
18 supportsRequestStorage ? new AsyncLocalStorage() : (null as any);
19
20 export const supportsComponentStorage: boolean =
21 __DEV__ && supportsRequestStorage;
22 export const componentStorage: AsyncLocalStorage<ReactComponentInfo | void> =
23 supportsComponentStorage ? new AsyncLocalStorage() : (null as any);
24
25 export * from '../ReactFlightServerConfigDebugNoop';
26
27 export * from '../ReactFlightStackConfigV8';
28 export * from '../ReactServerConsoleConfigServer';