Skip to content

Commit a0c9c6b

Browse files
committed
[Float][Flight] Flight support for Float (#26502)
Stacked on #26557 Supporting Float methods such as ReactDOM.preload() are challenging for flight because it does not have an easy means to convey direct executions in other environments. Because the flight wire format is a JSON-like serialization that is expected to be rendered it currently only describes renderable elements. We need a way to convey a function invocation that gets run in the context of the client environment whether that is Fizz or Fiber. Fiber is somewhat straightforward because the HostDispatcher is always active and we can just have the FlightClient dispatch the serialized directive. Fizz is much more challenging becaue the dispatcher is always scoped but the specific request the dispatch belongs to is not readily available. Environments that support AsyncLocalStorage (or in the future AsyncContext) we will use this to be able to resolve directives in Fizz to the appropriate Request. For other environments directives will be elided. Right now this is pragmatic and non-breaking because all directives are opportunistic and non-critical. If this changes in the future we will need to reconsider how widespread support for async context tracking is. For Flight, if AsyncLocalStorage is available Float methods can be called before and after await points and be expected to work. If AsyncLocalStorage is not available float methods called in the sync phase of a component render will be captured but anything after an await point will be a noop. If a float call is dropped in this manner a DEV warning should help you realize your code may need to be modified. This PR also introduces a way for resources (Fizz) and hints (Flight) to flush even if there is not active task being worked on. This will help when Float methods are called in between async points within a function execution but the task is blocked on the entire function finishing. This PR also introduces deduping of Hints in Flight using the same resource keys used in Fizz. This will help shrink payload sizes when the same hint is attempted to emit over and over again DiffTrain build for commit 36e4cbe.
1 parent 6267517 commit a0c9c6b

File tree

13 files changed

+19
-19
lines changed

13 files changed

+19
-19
lines changed

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23848,7 +23848,7 @@ function createFiberRoot(
2384823848
return root;
2384923849
}
2385023850

23851-
var ReactVersion = "18.3.0-next-8f4219689-20230421";
23851+
var ReactVersion = "18.3.0-next-36e4cbe2e-20230421";
2385223852

2385323853
// Might add PROFILE later.
2385423854

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8601,7 +8601,7 @@ var devToolsConfig$jscomp$inline_1021 = {
86018601
throw Error("TestRenderer does not support findFiberByHostInstance()");
86028602
},
86038603
bundleType: 0,
8604-
version: "18.3.0-next-8f4219689-20230421",
8604+
version: "18.3.0-next-36e4cbe2e-20230421",
86058605
rendererPackageName: "react-test-renderer"
86068606
};
86078607
var internals$jscomp$inline_1206 = {
@@ -8632,7 +8632,7 @@ var internals$jscomp$inline_1206 = {
86328632
scheduleRoot: null,
86338633
setRefreshHandler: null,
86348634
getCurrentFiber: null,
8635-
reconcilerVersion: "18.3.0-next-8f4219689-20230421"
8635+
reconcilerVersion: "18.3.0-next-36e4cbe2e-20230421"
86368636
};
86378637
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
86388638
var hook$jscomp$inline_1207 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9027,7 +9027,7 @@ var devToolsConfig$jscomp$inline_1063 = {
90279027
throw Error("TestRenderer does not support findFiberByHostInstance()");
90289028
},
90299029
bundleType: 0,
9030-
version: "18.3.0-next-8f4219689-20230421",
9030+
version: "18.3.0-next-36e4cbe2e-20230421",
90319031
rendererPackageName: "react-test-renderer"
90329032
};
90339033
var internals$jscomp$inline_1247 = {
@@ -9058,7 +9058,7 @@ var internals$jscomp$inline_1247 = {
90589058
scheduleRoot: null,
90599059
setRefreshHandler: null,
90609060
getCurrentFiber: null,
9061-
reconcilerVersion: "18.3.0-next-8f4219689-20230421"
9061+
reconcilerVersion: "18.3.0-next-36e4cbe2e-20230421"
90629062
};
90639063
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
90649064
var hook$jscomp$inline_1248 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-next-8f4219689-20230421";
30+
var ReactVersion = "18.3.0-next-36e4cbe2e-20230421";
3131

3232
// ATTENTION
3333
// When adding new symbols to this file,

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,4 +639,4 @@ exports.useSyncExternalStore = function (
639639
);
640640
};
641641
exports.useTransition = useTransition;
642-
exports.version = "18.3.0-next-8f4219689-20230421";
642+
exports.version = "18.3.0-next-36e4cbe2e-20230421";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ exports.useSyncExternalStore = function (
642642
);
643643
};
644644
exports.useTransition = useTransition;
645-
exports.version = "18.3.0-next-8f4219689-20230421";
645+
exports.version = "18.3.0-next-36e4cbe2e-20230421";
646646

647647
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
648648
if (
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8f42196892847a3dd1ab4c84eda0c8d52508ecf6
1+
36e4cbe2e918ec9c8a7abbfda28898c835361fb2

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27158,7 +27158,7 @@ function createFiberRoot(
2715827158
return root;
2715927159
}
2716027160

27161-
var ReactVersion = "18.3.0-next-8f4219689-20230421";
27161+
var ReactVersion = "18.3.0-next-36e4cbe2e-20230421";
2716227162

2716327163
function createPortal$1(
2716427164
children,

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9472,7 +9472,7 @@ var roots = new Map(),
94729472
devToolsConfig$jscomp$inline_1045 = {
94739473
findFiberByHostInstance: getInstanceFromNode,
94749474
bundleType: 0,
9475-
version: "18.3.0-next-8f4219689-20230421",
9475+
version: "18.3.0-next-36e4cbe2e-20230421",
94769476
rendererPackageName: "react-native-renderer",
94779477
rendererConfig: {
94789478
getInspectorDataForViewTag: function () {
@@ -9514,7 +9514,7 @@ var internals$jscomp$inline_1276 = {
95149514
scheduleRoot: null,
95159515
setRefreshHandler: null,
95169516
getCurrentFiber: null,
9517-
reconcilerVersion: "18.3.0-next-8f4219689-20230421"
9517+
reconcilerVersion: "18.3.0-next-36e4cbe2e-20230421"
95189518
};
95199519
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
95209520
var hook$jscomp$inline_1277 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10181,7 +10181,7 @@ var roots = new Map(),
1018110181
devToolsConfig$jscomp$inline_1123 = {
1018210182
findFiberByHostInstance: getInstanceFromNode,
1018310183
bundleType: 0,
10184-
version: "18.3.0-next-8f4219689-20230421",
10184+
version: "18.3.0-next-36e4cbe2e-20230421",
1018510185
rendererPackageName: "react-native-renderer",
1018610186
rendererConfig: {
1018710187
getInspectorDataForViewTag: function () {
@@ -10236,7 +10236,7 @@ var roots = new Map(),
1023610236
scheduleRoot: null,
1023710237
setRefreshHandler: null,
1023810238
getCurrentFiber: null,
10239-
reconcilerVersion: "18.3.0-next-8f4219689-20230421"
10239+
reconcilerVersion: "18.3.0-next-36e4cbe2e-20230421"
1024010240
});
1024110241
exports.createPortal = function (children, containerTag) {
1024210242
return createPortal$1(

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27671,7 +27671,7 @@ function createFiberRoot(
2767127671
return root;
2767227672
}
2767327673

27674-
var ReactVersion = "18.3.0-next-8f4219689-20230421";
27674+
var ReactVersion = "18.3.0-next-36e4cbe2e-20230421";
2767527675

2767627676
function createPortal$1(
2767727677
children,

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9731,7 +9731,7 @@ var roots = new Map(),
97319731
devToolsConfig$jscomp$inline_1100 = {
97329732
findFiberByHostInstance: getInstanceFromTag,
97339733
bundleType: 0,
9734-
version: "18.3.0-next-8f4219689-20230421",
9734+
version: "18.3.0-next-36e4cbe2e-20230421",
97359735
rendererPackageName: "react-native-renderer",
97369736
rendererConfig: {
97379737
getInspectorDataForViewTag: function () {
@@ -9773,7 +9773,7 @@ var internals$jscomp$inline_1345 = {
97739773
scheduleRoot: null,
97749774
setRefreshHandler: null,
97759775
getCurrentFiber: null,
9776-
reconcilerVersion: "18.3.0-next-8f4219689-20230421"
9776+
reconcilerVersion: "18.3.0-next-36e4cbe2e-20230421"
97779777
};
97789778
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
97799779
var hook$jscomp$inline_1346 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10440,7 +10440,7 @@ var roots = new Map(),
1044010440
devToolsConfig$jscomp$inline_1178 = {
1044110441
findFiberByHostInstance: getInstanceFromTag,
1044210442
bundleType: 0,
10443-
version: "18.3.0-next-8f4219689-20230421",
10443+
version: "18.3.0-next-36e4cbe2e-20230421",
1044410444
rendererPackageName: "react-native-renderer",
1044510445
rendererConfig: {
1044610446
getInspectorDataForViewTag: function () {
@@ -10495,7 +10495,7 @@ var roots = new Map(),
1049510495
scheduleRoot: null,
1049610496
setRefreshHandler: null,
1049710497
getCurrentFiber: null,
10498-
reconcilerVersion: "18.3.0-next-8f4219689-20230421"
10498+
reconcilerVersion: "18.3.0-next-36e4cbe2e-20230421"
1049910499
});
1050010500
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
1050110501
computeComponentStackForErrorReporting: function (reactTag) {

0 commit comments

Comments
 (0)