Skip to content

Commit 6c615dc

Browse files
committed
- Refactor some controlled component stuff (#26573) - Don't update textarea defaultValue and input checked unnecessarily (#26580) - Diff properties in the commit phase instead of generating an update payload (#26583) - Move validation of text nesting into ReactDOMComponent (#26594) - Remove initOption special case (#26595) - Use already extracted values instead of reading off props for controlled components (#26596) - Fix input tracking bug (#26627) DiffTrain build for [ded4a78](ded4a78)
1 parent dccdf22 commit 6c615dc

19 files changed

+12419
-6254
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
e48e771805c44929e0beb6fa138822a20765a3aa
1+
ded4a785b875d384f78efa28279550d86d93f54f

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-www-modern-47cd17f3";
30+
var ReactVersion = "18.3.0-www-modern-95e6ae95";
3131

3232
// ATTENTION
3333
// When adding new symbols to this file,

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

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
6969
return self;
7070
}
7171

72-
var ReactVersion = "18.3.0-www-classic-c6b3e31c";
72+
var ReactVersion = "18.3.0-www-classic-daf8f3c7";
7373

7474
var LegacyRoot = 0;
7575
var ConcurrentRoot = 1;
@@ -177,7 +177,8 @@ var revertRemovalOfSiblingPrerendering =
177177
enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane,
178178
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
179179
enableDeferRootSchedulingToMicrotask =
180-
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask; // On WWW, false is used for a new modern build.
180+
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
181+
diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase; // On WWW, false is used for a new modern build.
181182
var enableProfilerTimer = true;
182183
var enableProfilerCommitHooks = true;
183184
var enableProfilerNestedUpdatePhase = true;
@@ -17583,18 +17584,23 @@ function updateHostComponent(
1758317584
// In mutation mode, this is sufficient for a bailout because
1758417585
// we won't touch this node even if children changed.
1758517586
return;
17586-
} // If we get updated because one of our children updated, we don't
17587-
getHostContext(); // TODO: Experiencing an error where oldProps is null. Suggests a host
17588-
// component is hitting the resume path. Figure out why. Possibly
17589-
// related to `hidden`.
17587+
}
17588+
17589+
if (diffInCommitPhase) {
17590+
markUpdate(workInProgress);
17591+
} else {
17592+
// component is hitting the resume path. Figure out why. Possibly
17593+
// related to `hidden`.
1759017594

17591-
var updatePayload = prepareUpdate(); // TODO: Type this specific to this type of component.
17595+
getHostContext();
17596+
var updatePayload = prepareUpdate(); // TODO: Type this specific to this type of component.
1759217597

17593-
workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
17594-
// is a new ref we mark this as an update. All the work is done in commitWork.
17598+
workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
17599+
// is a new ref we mark this as an update. All the work is done in commitWork.
1759517600

17596-
if (updatePayload) {
17597-
markUpdate(workInProgress);
17601+
if (updatePayload) {
17602+
markUpdate(workInProgress);
17603+
}
1759817604
}
1759917605
}
1760017606
} // This function must be called at the very end of the complete phase, because
@@ -21225,7 +21231,7 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) {
2122521231
var _updatePayload = finishedWork.updateQueue;
2122621232
finishedWork.updateQueue = null;
2122721233

21228-
if (_updatePayload !== null) {
21234+
if (_updatePayload !== null || diffInCommitPhase) {
2122921235
try {
2123021236
commitUpdate(
2123121237
_instance2,

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

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
6969
return self;
7070
}
7171

72-
var ReactVersion = "18.3.0-www-modern-71e9d049";
72+
var ReactVersion = "18.3.0-www-modern-ae1f3bca";
7373

7474
var LegacyRoot = 0;
7575
var ConcurrentRoot = 1;
@@ -177,7 +177,8 @@ var revertRemovalOfSiblingPrerendering =
177177
enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane,
178178
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
179179
enableDeferRootSchedulingToMicrotask =
180-
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask; // On WWW, true is used for a new modern build.
180+
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
181+
diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase; // On WWW, true is used for a new modern build.
181182
var enableProfilerTimer = true;
182183
var enableProfilerCommitHooks = true;
183184
var enableProfilerNestedUpdatePhase = true;
@@ -17277,18 +17278,23 @@ function updateHostComponent(
1727717278
// In mutation mode, this is sufficient for a bailout because
1727817279
// we won't touch this node even if children changed.
1727917280
return;
17280-
} // If we get updated because one of our children updated, we don't
17281-
getHostContext(); // TODO: Experiencing an error where oldProps is null. Suggests a host
17282-
// component is hitting the resume path. Figure out why. Possibly
17283-
// related to `hidden`.
17281+
}
17282+
17283+
if (diffInCommitPhase) {
17284+
markUpdate(workInProgress);
17285+
} else {
17286+
// component is hitting the resume path. Figure out why. Possibly
17287+
// related to `hidden`.
1728417288

17285-
var updatePayload = prepareUpdate(); // TODO: Type this specific to this type of component.
17289+
getHostContext();
17290+
var updatePayload = prepareUpdate(); // TODO: Type this specific to this type of component.
1728617291

17287-
workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
17288-
// is a new ref we mark this as an update. All the work is done in commitWork.
17292+
workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
17293+
// is a new ref we mark this as an update. All the work is done in commitWork.
1728917294

17290-
if (updatePayload) {
17291-
markUpdate(workInProgress);
17295+
if (updatePayload) {
17296+
markUpdate(workInProgress);
17297+
}
1729217298
}
1729317299
}
1729417300
} // This function must be called at the very end of the complete phase, because
@@ -20890,7 +20896,7 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) {
2089020896
var _updatePayload = finishedWork.updateQueue;
2089120897
finishedWork.updateQueue = null;
2089220898

20893-
if (_updatePayload !== null) {
20899+
if (_updatePayload !== null || diffInCommitPhase) {
2089420900
try {
2089520901
commitUpdate(
2089620902
_instance2,

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ var ReactSharedInternals =
7373
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
7474
enableDeferRootSchedulingToMicrotask =
7575
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
76+
diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase,
7677
REACT_ELEMENT_TYPE = Symbol.for("react.element"),
7778
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
7879
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
@@ -5240,6 +5241,9 @@ function getChildContextValues(context) {
52405241
collectNearestChildContextValues(currentFiber, context, childContextValues);
52415242
return childContextValues;
52425243
}
5244+
function markUpdate(workInProgress) {
5245+
workInProgress.flags |= 4;
5246+
}
52435247
function scheduleRetryEffect(workInProgress, retryQueue) {
52445248
null !== retryQueue
52455249
? (workInProgress.flags |= 4)
@@ -5359,8 +5363,10 @@ function completeWork(current, workInProgress, renderLanes) {
53595363
renderLanes = workInProgress.type;
53605364
if (null !== current && null != workInProgress.stateNode)
53615365
current.memoizedProps !== newProps &&
5362-
(workInProgress.updateQueue = UPDATE_SIGNAL) &&
5363-
(workInProgress.flags |= 4),
5366+
(diffInCommitPhase
5367+
? markUpdate(workInProgress)
5368+
: (workInProgress.updateQueue = UPDATE_SIGNAL) &&
5369+
markUpdate(workInProgress)),
53645370
current.ref !== workInProgress.ref &&
53655371
(workInProgress.flags |= 2097664);
53665372
else {
@@ -5427,7 +5433,7 @@ function completeWork(current, workInProgress, renderLanes) {
54275433
return null;
54285434
case 6:
54295435
if (current && null != workInProgress.stateNode)
5430-
current.memoizedProps !== newProps && (workInProgress.flags |= 4);
5436+
current.memoizedProps !== newProps && markUpdate(workInProgress);
54315437
else {
54325438
if ("string" !== typeof newProps && null === workInProgress.stateNode)
54335439
throw Error(formatProdErrorMessage(166));
@@ -5597,8 +5603,8 @@ function completeWork(current, workInProgress, renderLanes) {
55975603
}),
55985604
shim$1(),
55995605
null !== workInProgress.ref &&
5600-
((workInProgress.flags |= 2097664), (workInProgress.flags |= 4)))
5601-
: (null !== workInProgress.ref && (workInProgress.flags |= 4),
5606+
((workInProgress.flags |= 2097664), markUpdate(workInProgress)))
5607+
: (null !== workInProgress.ref && markUpdate(workInProgress),
56025608
current.ref !== workInProgress.ref &&
56035609
(workInProgress.flags |= 2097664)),
56045610
bubbleProperties(workInProgress),
@@ -6665,7 +6671,7 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
66656671
current = null !== current ? current.memoizedProps : newProps;
66666672
var updatePayload = finishedWork.updateQueue;
66676673
finishedWork.updateQueue = null;
6668-
if (null !== updatePayload)
6674+
if (null !== updatePayload || diffInCommitPhase)
66696675
try {
66706676
flags._applyProps(flags, newProps, current);
66716677
} catch (error$108) {
@@ -10072,7 +10078,7 @@ var slice = Array.prototype.slice,
1007210078
return null;
1007310079
},
1007410080
bundleType: 0,
10075-
version: "18.3.0-www-classic-0d8af644",
10081+
version: "18.3.0-www-classic-9e45a6d4",
1007610082
rendererPackageName: "react-art"
1007710083
};
1007810084
var internals$jscomp$inline_1344 = {
@@ -10103,7 +10109,7 @@ var internals$jscomp$inline_1344 = {
1010310109
scheduleRoot: null,
1010410110
setRefreshHandler: null,
1010510111
getCurrentFiber: null,
10106-
reconcilerVersion: "18.3.0-www-classic-0d8af644"
10112+
reconcilerVersion: "18.3.0-www-classic-9e45a6d4"
1010710113
};
1010810114
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1010910115
var hook$jscomp$inline_1345 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ var ReactSharedInternals =
7373
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
7474
enableDeferRootSchedulingToMicrotask =
7575
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
76+
diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase,
7677
REACT_ELEMENT_TYPE = Symbol.for("react.element"),
7778
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
7879
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
@@ -4995,6 +4996,9 @@ function getChildContextValues(context) {
49954996
collectNearestChildContextValues(currentFiber, context, childContextValues);
49964997
return childContextValues;
49974998
}
4999+
function markUpdate(workInProgress) {
5000+
workInProgress.flags |= 4;
5001+
}
49985002
function scheduleRetryEffect(workInProgress, retryQueue) {
49995003
null !== retryQueue
50005004
? (workInProgress.flags |= 4)
@@ -5108,8 +5112,10 @@ function completeWork(current, workInProgress, renderLanes) {
51085112
renderLanes = workInProgress.type;
51095113
if (null !== current && null != workInProgress.stateNode)
51105114
current.memoizedProps !== newProps &&
5111-
(workInProgress.updateQueue = UPDATE_SIGNAL) &&
5112-
(workInProgress.flags |= 4),
5115+
(diffInCommitPhase
5116+
? markUpdate(workInProgress)
5117+
: (workInProgress.updateQueue = UPDATE_SIGNAL) &&
5118+
markUpdate(workInProgress)),
51135119
current.ref !== workInProgress.ref &&
51145120
(workInProgress.flags |= 2097664);
51155121
else {
@@ -5176,7 +5182,7 @@ function completeWork(current, workInProgress, renderLanes) {
51765182
return null;
51775183
case 6:
51785184
if (current && null != workInProgress.stateNode)
5179-
current.memoizedProps !== newProps && (workInProgress.flags |= 4);
5185+
current.memoizedProps !== newProps && markUpdate(workInProgress);
51805186
else {
51815187
if ("string" !== typeof newProps && null === workInProgress.stateNode)
51825188
throw Error(formatProdErrorMessage(166));
@@ -5342,8 +5348,8 @@ function completeWork(current, workInProgress, renderLanes) {
53425348
}),
53435349
shim$1(),
53445350
null !== workInProgress.ref &&
5345-
((workInProgress.flags |= 2097664), (workInProgress.flags |= 4)))
5346-
: (null !== workInProgress.ref && (workInProgress.flags |= 4),
5351+
((workInProgress.flags |= 2097664), markUpdate(workInProgress)))
5352+
: (null !== workInProgress.ref && markUpdate(workInProgress),
53475353
current.ref !== workInProgress.ref &&
53485354
(workInProgress.flags |= 2097664)),
53495355
bubbleProperties(workInProgress),
@@ -6401,7 +6407,7 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
64016407
current = null !== current ? current.memoizedProps : newProps;
64026408
var updatePayload = finishedWork.updateQueue;
64036409
finishedWork.updateQueue = null;
6404-
if (null !== updatePayload)
6410+
if (null !== updatePayload || diffInCommitPhase)
64056411
try {
64066412
flags._applyProps(flags, newProps, current);
64076413
} catch (error$107) {
@@ -9737,7 +9743,7 @@ var slice = Array.prototype.slice,
97379743
return null;
97389744
},
97399745
bundleType: 0,
9740-
version: "18.3.0-www-modern-5a04a0b8",
9746+
version: "18.3.0-www-modern-52157a92",
97419747
rendererPackageName: "react-art"
97429748
};
97439749
var internals$jscomp$inline_1324 = {
@@ -9768,7 +9774,7 @@ var internals$jscomp$inline_1324 = {
97689774
scheduleRoot: null,
97699775
setRefreshHandler: null,
97709776
getCurrentFiber: null,
9771-
reconcilerVersion: "18.3.0-www-modern-5a04a0b8"
9777+
reconcilerVersion: "18.3.0-www-modern-52157a92"
97729778
};
97739779
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
97749780
var hook$jscomp$inline_1325 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

0 commit comments

Comments
 (0)