Skip to content

Commit cb7bf99

Browse files
committed
Make enableNewBooleanProps www dynamic (#28559)
Feature: #24730 DiffTrain build for [a870b2d](a870b2d)
1 parent 809d7d4 commit cb7bf99

22 files changed

+525
-80
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9ffe9102ffd08ca7a56c60aa6952208890d213ce
1+
a870b2d5494351d75b68c3d9baf03a52fd40a8ef

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,4 +633,4 @@ exports.useSyncExternalStore = function (
633633
exports.useTransition = function () {
634634
return ReactCurrentDispatcher.current.useTransition();
635635
};
636-
exports.version = "18.3.0-www-classic-6d7ca4e7";
636+
exports.version = "18.3.0-www-classic-e323f09a";

compiled/facebook-www/React-prod.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,4 +625,4 @@ exports.useSyncExternalStore = function (
625625
exports.useTransition = function () {
626626
return ReactCurrentDispatcher.current.useTransition();
627627
};
628-
exports.version = "18.3.0-www-modern-0c35550e";
628+
exports.version = "18.3.0-www-modern-26dfe226";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ exports.useSyncExternalStore = function (
637637
exports.useTransition = function () {
638638
return ReactCurrentDispatcher.current.useTransition();
639639
};
640-
exports.version = "18.3.0-www-classic-27d0aa6f";
640+
exports.version = "18.3.0-www-classic-c2e666d0";
641641
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
642642
"function" ===
643643
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-profiling.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ exports.useSyncExternalStore = function (
629629
exports.useTransition = function () {
630630
return ReactCurrentDispatcher.current.useTransition();
631631
};
632-
exports.version = "18.3.0-www-modern-c75eccb5";
632+
exports.version = "18.3.0-www-modern-1d6a3285";
633633
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
634634
"function" ===
635635
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if (__DEV__) {
6666
return self;
6767
}
6868

69-
var ReactVersion = "18.3.0-www-modern-dede75f6";
69+
var ReactVersion = "18.3.0-www-modern-8be7683a";
7070

7171
var LegacyRoot = 0;
7272
var ConcurrentRoot = 1;

compiled/facebook-www/ReactDOM-dev.classic.js

Lines changed: 68 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ if (__DEV__) {
153153
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
154154
useModernStrictMode = dynamicFeatureFlags.useModernStrictMode,
155155
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp,
156+
enableNewBooleanProps = dynamicFeatureFlags.enableNewBooleanProps,
156157
enableClientRenderFallbackOnTextMismatch =
157158
dynamicFeatureFlags.enableClientRenderFallbackOnTextMismatch; // On WWW, false is used for a new modern build.
158159
var enableProfilerTimer = true;
@@ -6714,6 +6715,10 @@ if (__DEV__) {
67146715
zoomandpan: "zoomAndPan"
67156716
};
67166717

6718+
if (enableNewBooleanProps) {
6719+
possibleStandardNames.inert = "inert";
6720+
}
6721+
67176722
var ariaProperties = {
67186723
"aria-current": 0,
67196724
// state
@@ -7155,7 +7160,12 @@ if (__DEV__) {
71557160
}
71567161
// fallthrough
71577162

7158-
case "inert":
7163+
case "inert": {
7164+
if (enableNewBooleanProps) {
7165+
// Boolean properties can accept boolean values
7166+
return true;
7167+
}
7168+
}
71597169
// fallthrough for new boolean props without the flag on
71607170

71617171
default: {
@@ -7239,7 +7249,11 @@ if (__DEV__) {
72397249
break;
72407250
}
72417251

7242-
case "inert":
7252+
case "inert": {
7253+
if (enableNewBooleanProps) {
7254+
break;
7255+
}
7256+
}
72437257
// fallthrough for new boolean props without the flag on
72447258

72457259
default: {
@@ -35771,7 +35785,7 @@ if (__DEV__) {
3577135785
return root;
3577235786
}
3577335787

35774-
var ReactVersion = "18.3.0-www-classic-f22d5b27";
35788+
var ReactVersion = "18.3.0-www-classic-4a0167db";
3577535789

3577635790
function createPortal$1(
3577735791
children,
@@ -40278,9 +40292,11 @@ if (__DEV__) {
4027840292
var didWarnFormActionName = false;
4027940293
var didWarnFormActionTarget = false;
4028040294
var didWarnFormActionMethod = false;
40295+
var didWarnForNewBooleanPropsWithEmptyValue;
4028140296
var canDiffStyleForHydrationWarning;
4028240297

4028340298
{
40299+
didWarnForNewBooleanPropsWithEmptyValue = {}; // IE 11 parses & normalizes the style attribute as opposed to other
4028440300
// browsers. It adds spaces and sorts the properties in some
4028540301
// non-alphabetical order. Handling that would require sorting CSS
4028640302
// properties in the client & server versions or applying
@@ -40951,10 +40967,28 @@ if (__DEV__) {
4095140967
}
4095240968
// Boolean
4095340969

40954-
case "inert": {
40955-
setValueForAttribute(domElement, key, value);
40956-
break;
40957-
}
40970+
case "inert":
40971+
if (!enableNewBooleanProps) {
40972+
setValueForAttribute(domElement, key, value);
40973+
break;
40974+
} else {
40975+
{
40976+
if (
40977+
value === "" &&
40978+
!didWarnForNewBooleanPropsWithEmptyValue[key]
40979+
) {
40980+
didWarnForNewBooleanPropsWithEmptyValue[key] = true;
40981+
40982+
error(
40983+
"Received an empty string for a boolean attribute `%s`. " +
40984+
"This will treat the attribute as if it were false. " +
40985+
"Either pass `false` to silence this warning, or " +
40986+
"pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",
40987+
key
40988+
);
40989+
}
40990+
}
40991+
}
4095840992

4095940993
// fallthrough for new boolean props without the flag on
4096040994

@@ -43201,6 +43235,33 @@ if (__DEV__) {
4320143235
continue;
4320243236

4320343237
case "inert":
43238+
if (enableNewBooleanProps) {
43239+
{
43240+
if (
43241+
value === "" &&
43242+
!didWarnForNewBooleanPropsWithEmptyValue[propKey]
43243+
) {
43244+
didWarnForNewBooleanPropsWithEmptyValue[propKey] = true;
43245+
43246+
error(
43247+
"Received an empty string for a boolean attribute `%s`. " +
43248+
"This will treat the attribute as if it were false. " +
43249+
"Either pass `false` to silence this warning, or " +
43250+
"pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",
43251+
propKey
43252+
);
43253+
}
43254+
}
43255+
43256+
hydrateBooleanAttribute(
43257+
domElement,
43258+
propKey,
43259+
propKey,
43260+
value,
43261+
extraAttributes
43262+
);
43263+
continue;
43264+
}
4320443265

4320543266
// fallthrough for new boolean props without the flag on
4320643267

compiled/facebook-www/ReactDOM-dev.modern.js

Lines changed: 68 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ if (__DEV__) {
148148
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
149149
useModernStrictMode = dynamicFeatureFlags.useModernStrictMode,
150150
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp,
151+
enableNewBooleanProps = dynamicFeatureFlags.enableNewBooleanProps,
151152
enableClientRenderFallbackOnTextMismatch =
152153
dynamicFeatureFlags.enableClientRenderFallbackOnTextMismatch; // On WWW, true is used for a new modern build.
153154
var enableProfilerTimer = true;
@@ -6548,6 +6549,10 @@ if (__DEV__) {
65486549
zoomandpan: "zoomAndPan"
65496550
};
65506551

6552+
if (enableNewBooleanProps) {
6553+
possibleStandardNames.inert = "inert";
6554+
}
6555+
65516556
var ariaProperties = {
65526557
"aria-current": 0,
65536558
// state
@@ -6989,7 +6994,12 @@ if (__DEV__) {
69896994
}
69906995
// fallthrough
69916996

6992-
case "inert":
6997+
case "inert": {
6998+
if (enableNewBooleanProps) {
6999+
// Boolean properties can accept boolean values
7000+
return true;
7001+
}
7002+
}
69937003
// fallthrough for new boolean props without the flag on
69947004

69957005
default: {
@@ -7073,7 +7083,11 @@ if (__DEV__) {
70737083
break;
70747084
}
70757085

7076-
case "inert":
7086+
case "inert": {
7087+
if (enableNewBooleanProps) {
7088+
break;
7089+
}
7090+
}
70777091
// fallthrough for new boolean props without the flag on
70787092

70797093
default: {
@@ -35618,7 +35632,7 @@ if (__DEV__) {
3561835632
return root;
3561935633
}
3562035634

35621-
var ReactVersion = "18.3.0-www-modern-5bc66cc9";
35635+
var ReactVersion = "18.3.0-www-modern-e747153f";
3562235636

3562335637
function createPortal$1(
3562435638
children,
@@ -40934,9 +40948,11 @@ if (__DEV__) {
4093440948
var didWarnFormActionName = false;
4093540949
var didWarnFormActionTarget = false;
4093640950
var didWarnFormActionMethod = false;
40951+
var didWarnForNewBooleanPropsWithEmptyValue;
4093740952
var canDiffStyleForHydrationWarning;
4093840953

4093940954
{
40955+
didWarnForNewBooleanPropsWithEmptyValue = {}; // IE 11 parses & normalizes the style attribute as opposed to other
4094040956
// browsers. It adds spaces and sorts the properties in some
4094140957
// non-alphabetical order. Handling that would require sorting CSS
4094240958
// properties in the client & server versions or applying
@@ -41607,10 +41623,28 @@ if (__DEV__) {
4160741623
}
4160841624
// Boolean
4160941625

41610-
case "inert": {
41611-
setValueForAttribute(domElement, key, value);
41612-
break;
41613-
}
41626+
case "inert":
41627+
if (!enableNewBooleanProps) {
41628+
setValueForAttribute(domElement, key, value);
41629+
break;
41630+
} else {
41631+
{
41632+
if (
41633+
value === "" &&
41634+
!didWarnForNewBooleanPropsWithEmptyValue[key]
41635+
) {
41636+
didWarnForNewBooleanPropsWithEmptyValue[key] = true;
41637+
41638+
error(
41639+
"Received an empty string for a boolean attribute `%s`. " +
41640+
"This will treat the attribute as if it were false. " +
41641+
"Either pass `false` to silence this warning, or " +
41642+
"pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",
41643+
key
41644+
);
41645+
}
41646+
}
41647+
}
4161441648

4161541649
// fallthrough for new boolean props without the flag on
4161641650

@@ -43854,6 +43888,33 @@ if (__DEV__) {
4385443888
continue;
4385543889

4385643890
case "inert":
43891+
if (enableNewBooleanProps) {
43892+
{
43893+
if (
43894+
value === "" &&
43895+
!didWarnForNewBooleanPropsWithEmptyValue[propKey]
43896+
) {
43897+
didWarnForNewBooleanPropsWithEmptyValue[propKey] = true;
43898+
43899+
error(
43900+
"Received an empty string for a boolean attribute `%s`. " +
43901+
"This will treat the attribute as if it were false. " +
43902+
"Either pass `false` to silence this warning, or " +
43903+
"pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",
43904+
propKey
43905+
);
43906+
}
43907+
}
43908+
43909+
hydrateBooleanAttribute(
43910+
domElement,
43911+
propKey,
43912+
propKey,
43913+
value,
43914+
extraAttributes
43915+
);
43916+
continue;
43917+
}
4385743918

4385843919
// fallthrough for new boolean props without the flag on
4385943920

compiled/facebook-www/ReactDOM-prod.classic.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ var ReactSharedInternals =
6464
dynamicFeatureFlags.enableInfiniteRenderLoopDetection,
6565
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
6666
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp,
67+
enableNewBooleanProps = dynamicFeatureFlags.enableNewBooleanProps,
6768
enableClientRenderFallbackOnTextMismatch =
6869
dynamicFeatureFlags.enableClientRenderFallbackOnTextMismatch,
6970
REACT_ELEMENT_TYPE = Symbol.for("react.element"),
@@ -14530,8 +14531,10 @@ function setProp(domElement, tag, key, value, props, prevValue) {
1453014531
: domElement.removeAttribute(key);
1453114532
break;
1453214533
case "inert":
14533-
setValueForAttribute(domElement, key, value);
14534-
break;
14534+
if (!enableNewBooleanProps) {
14535+
setValueForAttribute(domElement, key, value);
14536+
break;
14537+
}
1453514538
case "allowFullScreen":
1453614539
case "async":
1453714540
case "autoPlay":
@@ -17231,7 +17234,7 @@ Internals.Events = [
1723117234
var devToolsConfig$jscomp$inline_1817 = {
1723217235
findFiberByHostInstance: getClosestInstanceFromNode,
1723317236
bundleType: 0,
17234-
version: "18.3.0-www-classic-044cf562",
17237+
version: "18.3.0-www-classic-9a35a237",
1723517238
rendererPackageName: "react-dom"
1723617239
};
1723717240
var internals$jscomp$inline_2176 = {
@@ -17261,7 +17264,7 @@ var internals$jscomp$inline_2176 = {
1726117264
scheduleRoot: null,
1726217265
setRefreshHandler: null,
1726317266
getCurrentFiber: null,
17264-
reconcilerVersion: "18.3.0-www-classic-044cf562"
17267+
reconcilerVersion: "18.3.0-www-classic-9a35a237"
1726517268
};
1726617269
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1726717270
var hook$jscomp$inline_2177 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17592,4 +17595,4 @@ exports.useFormState = function (action, initialState, permalink) {
1759217595
exports.useFormStatus = function () {
1759317596
return ReactCurrentDispatcher$2.current.useHostTransitionStatus();
1759417597
};
17595-
exports.version = "18.3.0-www-classic-044cf562";
17598+
exports.version = "18.3.0-www-classic-9a35a237";

compiled/facebook-www/ReactDOM-prod.modern.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"),
7777
dynamicFeatureFlags.enableInfiniteRenderLoopDetection,
7878
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
7979
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp,
80+
enableNewBooleanProps = dynamicFeatureFlags.enableNewBooleanProps,
8081
enableClientRenderFallbackOnTextMismatch =
8182
dynamicFeatureFlags.enableClientRenderFallbackOnTextMismatch,
8283
assign = Object.assign,
@@ -14834,8 +14835,10 @@ function setProp(domElement, tag, key, value, props, prevValue) {
1483414835
: domElement.removeAttribute(key);
1483514836
break;
1483614837
case "inert":
14837-
setValueForAttribute(domElement, key, value);
14838-
break;
14838+
if (!enableNewBooleanProps) {
14839+
setValueForAttribute(domElement, key, value);
14840+
break;
14841+
}
1483914842
case "allowFullScreen":
1484014843
case "async":
1484114844
case "autoPlay":
@@ -16747,7 +16750,7 @@ Internals.Events = [
1674716750
var devToolsConfig$jscomp$inline_1776 = {
1674816751
findFiberByHostInstance: getClosestInstanceFromNode,
1674916752
bundleType: 0,
16750-
version: "18.3.0-www-modern-f1ed7683",
16753+
version: "18.3.0-www-modern-50f5a0ca",
1675116754
rendererPackageName: "react-dom"
1675216755
};
1675316756
var internals$jscomp$inline_2140 = {
@@ -16778,7 +16781,7 @@ var internals$jscomp$inline_2140 = {
1677816781
scheduleRoot: null,
1677916782
setRefreshHandler: null,
1678016783
getCurrentFiber: null,
16781-
reconcilerVersion: "18.3.0-www-modern-f1ed7683"
16784+
reconcilerVersion: "18.3.0-www-modern-50f5a0ca"
1678216785
};
1678316786
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1678416787
var hook$jscomp$inline_2141 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17037,4 +17040,4 @@ exports.useFormState = function (action, initialState, permalink) {
1703717040
exports.useFormStatus = function () {
1703817041
return ReactCurrentDispatcher$2.current.useHostTransitionStatus();
1703917042
};
17040-
exports.version = "18.3.0-www-modern-f1ed7683";
17043+
exports.version = "18.3.0-www-modern-50f5a0ca";

0 commit comments

Comments
 (0)