Skip to content

Commit

Permalink
[Fiber][Dev] Relax dom nesting validation when the root is a Document…
Browse files Browse the repository at this point in the history
…, html tag, or body tag (#32252)

followup to
* #32069
* #32163
* #32224

in react-dom in Dev we validate that the tag nesting is valid. This is
motivated primarily because while browsers are tolerant to poor HTML
there are many cases that if server rendered will be hydrated in a way
that will break hydration.

With the changes to singleton scoping where the document body is now the
implicit render/hydration context for arbitrary tags at the root we need
to adjust the validation logic to allow for valid programs such as
rendering divs as a child of a Document (since this div will actually
insert into the body).

DiffTrain build for [a0fdb63](a0fdb63)
  • Loading branch information
gnoff committed Feb 6, 2025
1 parent 6d25b6a commit 5637e8e
Show file tree
Hide file tree
Showing 34 changed files with 422 additions and 278 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b48e739998432fc9672a42d0d04515980b8cae82
a0fdb6306043b9f049106e58dcec107d8dbed2b1
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION_TRANSFORMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b48e739998432fc9672a42d0d04515980b8cae82
a0fdb6306043b9f049106e58dcec107d8dbed2b1
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 @@ -1972,7 +1972,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.1.0-www-classic-b48e7399-20250206";
exports.version = "19.1.0-www-classic-a0fdb630-20250206";
"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 @@ -1972,7 +1972,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.1.0-www-modern-b48e7399-20250206";
exports.version = "19.1.0-www-modern-a0fdb630-20250206";
"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 @@ -639,4 +639,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-classic-b48e7399-20250206";
exports.version = "19.1.0-www-classic-a0fdb630-20250206";
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 @@ -639,4 +639,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-modern-b48e7399-20250206";
exports.version = "19.1.0-www-modern-a0fdb630-20250206";
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 @@ -643,7 +643,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-classic-b48e7399-20250206";
exports.version = "19.1.0-www-classic-a0fdb630-20250206";
"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 @@ -643,7 +643,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-modern-b48e7399-20250206";
exports.version = "19.1.0-www-modern-a0fdb630-20250206";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -17417,10 +17417,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-classic-b48e7399-20250206",
version: "19.1.0-www-classic-a0fdb630-20250206",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-b48e7399-20250206"
reconcilerVersion: "19.1.0-www-classic-a0fdb630-20250206"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -17454,7 +17454,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-classic-b48e7399-20250206";
exports.version = "19.1.0-www-classic-a0fdb630-20250206";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -17189,10 +17189,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-modern-b48e7399-20250206",
version: "19.1.0-www-modern-a0fdb630-20250206",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-b48e7399-20250206"
reconcilerVersion: "19.1.0-www-modern-a0fdb630-20250206"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -17226,7 +17226,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-modern-b48e7399-20250206";
exports.version = "19.1.0-www-modern-a0fdb630-20250206";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -11275,10 +11275,10 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1567 = {
bundleType: 0,
version: "19.1.0-www-classic-b48e7399-20250206",
version: "19.1.0-www-classic-a0fdb630-20250206",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-b48e7399-20250206"
reconcilerVersion: "19.1.0-www-classic-a0fdb630-20250206"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1568 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -11304,4 +11304,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-classic-b48e7399-20250206";
exports.version = "19.1.0-www-classic-a0fdb630-20250206";
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -10990,10 +10990,10 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1540 = {
bundleType: 0,
version: "19.1.0-www-modern-b48e7399-20250206",
version: "19.1.0-www-modern-a0fdb630-20250206",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-b48e7399-20250206"
reconcilerVersion: "19.1.0-www-modern-a0fdb630-20250206"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1541 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -11019,4 +11019,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-modern-b48e7399-20250206";
exports.version = "19.1.0-www-modern-a0fdb630-20250206";
Loading

0 comments on commit 5637e8e

Please sign in to comment.