Skip to content

Commit dff0ebb

Browse files
committed
Ship diffInCommitPhase (#27409)
Performance tests at Meta showed neutral results. DiffTrain build for [7f62018](7f62018)
1 parent 26f3e58 commit dff0ebb

22 files changed

+2795
-6905
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
d9e00f795b77676fb14f2a3c6f421f48f73bec2a
1+
7f6201889e8e628eeb53e05d8850ddffa3c2e74a

compiled/facebook-www/React-dev.classic.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-classic-2c91e2cd";
30+
var ReactVersion = "18.3.0-www-classic-2db55f27";
3131

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,4 +623,4 @@ exports.useSyncExternalStore = function (
623623
exports.useTransition = function () {
624624
return ReactCurrentDispatcher.current.useTransition();
625625
};
626-
exports.version = "18.3.0-www-classic-1613cb4a";
626+
exports.version = "18.3.0-www-classic-04278c02";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,4 +615,4 @@ exports.useSyncExternalStore = function (
615615
exports.useTransition = function () {
616616
return ReactCurrentDispatcher.current.useTransition();
617617
};
618-
exports.version = "18.3.0-www-modern-a19b7375";
618+
exports.version = "18.3.0-www-modern-ee02aecb";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ exports.useSyncExternalStore = function (
634634
exports.useTransition = function () {
635635
return ReactCurrentDispatcher.current.useTransition();
636636
};
637-
exports.version = "18.3.0-www-classic-c5b7407c";
637+
exports.version = "18.3.0-www-classic-f0c12329";
638638

639639
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
640640
if (

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ exports.useSyncExternalStore = function (
626626
exports.useTransition = function () {
627627
return ReactCurrentDispatcher.current.useTransition();
628628
};
629-
exports.version = "18.3.0-www-modern-4c57bafd";
629+
exports.version = "18.3.0-www-modern-957e7028";
630630

631631
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
632632
if (

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

Lines changed: 14 additions & 45 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-1613cb4a";
72+
var ReactVersion = "18.3.0-www-classic-04278c02";
7373

7474
var LegacyRoot = 0;
7575
var ConcurrentRoot = 1;
@@ -175,7 +175,6 @@ var replayFailedUnitOfWorkWithInvokeGuardedCallback =
175175
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
176176
enableDeferRootSchedulingToMicrotask =
177177
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
178-
diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase,
179178
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
180179
alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries,
181180
enableDO_NOT_USE_disableStrictPassiveEffect =
@@ -2534,11 +2533,9 @@ var suspendResource = shim;
25342533

25352534
var pooledTransform = new Transform();
25362535
var NO_CONTEXT = {};
2537-
var UPDATE_SIGNAL = {};
25382536

25392537
{
25402538
Object.freeze(NO_CONTEXT);
2541-
Object.freeze(UPDATE_SIGNAL);
25422539
}
25432540
/** Helper Methods */
25442541

@@ -2819,9 +2816,6 @@ function prepareForCommit() {
28192816
// Noop
28202817
return null;
28212818
}
2822-
function prepareUpdate(domElement, type, oldProps, newProps) {
2823-
return UPDATE_SIGNAL;
2824-
}
28252819
function resetTextContent(domElement) {
28262820
// Noop
28272821
}
@@ -18213,22 +18207,7 @@ function updateHostComponent(
1821318207
return;
1821418208
}
1821518209

18216-
if (diffInCommitPhase) {
18217-
markUpdate(workInProgress);
18218-
} else {
18219-
// component is hitting the resume path. Figure out why. Possibly
18220-
// related to `hidden`.
18221-
18222-
getHostContext();
18223-
var updatePayload = prepareUpdate(); // TODO: Type this specific to this type of component.
18224-
18225-
workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
18226-
// is a new ref we mark this as an update. All the work is done in commitWork.
18227-
18228-
if (updatePayload) {
18229-
markUpdate(workInProgress);
18230-
}
18231-
}
18210+
markUpdate(workInProgress);
1823218211
}
1823318212
} // This function must be called at the very end of the complete phase, because
1823418213
// it might throw to suspend, and if the resource immediately loads, the work
@@ -18713,11 +18692,7 @@ function completeWork(current, workInProgress, renderLanes) {
1871318692
if (_wasHydrated2) {
1871418693
// TODO: Move this and createInstance step into the beginPhase
1871518694
// to consolidate.
18716-
if (prepareToHydrateHostInstance()) {
18717-
// If changes to the hydrated node need to be applied at the
18718-
// commit-phase we mark this as such.
18719-
markUpdate(workInProgress);
18720-
}
18695+
prepareToHydrateHostInstance();
1872118696
} else {
1872218697
getRootHostContainer();
1872318698

@@ -21856,23 +21831,17 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) {
2185621831
var _updatePayload = finishedWork.updateQueue;
2185721832
finishedWork.updateQueue = null;
2185821833

21859-
if (_updatePayload !== null || diffInCommitPhase) {
21860-
try {
21861-
commitUpdate(
21862-
_instance2,
21863-
_updatePayload,
21864-
type,
21865-
oldProps,
21866-
newProps,
21867-
finishedWork
21868-
);
21869-
} catch (error) {
21870-
captureCommitPhaseError(
21871-
finishedWork,
21872-
finishedWork.return,
21873-
error
21874-
);
21875-
}
21834+
try {
21835+
commitUpdate(
21836+
_instance2,
21837+
_updatePayload,
21838+
type,
21839+
oldProps,
21840+
newProps,
21841+
finishedWork
21842+
);
21843+
} catch (error) {
21844+
captureCommitPhaseError(finishedWork, finishedWork.return, error);
2187621845
}
2187721846
}
2187821847
}

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

Lines changed: 14 additions & 45 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-d6fa9db4";
72+
var ReactVersion = "18.3.0-www-modern-a4447545";
7373

7474
var LegacyRoot = 0;
7575
var ConcurrentRoot = 1;
@@ -175,7 +175,6 @@ var replayFailedUnitOfWorkWithInvokeGuardedCallback =
175175
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
176176
enableDeferRootSchedulingToMicrotask =
177177
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
178-
diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase,
179178
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
180179
alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries,
181180
enableDO_NOT_USE_disableStrictPassiveEffect =
@@ -2531,11 +2530,9 @@ var suspendResource = shim;
25312530

25322531
var pooledTransform = new Transform();
25332532
var NO_CONTEXT = {};
2534-
var UPDATE_SIGNAL = {};
25352533

25362534
{
25372535
Object.freeze(NO_CONTEXT);
2538-
Object.freeze(UPDATE_SIGNAL);
25392536
}
25402537
/** Helper Methods */
25412538

@@ -2816,9 +2813,6 @@ function prepareForCommit() {
28162813
// Noop
28172814
return null;
28182815
}
2819-
function prepareUpdate(domElement, type, oldProps, newProps) {
2820-
return UPDATE_SIGNAL;
2821-
}
28222816
function resetTextContent(domElement) {
28232817
// Noop
28242818
}
@@ -17907,22 +17901,7 @@ function updateHostComponent(
1790717901
return;
1790817902
}
1790917903

17910-
if (diffInCommitPhase) {
17911-
markUpdate(workInProgress);
17912-
} else {
17913-
// component is hitting the resume path. Figure out why. Possibly
17914-
// related to `hidden`.
17915-
17916-
getHostContext();
17917-
var updatePayload = prepareUpdate(); // TODO: Type this specific to this type of component.
17918-
17919-
workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
17920-
// is a new ref we mark this as an update. All the work is done in commitWork.
17921-
17922-
if (updatePayload) {
17923-
markUpdate(workInProgress);
17924-
}
17925-
}
17904+
markUpdate(workInProgress);
1792617905
}
1792717906
} // This function must be called at the very end of the complete phase, because
1792817907
// it might throw to suspend, and if the resource immediately loads, the work
@@ -18400,11 +18379,7 @@ function completeWork(current, workInProgress, renderLanes) {
1840018379
if (_wasHydrated2) {
1840118380
// TODO: Move this and createInstance step into the beginPhase
1840218381
// to consolidate.
18403-
if (prepareToHydrateHostInstance()) {
18404-
// If changes to the hydrated node need to be applied at the
18405-
// commit-phase we mark this as such.
18406-
markUpdate(workInProgress);
18407-
}
18382+
prepareToHydrateHostInstance();
1840818383
} else {
1840918384
getRootHostContainer();
1841018385

@@ -21521,23 +21496,17 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) {
2152121496
var _updatePayload = finishedWork.updateQueue;
2152221497
finishedWork.updateQueue = null;
2152321498

21524-
if (_updatePayload !== null || diffInCommitPhase) {
21525-
try {
21526-
commitUpdate(
21527-
_instance2,
21528-
_updatePayload,
21529-
type,
21530-
oldProps,
21531-
newProps,
21532-
finishedWork
21533-
);
21534-
} catch (error) {
21535-
captureCommitPhaseError(
21536-
finishedWork,
21537-
finishedWork.return,
21538-
error
21539-
);
21540-
}
21499+
try {
21500+
commitUpdate(
21501+
_instance2,
21502+
_updatePayload,
21503+
type,
21504+
oldProps,
21505+
newProps,
21506+
finishedWork
21507+
);
21508+
} catch (error) {
21509+
captureCommitPhaseError(finishedWork, finishedWork.return, error);
2154121510
}
2154221511
}
2154321512
}

0 commit comments

Comments
 (0)