Skip to content

Commit

Permalink
[fizz] fix empty string href double warning (#31783)
Browse files Browse the repository at this point in the history
I think this is the suggested change from
#31765 (comment)

But no tests fail and I'm not sure how to test it? Seems sus.

Also seems like the `removeAttribute` here should be changed?

https://github.com/facebook/react/blob/9d9f12f2699a049777fa88914306ad4de9e2b74d/packages/react-dom-bindings/src/client/ReactDOMComponent.js#L400-L427

DiffTrain build for [bf883be](bf883be)
  • Loading branch information
rickhanlonii committed Jan 3, 2025
1 parent 8242ee3 commit 72bde5d
Show file tree
Hide file tree
Showing 34 changed files with 258 additions and 226 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3b009b4cd58d382cfde2a72232c87df1a34d56d5
bf883bebbc4973dea0e4801a5a62f82043ff57ee
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION_TRANSFORMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3b009b4cd58d382cfde2a72232c87df1a34d56d5
bf883bebbc4973dea0e4801a5a62f82043ff57ee
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 @@ -1942,7 +1942,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.1.0-www-classic-3b009b4c-20250102";
exports.version = "19.1.0-www-classic-bf883beb-20250103";
"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 @@ -1942,7 +1942,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.1.0-www-modern-3b009b4c-20250102";
exports.version = "19.1.0-www-modern-bf883beb-20250103";
"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 @@ -630,4 +630,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-classic-3b009b4c-20250102";
exports.version = "19.1.0-www-classic-bf883beb-20250103";
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 @@ -630,4 +630,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-modern-3b009b4c-20250102";
exports.version = "19.1.0-www-modern-bf883beb-20250103";
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 @@ -634,7 +634,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-classic-3b009b4c-20250102";
exports.version = "19.1.0-www-classic-bf883beb-20250103";
"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 @@ -634,7 +634,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-modern-3b009b4c-20250102";
exports.version = "19.1.0-www-modern-bf883beb-20250103";
"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 @@ -16914,10 +16914,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-classic-3b009b4c-20250102",
version: "19.1.0-www-classic-bf883beb-20250103",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-3b009b4c-20250102"
reconcilerVersion: "19.1.0-www-classic-bf883beb-20250103"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -16951,7 +16951,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-classic-3b009b4c-20250102";
exports.version = "19.1.0-www-classic-bf883beb-20250103";
"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 @@ -16677,10 +16677,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-modern-3b009b4c-20250102",
version: "19.1.0-www-modern-bf883beb-20250103",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-3b009b4c-20250102"
reconcilerVersion: "19.1.0-www-modern-bf883beb-20250103"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -16714,7 +16714,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-modern-3b009b4c-20250102";
exports.version = "19.1.0-www-modern-bf883beb-20250103";
"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 @@ -10813,10 +10813,10 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1510 = {
bundleType: 0,
version: "19.1.0-www-classic-3b009b4c-20250102",
version: "19.1.0-www-classic-bf883beb-20250103",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-3b009b4c-20250102"
reconcilerVersion: "19.1.0-www-classic-bf883beb-20250103"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1511 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -10842,4 +10842,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-classic-3b009b4c-20250102";
exports.version = "19.1.0-www-classic-bf883beb-20250103";
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 @@ -10529,10 +10529,10 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1489 = {
bundleType: 0,
version: "19.1.0-www-modern-3b009b4c-20250102",
version: "19.1.0-www-modern-bf883beb-20250103",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-3b009b4c-20250102"
reconcilerVersion: "19.1.0-www-modern-bf883beb-20250103"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1490 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -10558,4 +10558,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-modern-3b009b4c-20250102";
exports.version = "19.1.0-www-modern-bf883beb-20250103";
76 changes: 39 additions & 37 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -13956,7 +13956,9 @@ __DEV__ &&
if (
((hoistableRoot = maybeNodes[i]),
hoistableRoot.getAttribute("href") ===
(null == current.href ? null : current.href) &&
(null == current.href || "" === current.href
? null
: current.href) &&
hoistableRoot.getAttribute("rel") ===
(null == current.rel ? null : current.rel) &&
hoistableRoot.getAttribute("title") ===
Expand Down Expand Up @@ -21219,36 +21221,34 @@ __DEV__ &&
}
case "src":
case "href":
"" !== propKey ||
("a" === tag && "href" === value) ||
("object" === tag && "data" === value)
? hydrateSanitizedAttribute(
domElement,
value,
value,
propKey,
extraAttributes,
serverDifferences
)
: ("src" === value
? error$jscomp$0(
'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
value,
value
)
: error$jscomp$0(
'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
value,
value
),
hydrateSanitizedAttribute(
domElement,
value,
value,
null,
extraAttributes,
serverDifferences
));
if (
!(
"" !== propKey ||
("a" === tag && "href" === value) ||
("object" === tag && "data" === value)
)
) {
"src" === value
? error$jscomp$0(
'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
value,
value
)
: error$jscomp$0(
'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
value,
value
);
continue;
}
hydrateSanitizedAttribute(
domElement,
value,
value,
propKey,
extraAttributes,
serverDifferences
);
continue;
case "action":
case "formAction":
Expand Down Expand Up @@ -21875,7 +21875,9 @@ __DEV__ &&
else if (
name !== anyProps.rel ||
instance.getAttribute("href") !==
(null == anyProps.href ? null : anyProps.href) ||
(null == anyProps.href || "" === anyProps.href
? null
: anyProps.href) ||
instance.getAttribute("crossorigin") !==
(null == anyProps.crossOrigin
? null
Expand Down Expand Up @@ -27401,11 +27403,11 @@ __DEV__ &&
return_targetInst = null;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.1.0-www-classic-3b009b4c-20250102" !== isomorphicReactPackageVersion)
if ("19.1.0-www-classic-bf883beb-20250103" !== 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.1.0-www-classic-3b009b4c-20250102\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.1.0-www-classic-bf883beb-20250103\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -27448,10 +27450,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-classic-3b009b4c-20250102",
version: "19.1.0-www-classic-bf883beb-20250103",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-3b009b4c-20250102"
reconcilerVersion: "19.1.0-www-classic-bf883beb-20250103"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -28049,7 +28051,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.1.0-www-classic-3b009b4c-20250102";
exports.version = "19.1.0-www-classic-bf883beb-20250103";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
76 changes: 39 additions & 37 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -13755,7 +13755,9 @@ __DEV__ &&
if (
((hoistableRoot = maybeNodes[i]),
hoistableRoot.getAttribute("href") ===
(null == current.href ? null : current.href) &&
(null == current.href || "" === current.href
? null
: current.href) &&
hoistableRoot.getAttribute("rel") ===
(null == current.rel ? null : current.rel) &&
hoistableRoot.getAttribute("title") ===
Expand Down Expand Up @@ -21006,36 +21008,34 @@ __DEV__ &&
}
case "src":
case "href":
"" !== propKey ||
("a" === tag && "href" === value) ||
("object" === tag && "data" === value)
? hydrateSanitizedAttribute(
domElement,
value,
value,
propKey,
extraAttributes,
serverDifferences
)
: ("src" === value
? error$jscomp$0(
'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
value,
value
)
: error$jscomp$0(
'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
value,
value
),
hydrateSanitizedAttribute(
domElement,
value,
value,
null,
extraAttributes,
serverDifferences
));
if (
!(
"" !== propKey ||
("a" === tag && "href" === value) ||
("object" === tag && "data" === value)
)
) {
"src" === value
? error$jscomp$0(
'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
value,
value
)
: error$jscomp$0(
'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
value,
value
);
continue;
}
hydrateSanitizedAttribute(
domElement,
value,
value,
propKey,
extraAttributes,
serverDifferences
);
continue;
case "action":
case "formAction":
Expand Down Expand Up @@ -21662,7 +21662,9 @@ __DEV__ &&
else if (
name !== anyProps.rel ||
instance.getAttribute("href") !==
(null == anyProps.href ? null : anyProps.href) ||
(null == anyProps.href || "" === anyProps.href
? null
: anyProps.href) ||
instance.getAttribute("crossorigin") !==
(null == anyProps.crossOrigin
? null
Expand Down Expand Up @@ -27180,11 +27182,11 @@ __DEV__ &&
return_targetInst = null;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.1.0-www-modern-3b009b4c-20250102" !== isomorphicReactPackageVersion)
if ("19.1.0-www-modern-bf883beb-20250103" !== 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.1.0-www-modern-3b009b4c-20250102\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.1.0-www-modern-bf883beb-20250103\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -27227,10 +27229,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-modern-3b009b4c-20250102",
version: "19.1.0-www-modern-bf883beb-20250103",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-3b009b4c-20250102"
reconcilerVersion: "19.1.0-www-modern-bf883beb-20250103"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -27828,7 +27830,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.1.0-www-modern-3b009b4c-20250102";
exports.version = "19.1.0-www-modern-bf883beb-20250103";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Loading

0 comments on commit 72bde5d

Please sign in to comment.