Skip to content

Commit 9682192

Browse files
committed
[fizz] fix empty string href double warning (facebook#31783)
I think this is the suggested change from facebook#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](facebook@bf883be)
1 parent d91307d commit 9682192

23 files changed

+178
-158
lines changed

compiled-rn/VERSION_NATIVE_FB

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19.1.0-native-fb-3b009b4c-20250102
1+
19.1.0-native-fb-bf883beb-20250103

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-dev.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<9bd134138f5b06cd767f897c60d22200>>
10+
* @generated SignedSource<<842b059f8fdd61080f90aabcf7208a9c>>
1111
*/
1212

1313
"use strict";
@@ -420,5 +420,5 @@ __DEV__ &&
420420
exports.useFormStatus = function () {
421421
return resolveDispatcher().useHostTransitionStatus();
422422
};
423-
exports.version = "19.1.0-native-fb-3b009b4c-20250102";
423+
exports.version = "19.1.0-native-fb-bf883beb-20250103";
424424
})();

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-prod.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<0948aeab04f6f5ed7045a019b211bcec>>
10+
* @generated SignedSource<<78d730b6659ff6543505d3fc8d2af426>>
1111
*/
1212

1313
"use strict";
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
203203
exports.useFormStatus = function () {
204204
return ReactSharedInternals.H.useHostTransitionStatus();
205205
};
206-
exports.version = "19.1.0-native-fb-3b009b4c-20250102";
206+
exports.version = "19.1.0-native-fb-bf883beb-20250103";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-profiling.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<0948aeab04f6f5ed7045a019b211bcec>>
10+
* @generated SignedSource<<78d730b6659ff6543505d3fc8d2af426>>
1111
*/
1212

1313
"use strict";
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
203203
exports.useFormStatus = function () {
204204
return ReactSharedInternals.H.useHostTransitionStatus();
205205
};
206-
exports.version = "19.1.0-native-fb-3b009b4c-20250102";
206+
exports.version = "19.1.0-native-fb-bf883beb-20250103";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-dev.js

+40-38
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<03613344aa6068afaba47c44eeaf2e5f>>
10+
* @generated SignedSource<<78486249bde5c057c1694badd22987eb>>
1111
*/
1212

1313
/*
@@ -12713,7 +12713,9 @@ __DEV__ &&
1271312713
if (
1271412714
((hoistableRoot = maybeNodes[i]),
1271512715
hoistableRoot.getAttribute("href") ===
12716-
(null == current.href ? null : current.href) &&
12716+
(null == current.href || "" === current.href
12717+
? null
12718+
: current.href) &&
1271712719
hoistableRoot.getAttribute("rel") ===
1271812720
(null == current.rel ? null : current.rel) &&
1271912721
hoistableRoot.getAttribute("title") ===
@@ -19702,36 +19704,34 @@ __DEV__ &&
1970219704
}
1970319705
case "src":
1970419706
case "href":
19705-
"" !== propKey ||
19706-
("a" === tag && "href" === value) ||
19707-
("object" === tag && "data" === value)
19708-
? hydrateSanitizedAttribute(
19709-
domElement,
19710-
value,
19711-
value,
19712-
propKey,
19713-
extraAttributes,
19714-
serverDifferences
19715-
)
19716-
: ("src" === value
19717-
? error$jscomp$0(
19718-
'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.',
19719-
value,
19720-
value
19721-
)
19722-
: error$jscomp$0(
19723-
'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.',
19724-
value,
19725-
value
19726-
),
19727-
hydrateSanitizedAttribute(
19728-
domElement,
19729-
value,
19730-
value,
19731-
null,
19732-
extraAttributes,
19733-
serverDifferences
19734-
));
19707+
if (
19708+
!(
19709+
"" !== propKey ||
19710+
("a" === tag && "href" === value) ||
19711+
("object" === tag && "data" === value)
19712+
)
19713+
) {
19714+
"src" === value
19715+
? error$jscomp$0(
19716+
'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.',
19717+
value,
19718+
value
19719+
)
19720+
: error$jscomp$0(
19721+
'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.',
19722+
value,
19723+
value
19724+
);
19725+
continue;
19726+
}
19727+
hydrateSanitizedAttribute(
19728+
domElement,
19729+
value,
19730+
value,
19731+
propKey,
19732+
extraAttributes,
19733+
serverDifferences
19734+
);
1973519735
continue;
1973619736
case "action":
1973719737
case "formAction":
@@ -20341,7 +20341,9 @@ __DEV__ &&
2034120341
else if (
2034220342
name !== anyProps.rel ||
2034320343
instance.getAttribute("href") !==
20344-
(null == anyProps.href ? null : anyProps.href) ||
20344+
(null == anyProps.href || "" === anyProps.href
20345+
? null
20346+
: anyProps.href) ||
2034520347
instance.getAttribute("crossorigin") !==
2034620348
(null == anyProps.crossOrigin
2034720349
? null
@@ -25886,11 +25888,11 @@ __DEV__ &&
2588625888
};
2588725889
(function () {
2588825890
var isomorphicReactPackageVersion = React.version;
25889-
if ("19.1.0-native-fb-3b009b4c-20250102" !== isomorphicReactPackageVersion)
25891+
if ("19.1.0-native-fb-bf883beb-20250103" !== isomorphicReactPackageVersion)
2589025892
throw Error(
2589125893
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
2589225894
(isomorphicReactPackageVersion +
25893-
"\n - react-dom: 19.1.0-native-fb-3b009b4c-20250102\nLearn more: https://react.dev/warnings/version-mismatch")
25895+
"\n - react-dom: 19.1.0-native-fb-bf883beb-20250103\nLearn more: https://react.dev/warnings/version-mismatch")
2589425896
);
2589525897
})();
2589625898
("function" === typeof Map &&
@@ -25927,10 +25929,10 @@ __DEV__ &&
2592725929
!(function () {
2592825930
var internals = {
2592925931
bundleType: 1,
25930-
version: "19.1.0-native-fb-3b009b4c-20250102",
25932+
version: "19.1.0-native-fb-bf883beb-20250103",
2593125933
rendererPackageName: "react-dom",
2593225934
currentDispatcherRef: ReactSharedInternals,
25933-
reconcilerVersion: "19.1.0-native-fb-3b009b4c-20250102"
25935+
reconcilerVersion: "19.1.0-native-fb-bf883beb-20250103"
2593425936
};
2593525937
internals.overrideHookState = overrideHookState;
2593625938
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -26076,5 +26078,5 @@ __DEV__ &&
2607626078
listenToAllSupportedEvents(container);
2607726079
return new ReactDOMHydrationRoot(initialChildren);
2607826080
};
26079-
exports.version = "19.1.0-native-fb-3b009b4c-20250102";
26081+
exports.version = "19.1.0-native-fb-bf883beb-20250103";
2608026082
})();

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-prod.js

+12-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<4ed2f264bde385ff618b27f469c22dc6>>
10+
* @generated SignedSource<<23e2e841a1b6664968af2b4e878e76b3>>
1111
*/
1212

1313
/*
@@ -8876,7 +8876,9 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
88768876
if (
88778877
((currentResource = maybeNodes[i]),
88788878
currentResource.getAttribute("href") ===
8879-
(null == current.href ? null : current.href) &&
8879+
(null == current.href || "" === current.href
8880+
? null
8881+
: current.href) &&
88808882
currentResource.getAttribute("rel") ===
88818883
(null == current.rel ? null : current.rel) &&
88828884
currentResource.getAttribute("title") ===
@@ -14258,7 +14260,9 @@ function canHydrateInstance(instance, type, props, inRootOrSingleton) {
1425814260
else if (
1425914261
name !== anyProps.rel ||
1426014262
instance.getAttribute("href") !==
14261-
(null == anyProps.href ? null : anyProps.href) ||
14263+
(null == anyProps.href || "" === anyProps.href
14264+
? null
14265+
: anyProps.href) ||
1426214266
instance.getAttribute("crossorigin") !==
1426314267
(null == anyProps.crossOrigin ? null : anyProps.crossOrigin) ||
1426414268
instance.getAttribute("title") !==
@@ -15904,14 +15908,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1590415908
};
1590515909
var isomorphicReactPackageVersion$jscomp$inline_1754 = React.version;
1590615910
if (
15907-
"19.1.0-native-fb-3b009b4c-20250102" !==
15911+
"19.1.0-native-fb-bf883beb-20250103" !==
1590815912
isomorphicReactPackageVersion$jscomp$inline_1754
1590915913
)
1591015914
throw Error(
1591115915
formatProdErrorMessage(
1591215916
527,
1591315917
isomorphicReactPackageVersion$jscomp$inline_1754,
15914-
"19.1.0-native-fb-3b009b4c-20250102"
15918+
"19.1.0-native-fb-bf883beb-20250103"
1591515919
)
1591615920
);
1591715921
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -15933,10 +15937,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1593315937
};
1593415938
var internals$jscomp$inline_2202 = {
1593515939
bundleType: 0,
15936-
version: "19.1.0-native-fb-3b009b4c-20250102",
15940+
version: "19.1.0-native-fb-bf883beb-20250103",
1593715941
rendererPackageName: "react-dom",
1593815942
currentDispatcherRef: ReactSharedInternals,
15939-
reconcilerVersion: "19.1.0-native-fb-3b009b4c-20250102"
15943+
reconcilerVersion: "19.1.0-native-fb-bf883beb-20250103"
1594015944
};
1594115945
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1594215946
var hook$jscomp$inline_2203 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -16042,4 +16046,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1604216046
listenToAllSupportedEvents(container);
1604316047
return new ReactDOMHydrationRoot(initialChildren);
1604416048
};
16045-
exports.version = "19.1.0-native-fb-3b009b4c-20250102";
16049+
exports.version = "19.1.0-native-fb-bf883beb-20250103";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-profiling.js

+12-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<77dbda27b5049a4b3f2def588adb6ecc>>
10+
* @generated SignedSource<<001f82612dd6516892d9622df8967ece>>
1111
*/
1212

1313
/*
@@ -9271,7 +9271,9 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
92719271
if (
92729272
((hoistableRoot = maybeNodes[i]),
92739273
hoistableRoot.getAttribute("href") ===
9274-
(null == current.href ? null : current.href) &&
9274+
(null == current.href || "" === current.href
9275+
? null
9276+
: current.href) &&
92759277
hoistableRoot.getAttribute("rel") ===
92769278
(null == current.rel ? null : current.rel) &&
92779279
hoistableRoot.getAttribute("title") ===
@@ -14897,7 +14899,9 @@ function canHydrateInstance(instance, type, props, inRootOrSingleton) {
1489714899
else if (
1489814900
name !== anyProps.rel ||
1489914901
instance.getAttribute("href") !==
14900-
(null == anyProps.href ? null : anyProps.href) ||
14902+
(null == anyProps.href || "" === anyProps.href
14903+
? null
14904+
: anyProps.href) ||
1490114905
instance.getAttribute("crossorigin") !==
1490214906
(null == anyProps.crossOrigin ? null : anyProps.crossOrigin) ||
1490314907
instance.getAttribute("title") !==
@@ -16551,14 +16555,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1655116555
};
1655216556
var isomorphicReactPackageVersion$jscomp$inline_1849 = React.version;
1655316557
if (
16554-
"19.1.0-native-fb-3b009b4c-20250102" !==
16558+
"19.1.0-native-fb-bf883beb-20250103" !==
1655516559
isomorphicReactPackageVersion$jscomp$inline_1849
1655616560
)
1655716561
throw Error(
1655816562
formatProdErrorMessage(
1655916563
527,
1656016564
isomorphicReactPackageVersion$jscomp$inline_1849,
16561-
"19.1.0-native-fb-3b009b4c-20250102"
16565+
"19.1.0-native-fb-bf883beb-20250103"
1656216566
)
1656316567
);
1656416568
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -16580,10 +16584,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1658016584
};
1658116585
var internals$jscomp$inline_1856 = {
1658216586
bundleType: 0,
16583-
version: "19.1.0-native-fb-3b009b4c-20250102",
16587+
version: "19.1.0-native-fb-bf883beb-20250103",
1658416588
rendererPackageName: "react-dom",
1658516589
currentDispatcherRef: ReactSharedInternals,
16586-
reconcilerVersion: "19.1.0-native-fb-3b009b4c-20250102",
16590+
reconcilerVersion: "19.1.0-native-fb-bf883beb-20250103",
1658716591
getLaneLabelMap: function () {
1658816592
for (
1658916593
var map = new Map(), lane = 1, index$294 = 0;
@@ -16704,4 +16708,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1670416708
listenToAllSupportedEvents(container);
1670516709
return new ReactDOMHydrationRoot(initialChildren);
1670616710
};
16707-
exports.version = "19.1.0-native-fb-3b009b4c-20250102";
16711+
exports.version = "19.1.0-native-fb-bf883beb-20250103";

0 commit comments

Comments
 (0)