Skip to content

Commit

Permalink
[Flight] Serialize deduped elements by direct reference even if they …
Browse files Browse the repository at this point in the history
…suspend (#28283)

In #28123 I switched these to be lazy references. However that creates a
lazy wrapper even if they're synchronously available. We try to as much
as possible preserve the original data structure in these cases.

E.g. here in the dev outlining I only use a lazy wrapper if it didn't
complete synchronously:
https://github.com/facebook/react/pull/28272/files#diff-d4c9c509922b3671d3ecce4e051df66dd5c3d38ff913c7a7fe94abc3ba2ed72eR638

Unfortunately we don't have a data structure that tracks the status of
each emitted row. We could store the task in the map but then they
couldn't be GC:ed as they complete. We could maybe store the status of
each element but seems so heavy.

For now I just went back to direct reference which might be an issue
since it can suspend something higher up when deduped.

DiffTrain build for commit ba5e6a8.
  • Loading branch information
sebmarkbage committed Feb 8, 2024
1 parent f47b316 commit b6023de
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25670,7 +25670,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "18.3.0-canary-e41ee9ea7-20240208";
var ReactVersion = "18.3.0-canary-ba5e6a832-20240208";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9152,7 +9152,7 @@ var devToolsConfig$jscomp$inline_1011 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-e41ee9ea7-20240208",
version: "18.3.0-canary-ba5e6a832-20240208",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1189 = {
Expand Down Expand Up @@ -9183,7 +9183,7 @@ var internals$jscomp$inline_1189 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-e41ee9ea7-20240208"
reconcilerVersion: "18.3.0-canary-ba5e6a832-20240208"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1190 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9580,7 +9580,7 @@ var devToolsConfig$jscomp$inline_1053 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-e41ee9ea7-20240208",
version: "18.3.0-canary-ba5e6a832-20240208",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1230 = {
Expand Down Expand Up @@ -9611,7 +9611,7 @@ var internals$jscomp$inline_1230 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-e41ee9ea7-20240208"
reconcilerVersion: "18.3.0-canary-ba5e6a832-20240208"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1231 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (__DEV__) {
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = "18.3.0-canary-e41ee9ea7-20240208";
var ReactVersion = "18.3.0-canary-ba5e6a832-20240208";

// ATTENTION
// When adding new symbols to this file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -551,4 +551,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-e41ee9ea7-20240208";
exports.version = "18.3.0-canary-ba5e6a832-20240208";
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-e41ee9ea7-20240208";
exports.version = "18.3.0-canary-ba5e6a832-20240208";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e41ee9ea70f8998144fdd959ac11fd7a40e4ee20
ba5e6a8329c7194a2c573c037a37f24ce45ee58f

0 comments on commit b6023de

Please sign in to comment.