dillon1000/react
Commit
Browse files [Flight] Use AsyncLocalStorage to extend the scope of the cache to micro tasks (#25542)
This extends the scope of the cache and fetch instrumentation using AsyncLocalStorage for microtasks. This is an intermediate step. It sets up the dispatcher only once. This is unique to RSC because it uses the react.shared-subset module for its shared state. Ideally we should support multiple renderers. We should also have this take over from an outer SSR's instrumented fetch. We should also be able to have a fallback to global state per request where AsyncLocalStorage doesn't exist and then the whole client-side solutions. I'm still figuring out the right wiring for that so this is a temporary hack.
Changed paths21 files
First-parent comparison.eslintrc.js ModifiedM packages/react-dom-bindings/src/server/ReactDOMLegacyServerStreamConfig.js ModifiedM packages/react-server-dom-relay/src/ReactFlightDOMRelayServerHostConfig.js ModifiedM packages/react-server-dom-relay/src/ReactServerStreamConfigFB.js ModifiedM packages/react-server-native-relay/src/ReactFlightNativeRelayServerHostConfig.js ModifiedM packages/react-server/src/ReactFlightCache.js ModifiedM packages/react-server/src/ReactFlightServer.js ModifiedM packages/react-server/src/ReactFlightServerConfigStream.js ModifiedM packages/react-server/src/ReactServerStreamConfigBrowser.js ModifiedM packages/react-server/src/ReactServerStreamConfigNode.js ModifiedM packages/react-server/src/forks/ReactServerStreamConfig.custom.js ModifiedM packages/react/src/__tests__/ReactFetch-test.js ModifiedM scripts/error-codes/codes.json ModifiedM scripts/flow/environment.js ModifiedM scripts/rollup/bundles.js ModifiedM scripts/rollup/validate/eslintrc.cjs.js ModifiedM scripts/rollup/validate/eslintrc.cjs2015.js ModifiedM scripts/rollup/validate/eslintrc.esm.js ModifiedM scripts/rollup/validate/eslintrc.fb.js ModifiedM scripts/rollup/validate/eslintrc.rn.js ModifiedM scripts/rollup/validate/eslintrc.umd.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…