Skip to content

Commit

Permalink
[Fizz] Enable owner stacks for SSR (#30152)
Browse files Browse the repository at this point in the history
Stacked on #30142.

This tracks owners and their stacks in DEV in Fizz. We use the
ComponentStackNode as the data structure to track this information -
effectively like ReactComponentInfo (Server) or Fiber (Client). They're
the instance.

I then port them same logic from ReactFiberComponentStack,
ReactFiberOwnerStack and ReactFiberCallUserSpace to Fizz equivalents.

This gets us both owner stacks from `captureOwnerStack()`, as well as
appended to console.errors logged by Fizz, while rendering and in
onError.

DiffTrain build for [315109b](315109b)
  • Loading branch information
sebmarkbage committed Jul 1, 2024
1 parent 0f2a59e commit b8decad
Show file tree
Hide file tree
Showing 36 changed files with 735 additions and 354 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e02baf6c92833a0d45a77fb2e741676f393c24f7
315109b02b0c9460b7466ca88f3f4d6ed1215a21
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION_TRANSFORMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e02baf6c92833a0d45a77fb2e741676f393c24f7
315109b02b0c9460b7466ca88f3f4d6ed1215a21
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -1991,7 +1991,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.0.0-www-classic-e02baf6c92-20240627";
exports.version = "19.0.0-www-classic-315109b02b-20240701";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -1971,7 +1971,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.0.0-www-modern-e02baf6c92-20240627";
exports.version = "19.0.0-www-modern-315109b02b-20240701";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,4 +669,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-classic-e02baf6c92-20240627";
exports.version = "19.0.0-www-classic-315109b02b-20240701";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,4 +669,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-modern-e02baf6c92-20240627";
exports.version = "19.0.0-www-modern-315109b02b-20240701";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-classic-e02baf6c92-20240627";
exports.version = "19.0.0-www-classic-315109b02b-20240701";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-modern-e02baf6c92-20240627";
exports.version = "19.0.0-www-modern-315109b02b-20240701";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -16934,14 +16934,14 @@ __DEV__ &&
scheduleRoot: scheduleRoot,
setRefreshHandler: setRefreshHandler,
getCurrentFiber: getCurrentFiberForDevTools,
reconcilerVersion: "19.0.0-www-classic-e02baf6c92-20240627"
reconcilerVersion: "19.0.0-www-classic-315109b02b-20240701"
});
})({
findFiberByHostInstance: function () {
return null;
},
bundleType: 1,
version: "19.0.0-www-classic-e02baf6c92-20240627",
version: "19.0.0-www-classic-315109b02b-20240701",
rendererPackageName: "react-art"
});
var ClippingRectangle = TYPES.CLIPPING_RECTANGLE,
Expand Down
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -16364,14 +16364,14 @@ __DEV__ &&
scheduleRoot: scheduleRoot,
setRefreshHandler: setRefreshHandler,
getCurrentFiber: getCurrentFiberForDevTools,
reconcilerVersion: "19.0.0-www-modern-e02baf6c92-20240627"
reconcilerVersion: "19.0.0-www-modern-315109b02b-20240701"
});
})({
findFiberByHostInstance: function () {
return null;
},
bundleType: 1,
version: "19.0.0-www-modern-e02baf6c92-20240627",
version: "19.0.0-www-modern-315109b02b-20240701",
rendererPackageName: "react-art"
});
var ClippingRectangle = TYPES.CLIPPING_RECTANGLE,
Expand Down
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactART-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -10711,7 +10711,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "19.0.0-www-classic-e02baf6c92-20240627",
version: "19.0.0-www-classic-315109b02b-20240701",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1386 = {
Expand Down Expand Up @@ -10742,7 +10742,7 @@ var internals$jscomp$inline_1386 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-classic-e02baf6c92-20240627"
reconcilerVersion: "19.0.0-www-classic-315109b02b-20240701"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1387 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactART-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -10164,7 +10164,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "19.0.0-www-modern-e02baf6c92-20240627",
version: "19.0.0-www-modern-315109b02b-20240701",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1372 = {
Expand Down Expand Up @@ -10195,7 +10195,7 @@ var internals$jscomp$inline_1372 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-modern-e02baf6c92-20240627"
reconcilerVersion: "19.0.0-www-modern-315109b02b-20240701"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1373 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -27370,11 +27370,11 @@ __DEV__ &&
: flushSyncErrorInBuildsThatSupportLegacyMode;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-www-classic-e02baf6c92-20240627" !== isomorphicReactPackageVersion)
if ("19.0.0-www-classic-315109b02b-20240701" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.0.0-www-classic-e02baf6c92-20240627\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.0.0-www-classic-315109b02b-20240701\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -27440,12 +27440,12 @@ __DEV__ &&
scheduleRoot: scheduleRoot,
setRefreshHandler: setRefreshHandler,
getCurrentFiber: getCurrentFiberForDevTools,
reconcilerVersion: "19.0.0-www-classic-e02baf6c92-20240627"
reconcilerVersion: "19.0.0-www-classic-315109b02b-20240701"
});
})({
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 1,
version: "19.0.0-www-classic-e02baf6c92-20240627",
version: "19.0.0-www-classic-315109b02b-20240701",
rendererPackageName: "react-dom"
}) &&
canUseDOM &&
Expand Down Expand Up @@ -28088,7 +28088,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.0.0-www-classic-e02baf6c92-20240627";
exports.version = "19.0.0-www-classic-315109b02b-20240701";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -26517,11 +26517,11 @@ __DEV__ &&
return_targetInst = null;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-www-modern-e02baf6c92-20240627" !== isomorphicReactPackageVersion)
if ("19.0.0-www-modern-315109b02b-20240701" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.0.0-www-modern-e02baf6c92-20240627\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.0.0-www-modern-315109b02b-20240701\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -26586,12 +26586,12 @@ __DEV__ &&
scheduleRoot: scheduleRoot,
setRefreshHandler: setRefreshHandler,
getCurrentFiber: getCurrentFiberForDevTools,
reconcilerVersion: "19.0.0-www-modern-e02baf6c92-20240627"
reconcilerVersion: "19.0.0-www-modern-315109b02b-20240701"
});
})({
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 1,
version: "19.0.0-www-modern-e02baf6c92-20240627",
version: "19.0.0-www-modern-315109b02b-20240701",
rendererPackageName: "react-dom"
}) &&
canUseDOM &&
Expand Down Expand Up @@ -27187,7 +27187,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.0.0-www-modern-e02baf6c92-20240627";
exports.version = "19.0.0-www-modern-315109b02b-20240701";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -17156,14 +17156,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1769 = React.version;
if (
"19.0.0-www-classic-e02baf6c92-20240627" !==
"19.0.0-www-classic-315109b02b-20240701" !==
isomorphicReactPackageVersion$jscomp$inline_1769
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1769,
"19.0.0-www-classic-e02baf6c92-20240627"
"19.0.0-www-classic-315109b02b-20240701"
)
);
function flushSyncFromReconciler(fn) {
Expand Down Expand Up @@ -17209,7 +17209,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1776 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "19.0.0-www-classic-e02baf6c92-20240627",
version: "19.0.0-www-classic-315109b02b-20240701",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2220 = {
Expand Down Expand Up @@ -17239,7 +17239,7 @@ var internals$jscomp$inline_2220 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-classic-e02baf6c92-20240627"
reconcilerVersion: "19.0.0-www-classic-315109b02b-20240701"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2221 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -17703,4 +17703,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-classic-e02baf6c92-20240627";
exports.version = "19.0.0-www-classic-315109b02b-20240701";
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -16471,14 +16471,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1740 = React.version;
if (
"19.0.0-www-modern-e02baf6c92-20240627" !==
"19.0.0-www-modern-315109b02b-20240701" !==
isomorphicReactPackageVersion$jscomp$inline_1740
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1740,
"19.0.0-www-modern-e02baf6c92-20240627"
"19.0.0-www-modern-315109b02b-20240701"
)
);
Internals.findDOMNode = function (componentOrElement) {
Expand All @@ -16497,7 +16497,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1742 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "19.0.0-www-modern-e02baf6c92-20240627",
version: "19.0.0-www-modern-315109b02b-20240701",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2211 = {
Expand Down Expand Up @@ -16527,7 +16527,7 @@ var internals$jscomp$inline_2211 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-modern-e02baf6c92-20240627"
reconcilerVersion: "19.0.0-www-modern-315109b02b-20240701"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2212 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -16898,4 +16898,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-modern-e02baf6c92-20240627";
exports.version = "19.0.0-www-modern-315109b02b-20240701";
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -17923,14 +17923,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1856 = React.version;
if (
"19.0.0-www-classic-e02baf6c92-20240627" !==
"19.0.0-www-classic-315109b02b-20240701" !==
isomorphicReactPackageVersion$jscomp$inline_1856
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1856,
"19.0.0-www-classic-e02baf6c92-20240627"
"19.0.0-www-classic-315109b02b-20240701"
)
);
function flushSyncFromReconciler(fn) {
Expand Down Expand Up @@ -17976,7 +17976,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1863 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "19.0.0-www-classic-e02baf6c92-20240627",
version: "19.0.0-www-classic-315109b02b-20240701",
rendererPackageName: "react-dom"
};
(function (internals) {
Expand Down Expand Up @@ -18020,7 +18020,7 @@ var devToolsConfig$jscomp$inline_1863 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-classic-e02baf6c92-20240627"
reconcilerVersion: "19.0.0-www-classic-315109b02b-20240701"
});
function ReactDOMRoot(internalRoot) {
this._internalRoot = internalRoot;
Expand Down Expand Up @@ -18471,7 +18471,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-classic-e02baf6c92-20240627";
exports.version = "19.0.0-www-classic-315109b02b-20240701";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -17221,14 +17221,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1827 = React.version;
if (
"19.0.0-www-modern-e02baf6c92-20240627" !==
"19.0.0-www-modern-315109b02b-20240701" !==
isomorphicReactPackageVersion$jscomp$inline_1827
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1827,
"19.0.0-www-modern-e02baf6c92-20240627"
"19.0.0-www-modern-315109b02b-20240701"
)
);
Internals.findDOMNode = function (componentOrElement) {
Expand All @@ -17247,7 +17247,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1829 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "19.0.0-www-modern-e02baf6c92-20240627",
version: "19.0.0-www-modern-315109b02b-20240701",
rendererPackageName: "react-dom"
};
(function (internals) {
Expand Down Expand Up @@ -17291,7 +17291,7 @@ var devToolsConfig$jscomp$inline_1829 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-modern-e02baf6c92-20240627"
reconcilerVersion: "19.0.0-www-modern-315109b02b-20240701"
});
function ReactDOMRoot(internalRoot) {
this._internalRoot = internalRoot;
Expand Down Expand Up @@ -17649,7 +17649,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-modern-e02baf6c92-20240627";
exports.version = "19.0.0-www-modern-315109b02b-20240701";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Loading

0 comments on commit b8decad

Please sign in to comment.