mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[Fizz] Fix root segment IDs (#27371)
Typically we assign IDs lazily when flushing to minimize the ids we have to assign and we try to maximize inlining. When we prerender we could always flush into a buffer before returning but that's not actually what we do right now. We complete rendering before returning but we don't actually run the flush path until someone reads the resulting stream. We assign IDs eagerly when something postpone so that we can refer to those ids in the holes without flushing first. This leads to some interesting conditions that needs to consider this. This PR also deals with rootSegmentId which is the ID of the segment that contains the body of a Suspense boundary. The boundary needs to know this in addition to the Suspense Boundary's ID to know how to inject the root segment into the boundary. Why is the suspense boundary ID and the rootSegmentID just not the same ID? Why don't segments and suspense boundary not share ID namespace? That's a good question and I don't really remember. It might not be a good reason and maybe they should just be the same. DiffTrain build for commit https://github.com/facebook/react/commit/a6e4791b11816374d015eb4531a82e6cf209c7f2.
This commit is contained in:
+1
-1
@@ -23998,7 +23998,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-canary-95c9554bc-20230913";
|
||||
var ReactVersion = "18.3.0-canary-a6e4791b1-20230913";
|
||||
|
||||
// Might add PROFILE later.
|
||||
|
||||
|
||||
+2
-2
@@ -8620,7 +8620,7 @@ var devToolsConfig$jscomp$inline_1028 = {
|
||||
throw Error("TestRenderer does not support findFiberByHostInstance()");
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-canary-95c9554bc-20230913",
|
||||
version: "18.3.0-canary-a6e4791b1-20230913",
|
||||
rendererPackageName: "react-test-renderer"
|
||||
};
|
||||
var internals$jscomp$inline_1227 = {
|
||||
@@ -8651,7 +8651,7 @@ var internals$jscomp$inline_1227 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-canary-95c9554bc-20230913"
|
||||
reconcilerVersion: "18.3.0-canary-a6e4791b1-20230913"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1228 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
|
||||
+2
-2
@@ -9046,7 +9046,7 @@ var devToolsConfig$jscomp$inline_1070 = {
|
||||
throw Error("TestRenderer does not support findFiberByHostInstance()");
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-canary-95c9554bc-20230913",
|
||||
version: "18.3.0-canary-a6e4791b1-20230913",
|
||||
rendererPackageName: "react-test-renderer"
|
||||
};
|
||||
var internals$jscomp$inline_1268 = {
|
||||
@@ -9077,7 +9077,7 @@ var internals$jscomp$inline_1268 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-canary-95c9554bc-20230913"
|
||||
reconcilerVersion: "18.3.0-canary-a6e4791b1-20230913"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1269 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ if (
|
||||
}
|
||||
"use strict";
|
||||
|
||||
var ReactVersion = "18.3.0-canary-95c9554bc-20230913";
|
||||
var ReactVersion = "18.3.0-canary-a6e4791b1-20230913";
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
|
||||
+1
-1
@@ -616,4 +616,4 @@ exports.useSyncExternalStore = function (
|
||||
exports.useTransition = function () {
|
||||
return ReactCurrentDispatcher.current.useTransition();
|
||||
};
|
||||
exports.version = "18.3.0-canary-95c9554bc-20230913";
|
||||
exports.version = "18.3.0-canary-a6e4791b1-20230913";
|
||||
|
||||
+1
-1
@@ -619,7 +619,7 @@ exports.useSyncExternalStore = function (
|
||||
exports.useTransition = function () {
|
||||
return ReactCurrentDispatcher.current.useTransition();
|
||||
};
|
||||
exports.version = "18.3.0-canary-95c9554bc-20230913";
|
||||
exports.version = "18.3.0-canary-a6e4791b1-20230913";
|
||||
|
||||
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
||||
if (
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
95c9554bc72813b0ee2b028774bb7cf0482887ba
|
||||
a6e4791b11816374d015eb4531a82e6cf209c7f2
|
||||
|
||||
Reference in New Issue
Block a user