You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Flight] Refactor the Render Loop to Behave More Like Fizz (#28065)
This refactors the Flight render loop to behave more like Fizz with
similar naming conventions. So it's easier to apply similar techniques
across both. This is not necessarily better/faster - at least not yet.
This doesn't yet implement serialization by writing segments to chunks
but we probably should do that since the built-in parts that
`JSON.stringify` gets us isn't really much anymore (except serializing
strings). When we switch to that it probably makes sense for the whole
thing to be recursive.
Right now it's not technically fully recursive because each recursive
render returns the next JSON value to encode. So it's kind of like a
trampoline. This means we can't have many contextual things on the
stack. It needs to use the Server Context `__POP` trick. However, it
does work for things that are contextual only for one sequence of server
component abstractions in a row. Since those are now recursive.
An interesting observation here is that `renderModel` means that
anything can suspend while still serializing the outer siblings.
Typically only Lazy or Components would suspend but in principle a Proxy
can suspend/postpone too and now that is left serialized by reference to
a future value. It's only if the thing that we rendered was something
that can reduce to Lazy e.g. an Element that we can serialize it as a
lazy.
Similarly to how Suspense boundaries in Fizz can catch errors, anything
that can be reduced to Lazy can also catch an error rather than bubbling
it. It only errors when the Lazy resolves. Unlike Suspense boundaries
though, those things don't render anything so they're otherwise going to
use the destructive form. To ensure that throwing in an Element can
reuse the current task, this must be handled by `renderModel`, not for
example `renderElement`.
DiffTrain build for commit b123b9c.
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -25572,7 +25572,7 @@ if (__DEV__) {
25572
25572
return root;
25573
25573
}
25574
25574
25575
-
var ReactVersion = "18.3.0-canary-8bb6ee1d3-20240125";
25575
+
var ReactVersion = "18.3.0-canary-b123b9c4f-20240125";
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -9131,7 +9131,7 @@ var devToolsConfig$jscomp$inline_1031 = {
9131
9131
throwError("TestRenderer does not support findFiberByHostInstance()");
9132
9132
},
9133
9133
bundleType: 0,
9134
-
version: "18.3.0-canary-8bb6ee1d3-20240125",
9134
+
version: "18.3.0-canary-b123b9c4f-20240125",
9135
9135
rendererPackageName: "react-test-renderer"
9136
9136
};
9137
9137
varinternals$jscomp$inline_1207={
@@ -9162,7 +9162,7 @@ var internals$jscomp$inline_1207 = {
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -9559,7 +9559,7 @@ var devToolsConfig$jscomp$inline_1073 = {
9559
9559
throwError("TestRenderer does not support findFiberByHostInstance()");
9560
9560
},
9561
9561
bundleType: 0,
9562
-
version: "18.3.0-canary-8bb6ee1d3-20240125",
9562
+
version: "18.3.0-canary-b123b9c4f-20240125",
9563
9563
rendererPackageName: "react-test-renderer"
9564
9564
};
9565
9565
varinternals$jscomp$inline_1248={
@@ -9590,7 +9590,7 @@ var internals$jscomp$inline_1248 = {
0 commit comments