Skip to content

Commit

Permalink
Clean up empty string special cases (#28475)
Browse files Browse the repository at this point in the history
This was fixed in #22807 so we
don't need these special cases anymore.

DiffTrain build for [bb4b147](bb4b147)
  • Loading branch information
rickhanlonii committed Mar 1, 2024
1 parent b45dfde commit df4b99c
Show file tree
Hide file tree
Showing 14 changed files with 88 additions and 164 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e7849b50bcefc0742ca342d70284d82cfcf990e5
bb4b147da9a892529995f55f15f19f46a00cf4f6
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 @@ -633,4 +633,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-www-classic-d4b2bc87";
exports.version = "18.3.0-www-classic-46c2f9a3";
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 @@ -637,7 +637,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-www-classic-012fabe8";
exports.version = "18.3.0-www-classic-4f385f77";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion 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 = "18.3.0-www-modern-78796c31";
var ReactVersion = "18.3.0-www-modern-0bd008ad";

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down
32 changes: 8 additions & 24 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -8566,22 +8566,17 @@ if (__DEV__) {
}

var text = fiber.pendingProps;
var isHydratable = isHydratableText(text);
var shouldKeepWarning = true;

if (isHydratable) {
// Validate that this is ok to render here before any mismatches.
var currentHostContext = getHostContext();
shouldKeepWarning = validateHydratableTextInstance(
text,
currentHostContext
);
}
var shouldKeepWarning = true; // Validate that this is ok to render here before any mismatches.

var currentHostContext = getHostContext();
shouldKeepWarning = validateHydratableTextInstance(
text,
currentHostContext
);
var initialInstance = nextHydratableInstance;
var nextInstance = nextHydratableInstance;

if (!nextInstance || !isHydratable) {
if (!nextInstance) {
// We exclude non hydrabable text because we know there are no matching hydratables.
// We either throw or insert depending on the render mode.
if (shouldClientRenderOnMismatch(fiber)) {
Expand Down Expand Up @@ -36053,7 +36048,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "18.3.0-www-classic-0bf4f6f1";
var ReactVersion = "18.3.0-www-classic-d2fdad5d";

function createPortal$1(
children,
Expand Down Expand Up @@ -43787,14 +43782,6 @@ if (__DEV__) {
}
function warnForInsertedHydratedText(parentNode, text) {
{
if (text === "") {
// We expect to insert empty text nodes since they're not represented in
// the HTML.
// TODO: Remove this special case if we can just avoid inserting empty
// text nodes.
return;
}

if (didWarnInvalidHydration) {
return;
}
Expand Down Expand Up @@ -44652,9 +44639,6 @@ if (__DEV__) {

return;
} // Making this so we can eventually move all of the instance caching to the commit phase.
function isHydratableText(text) {
return text !== "";
}
function canHydrateInstance(instance, type, props, inRootOrSingleton) {
while (instance.nodeType === ELEMENT_NODE) {
var element = instance;
Expand Down
32 changes: 8 additions & 24 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -8517,22 +8517,17 @@ if (__DEV__) {
}

var text = fiber.pendingProps;
var isHydratable = isHydratableText(text);
var shouldKeepWarning = true;

if (isHydratable) {
// Validate that this is ok to render here before any mismatches.
var currentHostContext = getHostContext();
shouldKeepWarning = validateHydratableTextInstance(
text,
currentHostContext
);
}
var shouldKeepWarning = true; // Validate that this is ok to render here before any mismatches.

var currentHostContext = getHostContext();
shouldKeepWarning = validateHydratableTextInstance(
text,
currentHostContext
);
var initialInstance = nextHydratableInstance;
var nextInstance = nextHydratableInstance;

if (!nextInstance || !isHydratable) {
if (!nextInstance) {
// We exclude non hydrabable text because we know there are no matching hydratables.
// We either throw or insert depending on the render mode.
if (shouldClientRenderOnMismatch(fiber)) {
Expand Down Expand Up @@ -35889,7 +35884,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "18.3.0-www-modern-8ea39922";
var ReactVersion = "18.3.0-www-modern-9166f5c5";

function createPortal$1(
children,
Expand Down Expand Up @@ -44424,14 +44419,6 @@ if (__DEV__) {
}
function warnForInsertedHydratedText(parentNode, text) {
{
if (text === "") {
// We expect to insert empty text nodes since they're not represented in
// the HTML.
// TODO: Remove this special case if we can just avoid inserting empty
// text nodes.
return;
}

if (didWarnInvalidHydration) {
return;
}
Expand Down Expand Up @@ -45289,9 +45276,6 @@ if (__DEV__) {

return;
} // Making this so we can eventually move all of the instance caching to the commit phase.
function isHydratableText(text) {
return text !== "";
}
function canHydrateInstance(instance, type, props, inRootOrSingleton) {
while (instance.nodeType === ELEMENT_NODE) {
var element = instance;
Expand Down
24 changes: 11 additions & 13 deletions compiled/facebook-www/ReactDOM-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -11758,9 +11758,7 @@ beginWork = function (current, workInProgress, renderLanes) {
return (
null === current &&
isHydrating &&
(((Component = "" !== workInProgress.pendingProps),
(current = renderLanes = nextHydratableInstance),
current && Component)
(((current = renderLanes = nextHydratableInstance), current)
? tryHydrateText(workInProgress, current) ||
(shouldClientRenderOnMismatch(workInProgress) &&
throwOnHydrationMismatch(),
Expand Down Expand Up @@ -17229,10 +17227,10 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1819 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-classic-ff9af76d",
version: "18.3.0-www-classic-90d46209",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2179 = {
var internals$jscomp$inline_2178 = {
bundleType: devToolsConfig$jscomp$inline_1819.bundleType,
version: devToolsConfig$jscomp$inline_1819.version,
rendererPackageName: devToolsConfig$jscomp$inline_1819.rendererPackageName,
Expand All @@ -17259,19 +17257,19 @@ var internals$jscomp$inline_2179 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-classic-ff9af76d"
reconcilerVersion: "18.3.0-www-classic-90d46209"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2180 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
var hook$jscomp$inline_2179 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
!hook$jscomp$inline_2180.isDisabled &&
hook$jscomp$inline_2180.supportsFiber
!hook$jscomp$inline_2179.isDisabled &&
hook$jscomp$inline_2179.supportsFiber
)
try {
(rendererID = hook$jscomp$inline_2180.inject(
internals$jscomp$inline_2179
(rendererID = hook$jscomp$inline_2179.inject(
internals$jscomp$inline_2178
)),
(injectedHook = hook$jscomp$inline_2180);
(injectedHook = hook$jscomp$inline_2179);
} catch (err) {}
}
assign(Internals, {
Expand Down Expand Up @@ -17602,4 +17600,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactCurrentDispatcher$2.current.useHostTransitionStatus();
};
exports.version = "18.3.0-www-classic-ff9af76d";
exports.version = "18.3.0-www-classic-90d46209";
24 changes: 11 additions & 13 deletions compiled/facebook-www/ReactDOM-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -11576,9 +11576,7 @@ beginWork = function (current, workInProgress, renderLanes) {
return (
null === current &&
isHydrating &&
(((Component = "" !== workInProgress.pendingProps),
(current = renderLanes = nextHydratableInstance),
current && Component)
(((current = renderLanes = nextHydratableInstance), current)
? tryHydrateText(workInProgress, current) ||
(shouldClientRenderOnMismatch(workInProgress) &&
throwOnHydrationMismatch(),
Expand Down Expand Up @@ -16745,10 +16743,10 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1778 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-modern-7d36ed41",
version: "18.3.0-www-modern-2d6dd0ff",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2143 = {
var internals$jscomp$inline_2142 = {
bundleType: devToolsConfig$jscomp$inline_1778.bundleType,
version: devToolsConfig$jscomp$inline_1778.version,
rendererPackageName: devToolsConfig$jscomp$inline_1778.rendererPackageName,
Expand Down Expand Up @@ -16776,19 +16774,19 @@ var internals$jscomp$inline_2143 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-modern-7d36ed41"
reconcilerVersion: "18.3.0-www-modern-2d6dd0ff"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2144 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
var hook$jscomp$inline_2143 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
!hook$jscomp$inline_2144.isDisabled &&
hook$jscomp$inline_2144.supportsFiber
!hook$jscomp$inline_2143.isDisabled &&
hook$jscomp$inline_2143.supportsFiber
)
try {
(rendererID = hook$jscomp$inline_2144.inject(
internals$jscomp$inline_2143
(rendererID = hook$jscomp$inline_2143.inject(
internals$jscomp$inline_2142
)),
(injectedHook = hook$jscomp$inline_2144);
(injectedHook = hook$jscomp$inline_2143);
} catch (err) {}
}
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
Expand Down Expand Up @@ -17047,4 +17045,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactCurrentDispatcher$2.current.useHostTransitionStatus();
};
exports.version = "18.3.0-www-modern-7d36ed41";
exports.version = "18.3.0-www-modern-2d6dd0ff";
10 changes: 4 additions & 6 deletions compiled/facebook-www/ReactDOM-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -12493,9 +12493,7 @@ beginWork = function (current, workInProgress, renderLanes) {
return (
null === current &&
isHydrating &&
(((Component = "" !== workInProgress.pendingProps),
(current = renderLanes = nextHydratableInstance),
current && Component)
(((current = renderLanes = nextHydratableInstance), current)
? tryHydrateText(workInProgress, current) ||
(shouldClientRenderOnMismatch(workInProgress) &&
throwOnHydrationMismatch(),
Expand Down Expand Up @@ -17998,7 +17996,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1904 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-classic-316d7d0d",
version: "18.3.0-www-classic-124c1c92",
rendererPackageName: "react-dom"
};
(function (internals) {
Expand Down Expand Up @@ -18042,7 +18040,7 @@ var devToolsConfig$jscomp$inline_1904 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-classic-316d7d0d"
reconcilerVersion: "18.3.0-www-classic-124c1c92"
});
assign(Internals, {
ReactBrowserEventEmitter: {
Expand Down Expand Up @@ -18372,7 +18370,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactCurrentDispatcher$2.current.useHostTransitionStatus();
};
exports.version = "18.3.0-www-classic-316d7d0d";
exports.version = "18.3.0-www-classic-124c1c92";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
10 changes: 4 additions & 6 deletions compiled/facebook-www/ReactDOM-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -12305,9 +12305,7 @@ beginWork = function (current, workInProgress, renderLanes) {
return (
null === current &&
isHydrating &&
(((Component = "" !== workInProgress.pendingProps),
(current = renderLanes = nextHydratableInstance),
current && Component)
(((current = renderLanes = nextHydratableInstance), current)
? tryHydrateText(workInProgress, current) ||
(shouldClientRenderOnMismatch(workInProgress) &&
throwOnHydrationMismatch(),
Expand Down Expand Up @@ -17508,7 +17506,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1863 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-modern-78796c31",
version: "18.3.0-www-modern-0bd008ad",
rendererPackageName: "react-dom"
};
(function (internals) {
Expand Down Expand Up @@ -17553,7 +17551,7 @@ var devToolsConfig$jscomp$inline_1863 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-modern-78796c31"
reconcilerVersion: "18.3.0-www-modern-0bd008ad"
});
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
exports.createPortal = function (children, container) {
Expand Down Expand Up @@ -17811,7 +17809,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactCurrentDispatcher$2.current.useHostTransitionStatus();
};
exports.version = "18.3.0-www-modern-78796c31";
exports.version = "18.3.0-www-modern-0bd008ad";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Loading

0 comments on commit df4b99c

Please sign in to comment.