| 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 {AsyncLocalStorage} from 'async_hooks'; |
| 11 | |
| 12 | import type {Request} from 'react-server/src/ReactFlightServer'; |
| 13 | import type {ReactComponentInfo} from 'shared/ReactTypes'; |
| 14 | |
| 15 | export * from 'react-server-dom-webpack/src/server/ReactFlightServerConfigWebpackBundler'; |
| 16 | export * from 'react-dom-bindings/src/server/ReactFlightServerConfigDOM'; |
| 17 | |
| 18 | export const supportsRequestStorage = true; |
| 19 | export const requestStorage: AsyncLocalStorage<Request | void> = |
| 20 | new AsyncLocalStorage(); |
| 21 | |
| 22 | export const supportsComponentStorage = __DEV__; |
| 23 | export const componentStorage: AsyncLocalStorage<ReactComponentInfo | void> = |
| 24 | supportsComponentStorage ? new AsyncLocalStorage() : (null as any); |
| 25 | |
| 26 | export * from '../ReactFlightServerConfigDebugNode'; |
| 27 | |
| 28 | export * from '../ReactFlightStackConfigV8'; |
| 29 | export * from '../ReactServerConsoleConfigServer'; |