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] Emit debug info for a Server Component (#28272)
This adds a new DEV-only row type `D` for DebugInfo. If we see this in
prod, that's an error. It can contain extra debug information about the
Server Components (or Promises) that were compiled away during the
server render. It's DEV-only since this can contain sensitive
information (similar to errors) and since it'll be a lot of data, but
it's worth using the same stream for simplicity rather than a
side-channel.
In this first pass it's just the Server Component's name but I'll keep
adding more debug info to the stream, and it won't always just be a
Server Component's stack frame.
Each row can get more debug rows data streaming in as it resolves and
renders multiple server components in a row.
The data structure is just a side-channel and it would be perfectly fine
to ignore the D rows and it would behave the same as prod. With this
data structure though the data is associated with the row ID / chunk, so
you can't have inline meta data. This means that an inline Server
Component that doesn't get an ID otherwise will need to be outlined. The
way I outline Server Components is using a direct reference where it's
synchronous though so on the client side it behaves the same (i.e.
there's no lazy wrapper in this case).
In most cases the `_debugInfo` is on the Promises that we yield and we
also expose this on the `React.Lazy` wrappers. In the case where it's a
synchronous render it might attach this data to Elements or Arrays
(fragments) too.
In a future PR I'll wire this information up with Fiber to stash it in
the Fiber data structures so that DevTools can pick it up. This property
and the information in it is not limited to Server Components. The name
of the property that we look for probably shouldn't be `_debugInfo`
since it's semi-public. Should consider the name we use for that.
If it's a synchronous render that returns a string or number (text node)
then we don't have anywhere to attach them to. We could add a
`React.Lazy` wrapper for those but I chose to prioritize keeping the
data structure untouched. Can be useful if you use Server Components to
render data instead of React Nodes.
DiffTrain build for commit b229f54.
Copy file name to clipboardexpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js
+1-1
Original file line number
Diff line number
Diff line change
@@ -25670,7 +25670,7 @@ if (__DEV__) {
25670
25670
return root;
25671
25671
}
25672
25672
25673
-
var ReactVersion = "18.3.0-canary-37d901e2b-20240207";
25673
+
var ReactVersion = "18.3.0-canary-b229f540e-20240208";
Copy file name to clipboardexpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js
+2-2
Original file line number
Diff line number
Diff line change
@@ -9152,7 +9152,7 @@ var devToolsConfig$jscomp$inline_1011 = {
9152
9152
throwError("TestRenderer does not support findFiberByHostInstance()");
9153
9153
},
9154
9154
bundleType: 0,
9155
-
version: "18.3.0-canary-37d901e2b-20240207",
9155
+
version: "18.3.0-canary-b229f540e-20240208",
9156
9156
rendererPackageName: "react-test-renderer"
9157
9157
};
9158
9158
varinternals$jscomp$inline_1189={
@@ -9183,7 +9183,7 @@ var internals$jscomp$inline_1189 = {
Copy file name to clipboardexpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js
+2-2
Original file line number
Diff line number
Diff line change
@@ -9580,7 +9580,7 @@ var devToolsConfig$jscomp$inline_1053 = {
9580
9580
throwError("TestRenderer does not support findFiberByHostInstance()");
9581
9581
},
9582
9582
bundleType: 0,
9583
-
version: "18.3.0-canary-37d901e2b-20240207",
9583
+
version: "18.3.0-canary-b229f540e-20240208",
9584
9584
rendererPackageName: "react-test-renderer"
9585
9585
};
9586
9586
varinternals$jscomp$inline_1230={
@@ -9611,7 +9611,7 @@ var internals$jscomp$inline_1230 = {
0 commit comments