Skip to content

Commit

Permalink
Remove dynamic www flag for disableInputAttributeSyncing (#28703)
Browse files Browse the repository at this point in the history
Remove dynamic www flag for disableInputAttributeSyncing

DiffTrain build for [7659c4d](7659c4d)
  • Loading branch information
kassens committed Apr 2, 2024
1 parent 4af8db7 commit f21dee5
Show file tree
Hide file tree
Showing 13 changed files with 180 additions and 500 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7319c61b18274ee7e7c20bd2e533b93c922d8fe0
7659c4d9e0e4de2ec758c9a03ad7cbf07fc696d0
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if (__DEV__) {
return self;
}

var ReactVersion = "19.0.0-www-classic-2807bf19";
var ReactVersion = "19.0.0-www-classic-9edd2970";

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down Expand Up @@ -192,7 +192,7 @@ if (__DEV__) {
var enableProfilerTimer = true;
var enableProfilerCommitHooks = true;
var enableProfilerNestedUpdatePhase = true;
var enableAsyncActions = true; // Logs additional User Timing API marks for use with an experimental profiling tool.
var enableAsyncActions = true;

var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler;

Expand Down
4 changes: 2 additions & 2 deletions 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 = "19.0.0-www-modern-3f8cc689";
var ReactVersion = "19.0.0-www-modern-5aabb0c4";

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down Expand Up @@ -192,7 +192,7 @@ if (__DEV__) {
var enableProfilerTimer = true;
var enableProfilerCommitHooks = true;
var enableProfilerNestedUpdatePhase = true;
var enableAsyncActions = true; // Logs additional User Timing API marks for use with an experimental profiling tool.
var enableAsyncActions = true;

var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler;

Expand Down
71 changes: 9 additions & 62 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ if (__DEV__) {
// Re-export dynamic flags from the www version.
var dynamicFeatureFlags = require("ReactFeatureFlags");

var disableInputAttributeSyncing =
dynamicFeatureFlags.disableInputAttributeSyncing,
disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds,
var disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds,
enableBigIntSupport = dynamicFeatureFlags.enableBigIntSupport,
enableTrustedTypesIntegration =
dynamicFeatureFlags.enableTrustedTypesIntegration,
Expand Down Expand Up @@ -158,7 +156,7 @@ if (__DEV__) {
var enableProfilerTimer = true;
var enableProfilerCommitHooks = true;
var enableProfilerNestedUpdatePhase = true;
var enableAsyncActions = true; // Logs additional User Timing API marks for use with an experimental profiling tool.
var enableAsyncActions = true;

var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler;
var enableSuspenseCallback = true;
Expand Down Expand Up @@ -4124,16 +4122,7 @@ if (__DEV__) {
node.removeAttribute("value");
}

if (disableInputAttributeSyncing) {
// When not syncing the value attribute, React only assigns a new value
// whenever the defaultValue React prop has changed. When not present,
// React does nothing
if (defaultValue != null) {
setDefaultValue(node, type, getToStringValue(defaultValue));
} else if (lastDefaultValue != null) {
node.removeAttribute("value");
}
} else {
{
// When syncing the value attribute, the value comes from a cascade of
// properties:
// 1. The value React property
Expand All @@ -4148,16 +4137,7 @@ if (__DEV__) {
}
}

if (disableInputAttributeSyncing) {
// When not syncing the checked attribute, the attribute is directly
// controllable from the defaultValue React property. It needs to be
// updated as new props come in.
if (defaultChecked == null) {
node.removeAttribute("checked");
} else {
node.defaultChecked = !!defaultChecked;
}
} else {
{
// When syncing the checked attribute, it only changes when it needs
// to be removed, such as transitioning from a checkbox into a text input
if (checked == null && defaultChecked != null) {
Expand Down Expand Up @@ -4231,26 +4211,7 @@ if (__DEV__) {
// from being lost during SSR hydration.

if (!isHydrating) {
if (disableInputAttributeSyncing) {
// When not syncing the value attribute, the value property points
// directly to the React prop. Only assign it if it exists.
if (value != null) {
// Always assign on buttons so that it is possible to assign an
// empty string to clear button text.
//
// Otherwise, do not re-assign the value property if is empty. This
// potentially avoids a DOM write and prevents Firefox (~60.0.1) from
// prematurely marking required inputs as invalid. Equality is compared
// to the current value in case the browser provided value is not an
// empty string.
if (
isButton ||
toString(getToStringValue(value)) !== node.value
) {
node.value = toString(getToStringValue(value));
}
}
} else {
{
// When syncing the value attribute, the value property should use
// the wrapperState._initialValue property. This uses:
//
Expand All @@ -4263,13 +4224,7 @@ if (__DEV__) {
}
}

if (disableInputAttributeSyncing) {
// When not syncing the value attribute, assign the value attribute
// directly from the defaultValue React property (when present)
if (defaultValue != null) {
node.defaultValue = defaultValueStr;
}
} else {
{
// Otherwise, the value attribute is synchronized to the property,
// so we assign defaultValue to the same thing as the value property
// assignment step above.
Expand All @@ -4296,15 +4251,7 @@ if (__DEV__) {
node.checked = !!initialChecked;
}

if (disableInputAttributeSyncing) {
// Only assign the checked attribute if it is defined. This saves
// a DOM write when controlling the checked attribute isn't needed
// (text inputs, submit/reset)
if (defaultChecked != null) {
node.defaultChecked = !node.defaultChecked;
node.defaultChecked = !!defaultChecked;
}
} else {
{
// When syncing the checked attribute, both the checked property and
// attribute are assigned at the same time using defaultChecked. This uses:
//
Expand Down Expand Up @@ -36333,7 +36280,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "19.0.0-www-classic-ae62c2e6";
var ReactVersion = "19.0.0-www-classic-80b168f2";

function createPortal$1(
children,
Expand Down Expand Up @@ -38562,7 +38509,7 @@ if (__DEV__) {
return;
}

if (!disableInputAttributeSyncing) {
{
var isControlled = props.value != null;

if (isControlled) {
Expand Down
71 changes: 9 additions & 62 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ if (__DEV__) {
// Re-export dynamic flags from the www version.
var dynamicFeatureFlags = require("ReactFeatureFlags");

var disableInputAttributeSyncing =
dynamicFeatureFlags.disableInputAttributeSyncing,
disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds,
var disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds,
enableBigIntSupport = dynamicFeatureFlags.enableBigIntSupport,
enableTrustedTypesIntegration =
dynamicFeatureFlags.enableTrustedTypesIntegration,
Expand Down Expand Up @@ -154,7 +152,7 @@ if (__DEV__) {
var enableProfilerTimer = true;
var enableProfilerCommitHooks = true;
var enableProfilerNestedUpdatePhase = true;
var enableAsyncActions = true; // Logs additional User Timing API marks for use with an experimental profiling tool.
var enableAsyncActions = true;

var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler;
var enableSuspenseCallback = true;
Expand Down Expand Up @@ -3979,16 +3977,7 @@ if (__DEV__) {
node.removeAttribute("value");
}

if (disableInputAttributeSyncing) {
// When not syncing the value attribute, React only assigns a new value
// whenever the defaultValue React prop has changed. When not present,
// React does nothing
if (defaultValue != null) {
setDefaultValue(node, type, getToStringValue(defaultValue));
} else if (lastDefaultValue != null) {
node.removeAttribute("value");
}
} else {
{
// When syncing the value attribute, the value comes from a cascade of
// properties:
// 1. The value React property
Expand All @@ -4003,16 +3992,7 @@ if (__DEV__) {
}
}

if (disableInputAttributeSyncing) {
// When not syncing the checked attribute, the attribute is directly
// controllable from the defaultValue React property. It needs to be
// updated as new props come in.
if (defaultChecked == null) {
node.removeAttribute("checked");
} else {
node.defaultChecked = !!defaultChecked;
}
} else {
{
// When syncing the checked attribute, it only changes when it needs
// to be removed, such as transitioning from a checkbox into a text input
if (checked == null && defaultChecked != null) {
Expand Down Expand Up @@ -4086,26 +4066,7 @@ if (__DEV__) {
// from being lost during SSR hydration.

if (!isHydrating) {
if (disableInputAttributeSyncing) {
// When not syncing the value attribute, the value property points
// directly to the React prop. Only assign it if it exists.
if (value != null) {
// Always assign on buttons so that it is possible to assign an
// empty string to clear button text.
//
// Otherwise, do not re-assign the value property if is empty. This
// potentially avoids a DOM write and prevents Firefox (~60.0.1) from
// prematurely marking required inputs as invalid. Equality is compared
// to the current value in case the browser provided value is not an
// empty string.
if (
isButton ||
toString(getToStringValue(value)) !== node.value
) {
node.value = toString(getToStringValue(value));
}
}
} else {
{
// When syncing the value attribute, the value property should use
// the wrapperState._initialValue property. This uses:
//
Expand All @@ -4118,13 +4079,7 @@ if (__DEV__) {
}
}

if (disableInputAttributeSyncing) {
// When not syncing the value attribute, assign the value attribute
// directly from the defaultValue React property (when present)
if (defaultValue != null) {
node.defaultValue = defaultValueStr;
}
} else {
{
// Otherwise, the value attribute is synchronized to the property,
// so we assign defaultValue to the same thing as the value property
// assignment step above.
Expand All @@ -4151,15 +4106,7 @@ if (__DEV__) {
node.checked = !!initialChecked;
}

if (disableInputAttributeSyncing) {
// Only assign the checked attribute if it is defined. This saves
// a DOM write when controlling the checked attribute isn't needed
// (text inputs, submit/reset)
if (defaultChecked != null) {
node.defaultChecked = !node.defaultChecked;
node.defaultChecked = !!defaultChecked;
}
} else {
{
// When syncing the checked attribute, both the checked property and
// attribute are assigned at the same time using defaultChecked. This uses:
//
Expand Down Expand Up @@ -36181,7 +36128,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "19.0.0-www-modern-7dc0b27f";
var ReactVersion = "19.0.0-www-modern-e4bc2307";

function createPortal$1(
children,
Expand Down Expand Up @@ -39412,7 +39359,7 @@ if (__DEV__) {
return;
}

if (!disableInputAttributeSyncing) {
{
var isControlled = props.value != null;

if (isControlled) {
Expand Down
Loading

0 comments on commit f21dee5

Please sign in to comment.