Skip to content

Commit

Permalink
Remove enableClientRenderFallbackOnTextMismatch flag (#28458)
Browse files Browse the repository at this point in the history
Build on top of #28440.

This lets us remove the path where updates are tracked on differences in
text.

DiffTrain build for [84c84d7](84c84d7)
  • Loading branch information
sebmarkbage committed Mar 26, 2024
1 parent 8ee89e3 commit 71cc6ab
Show file tree
Hide file tree
Showing 20 changed files with 462 additions and 743 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
670d61bea23470e980ba13c1c8441e375779b0b8
84c84d72f11ff1961a103b3cd59919876e48f759
6 changes: 2 additions & 4 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if (__DEV__) {
return self;
}

var ReactVersion = "19.0.0-www-classic-841735f0";
var ReactVersion = "19.0.0-www-classic-ae7c23fd";

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down Expand Up @@ -20031,9 +20031,7 @@ if (__DEV__) {
var _wasHydrated3 = popHydrationState();

if (_wasHydrated3) {
if (prepareToHydrateHostTextInstance()) {
markUpdate(workInProgress);
}
prepareToHydrateHostTextInstance();
} else {
workInProgress.stateNode = createTextInstance(newText);
}
Expand Down
6 changes: 2 additions & 4 deletions compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if (__DEV__) {
return self;
}

var ReactVersion = "19.0.0-www-modern-37e2c118";
var ReactVersion = "19.0.0-www-modern-c5863941";

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down Expand Up @@ -19712,9 +19712,7 @@ if (__DEV__) {
var _wasHydrated3 = popHydrationState();

if (_wasHydrated3) {
if (prepareToHydrateHostTextInstance()) {
markUpdate(workInProgress);
}
prepareToHydrateHostTextInstance();
} else {
workInProgress.stateNode = createTextInstance(newText);
}
Expand Down
30 changes: 15 additions & 15 deletions compiled/facebook-www/ReactART-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -10609,19 +10609,19 @@ var slice = Array.prototype.slice,
};
return Text;
})(React.Component),
devToolsConfig$jscomp$inline_1133 = {
devToolsConfig$jscomp$inline_1132 = {
findFiberByHostInstance: function () {
return null;
},
bundleType: 0,
version: "19.0.0-www-classic-a714d6cd",
version: "19.0.0-www-classic-3c2c0375",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1338 = {
bundleType: devToolsConfig$jscomp$inline_1133.bundleType,
version: devToolsConfig$jscomp$inline_1133.version,
rendererPackageName: devToolsConfig$jscomp$inline_1133.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1133.rendererConfig,
var internals$jscomp$inline_1337 = {
bundleType: devToolsConfig$jscomp$inline_1132.bundleType,
version: devToolsConfig$jscomp$inline_1132.version,
rendererPackageName: devToolsConfig$jscomp$inline_1132.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1132.rendererConfig,
overrideHookState: null,
overrideHookStateDeletePath: null,
overrideHookStateRenamePath: null,
Expand All @@ -10638,26 +10638,26 @@ var internals$jscomp$inline_1338 = {
return null === fiber ? null : fiber.stateNode;
},
findFiberByHostInstance:
devToolsConfig$jscomp$inline_1133.findFiberByHostInstance ||
devToolsConfig$jscomp$inline_1132.findFiberByHostInstance ||
emptyFindFiberByHostInstance,
findHostInstancesForRefresh: null,
scheduleRefresh: null,
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-classic-a714d6cd"
reconcilerVersion: "19.0.0-www-classic-3c2c0375"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1339 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
var hook$jscomp$inline_1338 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
!hook$jscomp$inline_1339.isDisabled &&
hook$jscomp$inline_1339.supportsFiber
!hook$jscomp$inline_1338.isDisabled &&
hook$jscomp$inline_1338.supportsFiber
)
try {
(rendererID = hook$jscomp$inline_1339.inject(
internals$jscomp$inline_1338
(rendererID = hook$jscomp$inline_1338.inject(
internals$jscomp$inline_1337
)),
(injectedHook = hook$jscomp$inline_1339);
(injectedHook = hook$jscomp$inline_1338);
} catch (err) {}
}
var Path = Mode$1.Path;
Expand Down
30 changes: 15 additions & 15 deletions compiled/facebook-www/ReactART-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -10264,19 +10264,19 @@ var slice = Array.prototype.slice,
};
return Text;
})(React.Component),
devToolsConfig$jscomp$inline_1113 = {
devToolsConfig$jscomp$inline_1112 = {
findFiberByHostInstance: function () {
return null;
},
bundleType: 0,
version: "19.0.0-www-modern-3c09b75a",
version: "19.0.0-www-modern-f6a224b8",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1318 = {
bundleType: devToolsConfig$jscomp$inline_1113.bundleType,
version: devToolsConfig$jscomp$inline_1113.version,
rendererPackageName: devToolsConfig$jscomp$inline_1113.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1113.rendererConfig,
var internals$jscomp$inline_1317 = {
bundleType: devToolsConfig$jscomp$inline_1112.bundleType,
version: devToolsConfig$jscomp$inline_1112.version,
rendererPackageName: devToolsConfig$jscomp$inline_1112.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1112.rendererConfig,
overrideHookState: null,
overrideHookStateDeletePath: null,
overrideHookStateRenamePath: null,
Expand All @@ -10293,26 +10293,26 @@ var internals$jscomp$inline_1318 = {
return null === fiber ? null : fiber.stateNode;
},
findFiberByHostInstance:
devToolsConfig$jscomp$inline_1113.findFiberByHostInstance ||
devToolsConfig$jscomp$inline_1112.findFiberByHostInstance ||
emptyFindFiberByHostInstance,
findHostInstancesForRefresh: null,
scheduleRefresh: null,
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-modern-3c09b75a"
reconcilerVersion: "19.0.0-www-modern-f6a224b8"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1319 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
var hook$jscomp$inline_1318 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
!hook$jscomp$inline_1319.isDisabled &&
hook$jscomp$inline_1319.supportsFiber
!hook$jscomp$inline_1318.isDisabled &&
hook$jscomp$inline_1318.supportsFiber
)
try {
(rendererID = hook$jscomp$inline_1319.inject(
internals$jscomp$inline_1318
(rendererID = hook$jscomp$inline_1318.inject(
internals$jscomp$inline_1317
)),
(injectedHook = hook$jscomp$inline_1319);
(injectedHook = hook$jscomp$inline_1318);
} catch (err) {}
}
var Path = Mode$1.Path;
Expand Down
54 changes: 12 additions & 42 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,7 @@ if (__DEV__) {
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
useModernStrictMode = dynamicFeatureFlags.useModernStrictMode,
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp,
enableNewBooleanProps = dynamicFeatureFlags.enableNewBooleanProps,
enableClientRenderFallbackOnTextMismatch =
dynamicFeatureFlags.enableClientRenderFallbackOnTextMismatch; // On WWW, false is used for a new modern build.
enableNewBooleanProps = dynamicFeatureFlags.enableNewBooleanProps; // On WWW, false is used for a new modern build.
var enableProfilerTimer = true;
var enableProfilerCommitHooks = true;
var enableProfilerNestedUpdatePhase = true;
Expand Down Expand Up @@ -8548,9 +8546,13 @@ if (__DEV__) {
var textInstance = fiber.stateNode;
var textContent = fiber.memoizedProps;
var shouldWarnIfMismatchDev = !didSuspendOrErrorDEV;
var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);
var textIsDifferent = hydrateTextInstance(
textInstance,
textContent,
fiber
);

if (shouldUpdate) {
if (textIsDifferent) {
// We assume that prepareToHydrateHostTextInstance is called in a context where the
// hydration parent is the parent host component of this host text.
var returnFiber = hydrationParentFiber;
Expand All @@ -8565,13 +8567,6 @@ if (__DEV__) {
textContent,
shouldWarnIfMismatchDev
);

if (enableClientRenderFallbackOnTextMismatch) {
// In concurrent mode we never update the mismatched text,
// even if the error was ignored.
return false;
}

break;
}

Expand All @@ -8588,20 +8583,11 @@ if (__DEV__) {
textContent,
shouldWarnIfMismatchDev
);

if (enableClientRenderFallbackOnTextMismatch) {
// In concurrent mode we never update the mismatched text,
// even if the error was ignored.
return false;
}

break;
}
}
}
}

return shouldUpdate;
}

function prepareToHydrateHostSuspenseInstance(fiber) {
Expand Down Expand Up @@ -25212,9 +25198,7 @@ if (__DEV__) {
var _wasHydrated3 = popHydrationState(workInProgress);

if (_wasHydrated3) {
if (prepareToHydrateHostTextInstance(workInProgress)) {
markUpdate(workInProgress);
}
prepareToHydrateHostTextInstance(workInProgress);
} else {
workInProgress.stateNode = createTextInstance(
newText,
Expand Down Expand Up @@ -35582,7 +35566,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "19.0.0-www-classic-08e73f78";
var ReactVersion = "19.0.0-www-classic-57b2070e";

function createPortal$1(
children,
Expand Down Expand Up @@ -40357,13 +40341,10 @@ if (__DEV__) {
);
}
}
}
} // In concurrent roots, we throw when there's a text mismatch and revert to
// client rendering, up to the nearest Suspense boundary.

if (enableClientRenderFallbackOnTextMismatch) {
// In concurrent roots, we throw when there's a text mismatch and revert to
// client rendering, up to the nearest Suspense boundary.
throw new Error("Text content does not match server-rendered HTML.");
}
throw new Error("Text content does not match server-rendered HTML.");
}

function noop$2() {}
Expand Down Expand Up @@ -43251,17 +43232,6 @@ if (__DEV__) {
shouldWarnDev
);
}

if (!enableClientRenderFallbackOnTextMismatch) {
// We really should be patching this in the commit phase but since
// this only affects legacy mode hydration which is deprecated anyway
// we can get away with it.
// Host singletons get their children appended and don't use the text
// content mechanism.
if (tag !== "body") {
domElement.textContent = children;
}
}
}
}

Expand Down
Loading

0 comments on commit 71cc6ab

Please sign in to comment.