Skip to content

Commit 2d29da8

Browse files
committed
Land enableNewBooleanProps everywhere (#28676)
Rolled out internally. Removing flag. DiffTrain build for [6cd6ba7](6cd6ba7)
1 parent fc94889 commit 2d29da8

17 files changed

+295
-503
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18812b645c93a9c42f931fae57bbbab9c1f402b8
1+
6cd6ba703de77e332ab201518b6e30e47cd49aaf

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

Lines changed: 41 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ if (__DEV__) {
154154
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
155155
useModernStrictMode = dynamicFeatureFlags.useModernStrictMode,
156156
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp,
157-
enableNewBooleanProps = dynamicFeatureFlags.enableNewBooleanProps,
158157
favorSafetyOverHydrationPerf =
159158
dynamicFeatureFlags.favorSafetyOverHydrationPerf; // On WWW, false is used for a new modern build.
160159
var enableProfilerTimer = true;
@@ -6215,9 +6214,9 @@ if (__DEV__) {
62156214
return aliases.get(name) || name;
62166215
}
62176216

6217+
// When adding attributes to the HTML or SVG allowed attribute list, be sure to
62186218
// also add them to this module to ensure casing and incorrect name
62196219
// warnings.
6220-
62216220
var possibleStandardNames = {
62226221
// HTML
62236222
accept: "accept",
@@ -6292,6 +6291,7 @@ if (__DEV__) {
62926291
id: "id",
62936292
imagesizes: "imageSizes",
62946293
imagesrcset: "imageSrcSet",
6294+
inert: "inert",
62956295
innerhtml: "innerHTML",
62966296
inputmode: "inputMode",
62976297
integrity: "integrity",
@@ -6711,10 +6711,6 @@ if (__DEV__) {
67116711
zoomandpan: "zoomAndPan"
67126712
};
67136713

6714-
if (enableNewBooleanProps) {
6715-
possibleStandardNames.inert = "inert";
6716-
}
6717-
67186714
var ariaProperties = {
67196715
"aria-current": 0,
67206716
// state
@@ -7146,20 +7142,13 @@ if (__DEV__) {
71467142
case "seamless":
71477143
case "itemScope":
71487144
case "capture":
7149-
case "download": {
7145+
case "download":
7146+
case "inert": {
71507147
// Boolean properties can accept boolean values
71517148
return true;
71527149
}
71537150
// fallthrough
71547151

7155-
case "inert": {
7156-
if (enableNewBooleanProps) {
7157-
// Boolean properties can accept boolean values
7158-
return true;
7159-
}
7160-
}
7161-
// fallthrough for new boolean props without the flag on
7162-
71637152
default: {
71647153
var prefix = name.toLowerCase().slice(0, 5);
71657154

@@ -7237,16 +7226,10 @@ if (__DEV__) {
72377226
case "reversed":
72387227
case "scoped":
72397228
case "seamless":
7240-
case "itemScope": {
7241-
break;
7242-
}
7243-
7229+
case "itemScope":
72447230
case "inert": {
7245-
if (enableNewBooleanProps) {
7246-
break;
7247-
}
7231+
break;
72487232
}
7249-
// fallthrough for new boolean props without the flag on
72507233

72517234
default: {
72527235
return true;
@@ -36368,7 +36351,7 @@ if (__DEV__) {
3636836351
return root;
3636936352
}
3637036353

36371-
var ReactVersion = "19.0.0-www-classic-eb2e3f4c";
36354+
var ReactVersion = "19.0.0-www-classic-36b47fc1";
3637236355

3637336356
function createPortal$1(
3637436357
children,
@@ -41512,29 +41495,21 @@ if (__DEV__) {
4151241495
}
4151341496
// Boolean
4151441497

41515-
case "inert":
41516-
if (!enableNewBooleanProps) {
41517-
setValueForAttribute(domElement, key, value);
41518-
break;
41519-
} else {
41520-
{
41521-
if (
41522-
value === "" &&
41523-
!didWarnForNewBooleanPropsWithEmptyValue[key]
41524-
) {
41525-
didWarnForNewBooleanPropsWithEmptyValue[key] = true;
41498+
case "inert": {
41499+
{
41500+
if (value === "" && !didWarnForNewBooleanPropsWithEmptyValue[key]) {
41501+
didWarnForNewBooleanPropsWithEmptyValue[key] = true;
4152641502

41527-
error(
41528-
"Received an empty string for a boolean attribute `%s`. " +
41529-
"This will treat the attribute as if it were false. " +
41530-
"Either pass `false` to silence this warning, or " +
41531-
"pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",
41532-
key
41533-
);
41534-
}
41503+
error(
41504+
"Received an empty string for a boolean attribute `%s`. " +
41505+
"This will treat the attribute as if it were false. " +
41506+
"Either pass `false` to silence this warning, or " +
41507+
"pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",
41508+
key
41509+
);
4153541510
}
4153641511
}
41537-
41512+
}
4153841513
// fallthrough for new boolean props without the flag on
4153941514

4154041515
case "allowFullScreen":
@@ -43932,35 +43907,32 @@ if (__DEV__) {
4393243907
continue;
4393343908

4393443909
case "inert":
43935-
if (enableNewBooleanProps) {
43936-
{
43937-
if (
43938-
value === "" &&
43939-
!didWarnForNewBooleanPropsWithEmptyValue[propKey]
43940-
) {
43941-
didWarnForNewBooleanPropsWithEmptyValue[propKey] = true;
43910+
{
43911+
if (
43912+
value === "" &&
43913+
!didWarnForNewBooleanPropsWithEmptyValue[propKey]
43914+
) {
43915+
didWarnForNewBooleanPropsWithEmptyValue[propKey] = true;
4394243916

43943-
error(
43944-
"Received an empty string for a boolean attribute `%s`. " +
43945-
"This will treat the attribute as if it were false. " +
43946-
"Either pass `false` to silence this warning, or " +
43947-
"pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",
43948-
propKey
43949-
);
43950-
}
43917+
error(
43918+
"Received an empty string for a boolean attribute `%s`. " +
43919+
"This will treat the attribute as if it were false. " +
43920+
"Either pass `false` to silence this warning, or " +
43921+
"pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",
43922+
propKey
43923+
);
4395143924
}
43952-
43953-
hydrateBooleanAttribute(
43954-
domElement,
43955-
propKey,
43956-
propKey,
43957-
value,
43958-
extraAttributes,
43959-
serverDifferences
43960-
);
43961-
continue;
4396243925
}
4396343926

43927+
hydrateBooleanAttribute(
43928+
domElement,
43929+
propKey,
43930+
propKey,
43931+
value,
43932+
extraAttributes,
43933+
serverDifferences
43934+
);
43935+
continue;
4396443936
// fallthrough for new boolean props without the flag on
4396543937

4396643938
default: {

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

Lines changed: 41 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ if (__DEV__) {
150150
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
151151
useModernStrictMode = dynamicFeatureFlags.useModernStrictMode,
152152
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp,
153-
enableNewBooleanProps = dynamicFeatureFlags.enableNewBooleanProps,
154153
favorSafetyOverHydrationPerf =
155154
dynamicFeatureFlags.favorSafetyOverHydrationPerf; // On WWW, true is used for a new modern build.
156155
var enableProfilerTimer = true;
@@ -6050,9 +6049,9 @@ if (__DEV__) {
60506049
return aliases.get(name) || name;
60516050
}
60526051

6052+
// When adding attributes to the HTML or SVG allowed attribute list, be sure to
60536053
// also add them to this module to ensure casing and incorrect name
60546054
// warnings.
6055-
60566055
var possibleStandardNames = {
60576056
// HTML
60586057
accept: "accept",
@@ -6127,6 +6126,7 @@ if (__DEV__) {
61276126
id: "id",
61286127
imagesizes: "imageSizes",
61296128
imagesrcset: "imageSrcSet",
6129+
inert: "inert",
61306130
innerhtml: "innerHTML",
61316131
inputmode: "inputMode",
61326132
integrity: "integrity",
@@ -6546,10 +6546,6 @@ if (__DEV__) {
65466546
zoomandpan: "zoomAndPan"
65476547
};
65486548

6549-
if (enableNewBooleanProps) {
6550-
possibleStandardNames.inert = "inert";
6551-
}
6552-
65536549
var ariaProperties = {
65546550
"aria-current": 0,
65556551
// state
@@ -6981,20 +6977,13 @@ if (__DEV__) {
69816977
case "seamless":
69826978
case "itemScope":
69836979
case "capture":
6984-
case "download": {
6980+
case "download":
6981+
case "inert": {
69856982
// Boolean properties can accept boolean values
69866983
return true;
69876984
}
69886985
// fallthrough
69896986

6990-
case "inert": {
6991-
if (enableNewBooleanProps) {
6992-
// Boolean properties can accept boolean values
6993-
return true;
6994-
}
6995-
}
6996-
// fallthrough for new boolean props without the flag on
6997-
69986987
default: {
69996988
var prefix = name.toLowerCase().slice(0, 5);
70006989

@@ -7072,16 +7061,10 @@ if (__DEV__) {
70727061
case "reversed":
70737062
case "scoped":
70747063
case "seamless":
7075-
case "itemScope": {
7076-
break;
7077-
}
7078-
7064+
case "itemScope":
70797065
case "inert": {
7080-
if (enableNewBooleanProps) {
7081-
break;
7082-
}
7066+
break;
70837067
}
7084-
// fallthrough for new boolean props without the flag on
70857068

70867069
default: {
70877070
return true;
@@ -36216,7 +36199,7 @@ if (__DEV__) {
3621636199
return root;
3621736200
}
3621836201

36219-
var ReactVersion = "19.0.0-www-modern-0c956171";
36202+
var ReactVersion = "19.0.0-www-modern-7787bbbe";
3622036203

3622136204
function createPortal$1(
3622236205
children,
@@ -42238,29 +42221,21 @@ if (__DEV__) {
4223842221
}
4223942222
// Boolean
4224042223

42241-
case "inert":
42242-
if (!enableNewBooleanProps) {
42243-
setValueForAttribute(domElement, key, value);
42244-
break;
42245-
} else {
42246-
{
42247-
if (
42248-
value === "" &&
42249-
!didWarnForNewBooleanPropsWithEmptyValue[key]
42250-
) {
42251-
didWarnForNewBooleanPropsWithEmptyValue[key] = true;
42224+
case "inert": {
42225+
{
42226+
if (value === "" && !didWarnForNewBooleanPropsWithEmptyValue[key]) {
42227+
didWarnForNewBooleanPropsWithEmptyValue[key] = true;
4225242228

42253-
error(
42254-
"Received an empty string for a boolean attribute `%s`. " +
42255-
"This will treat the attribute as if it were false. " +
42256-
"Either pass `false` to silence this warning, or " +
42257-
"pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",
42258-
key
42259-
);
42260-
}
42229+
error(
42230+
"Received an empty string for a boolean attribute `%s`. " +
42231+
"This will treat the attribute as if it were false. " +
42232+
"Either pass `false` to silence this warning, or " +
42233+
"pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",
42234+
key
42235+
);
4226142236
}
4226242237
}
42263-
42238+
}
4226442239
// fallthrough for new boolean props without the flag on
4226542240

4226642241
case "allowFullScreen":
@@ -44655,35 +44630,32 @@ if (__DEV__) {
4465544630
continue;
4465644631

4465744632
case "inert":
44658-
if (enableNewBooleanProps) {
44659-
{
44660-
if (
44661-
value === "" &&
44662-
!didWarnForNewBooleanPropsWithEmptyValue[propKey]
44663-
) {
44664-
didWarnForNewBooleanPropsWithEmptyValue[propKey] = true;
44633+
{
44634+
if (
44635+
value === "" &&
44636+
!didWarnForNewBooleanPropsWithEmptyValue[propKey]
44637+
) {
44638+
didWarnForNewBooleanPropsWithEmptyValue[propKey] = true;
4466544639

44666-
error(
44667-
"Received an empty string for a boolean attribute `%s`. " +
44668-
"This will treat the attribute as if it were false. " +
44669-
"Either pass `false` to silence this warning, or " +
44670-
"pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",
44671-
propKey
44672-
);
44673-
}
44640+
error(
44641+
"Received an empty string for a boolean attribute `%s`. " +
44642+
"This will treat the attribute as if it were false. " +
44643+
"Either pass `false` to silence this warning, or " +
44644+
"pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",
44645+
propKey
44646+
);
4467444647
}
44675-
44676-
hydrateBooleanAttribute(
44677-
domElement,
44678-
propKey,
44679-
propKey,
44680-
value,
44681-
extraAttributes,
44682-
serverDifferences
44683-
);
44684-
continue;
4468544648
}
4468644649

44650+
hydrateBooleanAttribute(
44651+
domElement,
44652+
propKey,
44653+
propKey,
44654+
value,
44655+
extraAttributes,
44656+
serverDifferences
44657+
);
44658+
continue;
4468744659
// fallthrough for new boolean props without the flag on
4468844660

4468944661
default: {

0 commit comments

Comments
 (0)