Skip to content

Commit

Permalink
Make enableNewBooleanProps www dynamic (#28559)
Browse files Browse the repository at this point in the history
Feature: #24730

DiffTrain build for [a870b2d](a870b2d)
  • Loading branch information
jackpope committed Mar 14, 2024
1 parent 809d7d4 commit cb7bf99
Show file tree
Hide file tree
Showing 22 changed files with 525 additions and 80 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9ffe9102ffd08ca7a56c60aa6952208890d213ce
a870b2d5494351d75b68c3d9baf03a52fd40a8ef
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 @@ -633,4 +633,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-www-classic-6d7ca4e7";
exports.version = "18.3.0-www-classic-e323f09a";
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 @@ -625,4 +625,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-www-modern-0c35550e";
exports.version = "18.3.0-www-modern-26dfe226";
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 @@ -637,7 +637,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-www-classic-27d0aa6f";
exports.version = "18.3.0-www-classic-c2e666d0";
"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 @@ -629,7 +629,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-www-modern-c75eccb5";
exports.version = "18.3.0-www-modern-1d6a3285";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if (__DEV__) {
return self;
}

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

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down
75 changes: 68 additions & 7 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ if (__DEV__) {
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
useModernStrictMode = dynamicFeatureFlags.useModernStrictMode,
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp,
enableNewBooleanProps = dynamicFeatureFlags.enableNewBooleanProps,
enableClientRenderFallbackOnTextMismatch =
dynamicFeatureFlags.enableClientRenderFallbackOnTextMismatch; // On WWW, false is used for a new modern build.
var enableProfilerTimer = true;
Expand Down Expand Up @@ -6714,6 +6715,10 @@ if (__DEV__) {
zoomandpan: "zoomAndPan"
};

if (enableNewBooleanProps) {
possibleStandardNames.inert = "inert";
}

var ariaProperties = {
"aria-current": 0,
// state
Expand Down Expand Up @@ -7155,7 +7160,12 @@ if (__DEV__) {
}
// fallthrough

case "inert":
case "inert": {
if (enableNewBooleanProps) {
// Boolean properties can accept boolean values
return true;
}
}
// fallthrough for new boolean props without the flag on

default: {
Expand Down Expand Up @@ -7239,7 +7249,11 @@ if (__DEV__) {
break;
}

case "inert":
case "inert": {
if (enableNewBooleanProps) {
break;
}
}
// fallthrough for new boolean props without the flag on

default: {
Expand Down Expand Up @@ -35771,7 +35785,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "18.3.0-www-classic-f22d5b27";
var ReactVersion = "18.3.0-www-classic-4a0167db";

function createPortal$1(
children,
Expand Down Expand Up @@ -40278,9 +40292,11 @@ if (__DEV__) {
var didWarnFormActionName = false;
var didWarnFormActionTarget = false;
var didWarnFormActionMethod = false;
var didWarnForNewBooleanPropsWithEmptyValue;
var canDiffStyleForHydrationWarning;

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

case "inert": {
setValueForAttribute(domElement, key, value);
break;
}
case "inert":
if (!enableNewBooleanProps) {
setValueForAttribute(domElement, key, value);
break;
} else {
{
if (
value === "" &&
!didWarnForNewBooleanPropsWithEmptyValue[key]
) {
didWarnForNewBooleanPropsWithEmptyValue[key] = 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.",
key
);
}
}
}

// fallthrough for new boolean props without the flag on

Expand Down Expand Up @@ -43201,6 +43235,33 @@ if (__DEV__) {
continue;

case "inert":
if (enableNewBooleanProps) {
{
if (
value === "" &&
!didWarnForNewBooleanPropsWithEmptyValue[propKey]
) {
didWarnForNewBooleanPropsWithEmptyValue[propKey] = 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.",
propKey
);
}
}

hydrateBooleanAttribute(
domElement,
propKey,
propKey,
value,
extraAttributes
);
continue;
}

// fallthrough for new boolean props without the flag on

Expand Down
75 changes: 68 additions & 7 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ if (__DEV__) {
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
useModernStrictMode = dynamicFeatureFlags.useModernStrictMode,
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp,
enableNewBooleanProps = dynamicFeatureFlags.enableNewBooleanProps,
enableClientRenderFallbackOnTextMismatch =
dynamicFeatureFlags.enableClientRenderFallbackOnTextMismatch; // On WWW, true is used for a new modern build.
var enableProfilerTimer = true;
Expand Down Expand Up @@ -6548,6 +6549,10 @@ if (__DEV__) {
zoomandpan: "zoomAndPan"
};

if (enableNewBooleanProps) {
possibleStandardNames.inert = "inert";
}

var ariaProperties = {
"aria-current": 0,
// state
Expand Down Expand Up @@ -6989,7 +6994,12 @@ if (__DEV__) {
}
// fallthrough

case "inert":
case "inert": {
if (enableNewBooleanProps) {
// Boolean properties can accept boolean values
return true;
}
}
// fallthrough for new boolean props without the flag on

default: {
Expand Down Expand Up @@ -7073,7 +7083,11 @@ if (__DEV__) {
break;
}

case "inert":
case "inert": {
if (enableNewBooleanProps) {
break;
}
}
// fallthrough for new boolean props without the flag on

default: {
Expand Down Expand Up @@ -35618,7 +35632,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "18.3.0-www-modern-5bc66cc9";
var ReactVersion = "18.3.0-www-modern-e747153f";

function createPortal$1(
children,
Expand Down Expand Up @@ -40934,9 +40948,11 @@ if (__DEV__) {
var didWarnFormActionName = false;
var didWarnFormActionTarget = false;
var didWarnFormActionMethod = false;
var didWarnForNewBooleanPropsWithEmptyValue;
var canDiffStyleForHydrationWarning;

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

case "inert": {
setValueForAttribute(domElement, key, value);
break;
}
case "inert":
if (!enableNewBooleanProps) {
setValueForAttribute(domElement, key, value);
break;
} else {
{
if (
value === "" &&
!didWarnForNewBooleanPropsWithEmptyValue[key]
) {
didWarnForNewBooleanPropsWithEmptyValue[key] = 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.",
key
);
}
}
}

// fallthrough for new boolean props without the flag on

Expand Down Expand Up @@ -43854,6 +43888,33 @@ if (__DEV__) {
continue;

case "inert":
if (enableNewBooleanProps) {
{
if (
value === "" &&
!didWarnForNewBooleanPropsWithEmptyValue[propKey]
) {
didWarnForNewBooleanPropsWithEmptyValue[propKey] = 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.",
propKey
);
}
}

hydrateBooleanAttribute(
domElement,
propKey,
propKey,
value,
extraAttributes
);
continue;
}

// fallthrough for new boolean props without the flag on

Expand Down
13 changes: 8 additions & 5 deletions compiled/facebook-www/ReactDOM-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ var ReactSharedInternals =
dynamicFeatureFlags.enableInfiniteRenderLoopDetection,
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp,
enableNewBooleanProps = dynamicFeatureFlags.enableNewBooleanProps,
enableClientRenderFallbackOnTextMismatch =
dynamicFeatureFlags.enableClientRenderFallbackOnTextMismatch,
REACT_ELEMENT_TYPE = Symbol.for("react.element"),
Expand Down Expand Up @@ -14530,8 +14531,10 @@ function setProp(domElement, tag, key, value, props, prevValue) {
: domElement.removeAttribute(key);
break;
case "inert":
setValueForAttribute(domElement, key, value);
break;
if (!enableNewBooleanProps) {
setValueForAttribute(domElement, key, value);
break;
}
case "allowFullScreen":
case "async":
case "autoPlay":
Expand Down Expand Up @@ -17231,7 +17234,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1817 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-classic-044cf562",
version: "18.3.0-www-classic-9a35a237",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2176 = {
Expand Down Expand Up @@ -17261,7 +17264,7 @@ var internals$jscomp$inline_2176 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-classic-044cf562"
reconcilerVersion: "18.3.0-www-classic-9a35a237"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2177 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -17592,4 +17595,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactCurrentDispatcher$2.current.useHostTransitionStatus();
};
exports.version = "18.3.0-www-classic-044cf562";
exports.version = "18.3.0-www-classic-9a35a237";
13 changes: 8 additions & 5 deletions compiled/facebook-www/ReactDOM-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"),
dynamicFeatureFlags.enableInfiniteRenderLoopDetection,
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp,
enableNewBooleanProps = dynamicFeatureFlags.enableNewBooleanProps,
enableClientRenderFallbackOnTextMismatch =
dynamicFeatureFlags.enableClientRenderFallbackOnTextMismatch,
assign = Object.assign,
Expand Down Expand Up @@ -14834,8 +14835,10 @@ function setProp(domElement, tag, key, value, props, prevValue) {
: domElement.removeAttribute(key);
break;
case "inert":
setValueForAttribute(domElement, key, value);
break;
if (!enableNewBooleanProps) {
setValueForAttribute(domElement, key, value);
break;
}
case "allowFullScreen":
case "async":
case "autoPlay":
Expand Down Expand Up @@ -16747,7 +16750,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1776 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-modern-f1ed7683",
version: "18.3.0-www-modern-50f5a0ca",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2140 = {
Expand Down Expand Up @@ -16778,7 +16781,7 @@ var internals$jscomp$inline_2140 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-modern-f1ed7683"
reconcilerVersion: "18.3.0-www-modern-50f5a0ca"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2141 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -17037,4 +17040,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactCurrentDispatcher$2.current.useHostTransitionStatus();
};
exports.version = "18.3.0-www-modern-f1ed7683";
exports.version = "18.3.0-www-modern-50f5a0ca";
Loading

0 comments on commit cb7bf99

Please sign in to comment.