Skip to content

Commit

Permalink
Cleanup enableNewBooleanProps (#28712)
Browse files Browse the repository at this point in the history
DiffTrain build for [28fc980](28fc980)
  • Loading branch information
eps1lon committed Apr 2, 2024
1 parent f21dee5 commit 04e2165
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 137 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7659c4d9e0e4de2ec758c9a03ad7cbf07fc696d0
28fc980ef2c563e3086ae5b0b2e6293de48ae0d4
5 changes: 2 additions & 3 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -36280,7 +36280,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "19.0.0-www-classic-80b168f2";
var ReactVersion = "19.0.0-www-classic-21bc38d6";

function createPortal$1(
children,
Expand Down Expand Up @@ -41439,7 +41439,7 @@ if (__DEV__) {
}
}
}
// fallthrough for new boolean props without the flag on
// Fallthrough for boolean props that don't have a warning for empty strings.

case "allowFullScreen":
case "async":
Expand Down Expand Up @@ -43862,7 +43862,6 @@ if (__DEV__) {
serverDifferences
);
continue;
// fallthrough for new boolean props without the flag on

default: {
if (
Expand Down
5 changes: 2 additions & 3 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -36128,7 +36128,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "19.0.0-www-modern-e4bc2307";
var ReactVersion = "19.0.0-www-modern-ab0678c9";

function createPortal$1(
children,
Expand Down Expand Up @@ -42165,7 +42165,7 @@ if (__DEV__) {
}
}
}
// fallthrough for new boolean props without the flag on
// Fallthrough for boolean props that don't have a warning for empty strings.

case "allowFullScreen":
case "async":
Expand Down Expand Up @@ -44585,7 +44585,6 @@ if (__DEV__) {
serverDifferences
);
continue;
// fallthrough for new boolean props without the flag on

default: {
if (
Expand Down
56 changes: 21 additions & 35 deletions compiled/facebook-www/ReactDOMServer-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (__DEV__) {
var React = require("react");
var ReactDOM = require("react-dom");

var ReactVersion = "19.0.0-www-classic-dd83f61f";
var ReactVersion = "19.0.0-www-classic-e1b06834";

// This refers to a WWW module.
var warningWWW = require("warning");
Expand Down Expand Up @@ -3440,6 +3440,26 @@ if (__DEV__) {
return;
}

case "inert": {
{
if (
value === "" &&
!didWarnForNewBooleanPropsWithEmptyValue[name]
) {
didWarnForNewBooleanPropsWithEmptyValue[name] = true;

error(
"Received an empty string for a boolean attribute `%s`. " +
"This will treat the attribute as if it were false. " +
"Either pass `false` to silence this warning, or " +
"pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",
name
);
}
}
}
// Fallthrough for boolean props that don't have a warning for empty strings.

case "allowFullScreen":
case "async":
case "autoPlay":
Expand Down Expand Up @@ -3580,40 +3600,6 @@ if (__DEV__) {
pushStringAttribute(target, "xml:space", value);
return;

case "inert": {
{
if (
value === "" &&
!didWarnForNewBooleanPropsWithEmptyValue[name]
) {
didWarnForNewBooleanPropsWithEmptyValue[name] = true;

error(
"Received an empty string for a boolean attribute `%s`. " +
"This will treat the attribute as if it were false. " +
"Either pass `false` to silence this warning, or " +
"pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",
name
);
}
} // Boolean

if (
value &&
typeof value !== "function" &&
typeof value !== "symbol"
) {
target.push(
attributeSeparator,
stringToChunk(name),
attributeEmptyString
);
}

return;
}
// fallthrough for new boolean props without the flag on

default:
if (
// shouldIgnoreAttribute
Expand Down
56 changes: 21 additions & 35 deletions compiled/facebook-www/ReactDOMServer-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (__DEV__) {
var React = require("react");
var ReactDOM = require("react-dom");

var ReactVersion = "19.0.0-www-modern-e7985491";
var ReactVersion = "19.0.0-www-modern-07eca2b1";

// This refers to a WWW module.
var warningWWW = require("warning");
Expand Down Expand Up @@ -3440,6 +3440,26 @@ if (__DEV__) {
return;
}

case "inert": {
{
if (
value === "" &&
!didWarnForNewBooleanPropsWithEmptyValue[name]
) {
didWarnForNewBooleanPropsWithEmptyValue[name] = true;

error(
"Received an empty string for a boolean attribute `%s`. " +
"This will treat the attribute as if it were false. " +
"Either pass `false` to silence this warning, or " +
"pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",
name
);
}
}
}
// Fallthrough for boolean props that don't have a warning for empty strings.

case "allowFullScreen":
case "async":
case "autoPlay":
Expand Down Expand Up @@ -3580,40 +3600,6 @@ if (__DEV__) {
pushStringAttribute(target, "xml:space", value);
return;

case "inert": {
{
if (
value === "" &&
!didWarnForNewBooleanPropsWithEmptyValue[name]
) {
didWarnForNewBooleanPropsWithEmptyValue[name] = true;

error(
"Received an empty string for a boolean attribute `%s`. " +
"This will treat the attribute as if it were false. " +
"Either pass `false` to silence this warning, or " +
"pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",
name
);
}
} // Boolean

if (
value &&
typeof value !== "function" &&
typeof value !== "symbol"
) {
target.push(
attributeSeparator,
stringToChunk(name),
attributeEmptyString
);
}

return;
}
// fallthrough for new boolean props without the flag on

default:
if (
// shouldIgnoreAttribute
Expand Down
9 changes: 2 additions & 7 deletions compiled/facebook-www/ReactDOMServer-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ function pushAttribute(target, name, value) {
"symbol" !== typeof value &&
target.push(" ", name, '="', escapeTextForBrowser(value), '"');
break;
case "inert":
case "allowFullScreen":
case "async":
case "autoPlay":
Expand Down Expand Up @@ -639,12 +640,6 @@ function pushAttribute(target, name, value) {
case "xmlSpace":
pushStringAttribute(target, "xml:space", value);
break;
case "inert":
value &&
"function" !== typeof value &&
"symbol" !== typeof value &&
target.push(" ", name, '=""');
break;
default:
if (
!(2 < name.length) ||
Expand Down Expand Up @@ -5701,4 +5696,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "19.0.0-www-classic-3b435a8e";
exports.version = "19.0.0-www-classic-a95965e6";
9 changes: 2 additions & 7 deletions compiled/facebook-www/ReactDOMServer-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ function pushAttribute(target, name, value) {
"symbol" !== typeof value &&
target.push(" ", name, '="', escapeTextForBrowser(value), '"');
break;
case "inert":
case "allowFullScreen":
case "async":
case "autoPlay":
Expand Down Expand Up @@ -639,12 +640,6 @@ function pushAttribute(target, name, value) {
case "xmlSpace":
pushStringAttribute(target, "xml:space", value);
break;
case "inert":
value &&
"function" !== typeof value &&
"symbol" !== typeof value &&
target.push(" ", name, '=""');
break;
default:
if (
!(2 < name.length) ||
Expand Down Expand Up @@ -5642,4 +5637,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "19.0.0-www-modern-f4a18795";
exports.version = "19.0.0-www-modern-a46dd917";
54 changes: 20 additions & 34 deletions compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -3437,6 +3437,26 @@ if (__DEV__) {
return;
}

case "inert": {
{
if (
value === "" &&
!didWarnForNewBooleanPropsWithEmptyValue[name]
) {
didWarnForNewBooleanPropsWithEmptyValue[name] = true;

error(
"Received an empty string for a boolean attribute `%s`. " +
"This will treat the attribute as if it were false. " +
"Either pass `false` to silence this warning, or " +
"pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",
name
);
}
}
}
// Fallthrough for boolean props that don't have a warning for empty strings.

case "allowFullScreen":
case "async":
case "autoPlay":
Expand Down Expand Up @@ -3577,40 +3597,6 @@ if (__DEV__) {
pushStringAttribute(target, "xml:space", value);
return;

case "inert": {
{
if (
value === "" &&
!didWarnForNewBooleanPropsWithEmptyValue[name]
) {
didWarnForNewBooleanPropsWithEmptyValue[name] = true;

error(
"Received an empty string for a boolean attribute `%s`. " +
"This will treat the attribute as if it were false. " +
"Either pass `false` to silence this warning, or " +
"pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",
name
);
}
} // Boolean

if (
value &&
typeof value !== "function" &&
typeof value !== "symbol"
) {
target.push(
attributeSeparator,
stringToChunk(name),
attributeEmptyString
);
}

return;
}
// fallthrough for new boolean props without the flag on

default:
if (
// shouldIgnoreAttribute
Expand Down
7 changes: 1 addition & 6 deletions compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ function pushAttribute(target, name, value) {
"symbol" !== typeof value &&
target.push(" ", name, '="', escapeTextForBrowser(value), '"');
break;
case "inert":
case "allowFullScreen":
case "async":
case "autoPlay":
Expand Down Expand Up @@ -614,12 +615,6 @@ function pushAttribute(target, name, value) {
case "xmlSpace":
pushStringAttribute(target, "xml:space", value);
break;
case "inert":
value &&
"function" !== typeof value &&
"symbol" !== typeof value &&
target.push(" ", name, '=""');
break;
default:
if (
!(2 < name.length) ||
Expand Down
5 changes: 2 additions & 3 deletions compiled/facebook-www/ReactDOMTesting-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -36904,7 +36904,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "19.0.0-www-classic-8339402b";
var ReactVersion = "19.0.0-www-classic-81e9ca54";

function createPortal$1(
children,
Expand Down Expand Up @@ -42063,7 +42063,7 @@ if (__DEV__) {
}
}
}
// fallthrough for new boolean props without the flag on
// Fallthrough for boolean props that don't have a warning for empty strings.

case "allowFullScreen":
case "async":
Expand Down Expand Up @@ -44486,7 +44486,6 @@ if (__DEV__) {
serverDifferences
);
continue;
// fallthrough for new boolean props without the flag on

default: {
if (
Expand Down
Loading

0 comments on commit 04e2165

Please sign in to comment.