Skip to content

Commit d2cd2f2

Browse files
committed
Ship diffInCommitPhase (#27409)
Performance tests at Meta showed neutral results. DiffTrain build for commit 7f62018.
1 parent 59e0111 commit d2cd2f2

File tree

13 files changed

+206
-245
lines changed

13 files changed

+206
-245
lines changed

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<90d4b49133c0f3de327f45d0812fd8e9>>
10+
* @generated SignedSource<<0e3d907c9303927e282697c3cd932853>>
1111
*/
1212

1313
'use strict';
@@ -144,7 +144,6 @@ var enableProfilerNestedUpdatePhase = true;
144144
var createRootStrictEffectsByDefault = false;
145145
var enableLazyContextPropagation = false;
146146
var enableLegacyHidden = false;
147-
var diffInCommitPhase = true;
148147
var enableAsyncActions = false;
149148
var alwaysThrottleRetries = true; // Flow magic to verify the exports of this file match the original version.
150149

@@ -15089,9 +15088,7 @@ function updateHostComponent(
1508915088
return;
1509015089
}
1509115090

15092-
{
15093-
markUpdate(workInProgress);
15094-
}
15091+
markUpdate(workInProgress);
1509515092
}
1509615093
} // This function must be called at the very end of the complete phase, because
1509715094
// it might throw to suspend, and if the resource immediately loads, the work
@@ -15541,7 +15538,7 @@ function completeWork(current, workInProgress, renderLanes) {
1554115538
return null;
1554215539
}
1554315540

15544-
var _currentHostContext2 = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context
15541+
var _currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context
1554515542
// "stack" as the parent. Then append children as we go in beginWork
1554615543
// or completeWork depending on whether we want to add them top->down or
1554715544
// bottom->up. Top->down is faster in IE11.
@@ -15551,19 +15548,15 @@ function completeWork(current, workInProgress, renderLanes) {
1555115548
if (_wasHydrated2) {
1555215549
// TODO: Move this and createInstance step into the beginPhase
1555315550
// to consolidate.
15554-
if (prepareToHydrateHostInstance()) {
15555-
// If changes to the hydrated node need to be applied at the
15556-
// commit-phase we mark this as such.
15557-
markUpdate(workInProgress);
15558-
}
15551+
prepareToHydrateHostInstance();
1555915552
} else {
1556015553
var _rootContainerInstance = getRootHostContainer();
1556115554

1556215555
var _instance3 = createInstance(
1556315556
_type2,
1556415557
newProps,
1556515558
_rootContainerInstance,
15566-
_currentHostContext2,
15559+
_currentHostContext,
1556715560
workInProgress
1556815561
);
1556915562

@@ -18358,23 +18351,17 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) {
1835818351
var _updatePayload = finishedWork.updateQueue;
1835918352
finishedWork.updateQueue = null;
1836018353

18361-
if (_updatePayload !== null || diffInCommitPhase) {
18362-
try {
18363-
commitUpdate(
18364-
_instance2,
18365-
_updatePayload,
18366-
type,
18367-
oldProps,
18368-
newProps,
18369-
finishedWork
18370-
);
18371-
} catch (error) {
18372-
captureCommitPhaseError(
18373-
finishedWork,
18374-
finishedWork.return,
18375-
error
18376-
);
18377-
}
18354+
try {
18355+
commitUpdate(
18356+
_instance2,
18357+
_updatePayload,
18358+
type,
18359+
oldProps,
18360+
newProps,
18361+
finishedWork
18362+
);
18363+
} catch (error) {
18364+
captureCommitPhaseError(finishedWork, finishedWork.return, error);
1837818365
}
1837918366
}
1838018367
}
@@ -23998,7 +23985,7 @@ function createFiberRoot(
2399823985
return root;
2399923986
}
2400023987

24001-
var ReactVersion = "18.3.0-canary-d9e00f795-20230922";
23988+
var ReactVersion = "18.3.0-canary-7f6201889-20230922";
2400223989

2400323990
// Might add PROFILE later.
2400423991

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<5361a5f040398d7d166b0f13b30a010c>>
10+
* @generated SignedSource<<b1b02ea2864306d9401fff67f78939a8>>
1111
*/
1212

1313
"use strict";
@@ -8615,19 +8615,19 @@ function wrapFiber(fiber) {
86158615
fiberToWrapper.set(fiber, wrapper));
86168616
return wrapper;
86178617
}
8618-
var devToolsConfig$jscomp$inline_1028 = {
8618+
var devToolsConfig$jscomp$inline_1027 = {
86198619
findFiberByHostInstance: function () {
86208620
throw Error("TestRenderer does not support findFiberByHostInstance()");
86218621
},
86228622
bundleType: 0,
8623-
version: "18.3.0-canary-d9e00f795-20230922",
8623+
version: "18.3.0-canary-7f6201889-20230922",
86248624
rendererPackageName: "react-test-renderer"
86258625
};
8626-
var internals$jscomp$inline_1227 = {
8627-
bundleType: devToolsConfig$jscomp$inline_1028.bundleType,
8628-
version: devToolsConfig$jscomp$inline_1028.version,
8629-
rendererPackageName: devToolsConfig$jscomp$inline_1028.rendererPackageName,
8630-
rendererConfig: devToolsConfig$jscomp$inline_1028.rendererConfig,
8626+
var internals$jscomp$inline_1226 = {
8627+
bundleType: devToolsConfig$jscomp$inline_1027.bundleType,
8628+
version: devToolsConfig$jscomp$inline_1027.version,
8629+
rendererPackageName: devToolsConfig$jscomp$inline_1027.rendererPackageName,
8630+
rendererConfig: devToolsConfig$jscomp$inline_1027.rendererConfig,
86318631
overrideHookState: null,
86328632
overrideHookStateDeletePath: null,
86338633
overrideHookStateRenamePath: null,
@@ -8644,26 +8644,26 @@ var internals$jscomp$inline_1227 = {
86448644
return null === fiber ? null : fiber.stateNode;
86458645
},
86468646
findFiberByHostInstance:
8647-
devToolsConfig$jscomp$inline_1028.findFiberByHostInstance ||
8647+
devToolsConfig$jscomp$inline_1027.findFiberByHostInstance ||
86488648
emptyFindFiberByHostInstance,
86498649
findHostInstancesForRefresh: null,
86508650
scheduleRefresh: null,
86518651
scheduleRoot: null,
86528652
setRefreshHandler: null,
86538653
getCurrentFiber: null,
8654-
reconcilerVersion: "18.3.0-canary-d9e00f795-20230922"
8654+
reconcilerVersion: "18.3.0-canary-7f6201889-20230922"
86558655
};
86568656
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
8657-
var hook$jscomp$inline_1228 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
8657+
var hook$jscomp$inline_1227 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
86588658
if (
8659-
!hook$jscomp$inline_1228.isDisabled &&
8660-
hook$jscomp$inline_1228.supportsFiber
8659+
!hook$jscomp$inline_1227.isDisabled &&
8660+
hook$jscomp$inline_1227.supportsFiber
86618661
)
86628662
try {
8663-
(rendererID = hook$jscomp$inline_1228.inject(
8664-
internals$jscomp$inline_1227
8663+
(rendererID = hook$jscomp$inline_1227.inject(
8664+
internals$jscomp$inline_1226
86658665
)),
8666-
(injectedHook = hook$jscomp$inline_1228);
8666+
(injectedHook = hook$jscomp$inline_1227);
86678667
} catch (err) {}
86688668
}
86698669
exports._Scheduler = Scheduler;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<486546c05387fd5f0f9d0c9c12aa9b75>>
10+
* @generated SignedSource<<d7da817483638eb94b412ab9cb540ebb>>
1111
*/
1212

1313
"use strict";
@@ -9041,19 +9041,19 @@ function wrapFiber(fiber) {
90419041
fiberToWrapper.set(fiber, wrapper));
90429042
return wrapper;
90439043
}
9044-
var devToolsConfig$jscomp$inline_1070 = {
9044+
var devToolsConfig$jscomp$inline_1069 = {
90459045
findFiberByHostInstance: function () {
90469046
throw Error("TestRenderer does not support findFiberByHostInstance()");
90479047
},
90489048
bundleType: 0,
9049-
version: "18.3.0-canary-d9e00f795-20230922",
9049+
version: "18.3.0-canary-7f6201889-20230922",
90509050
rendererPackageName: "react-test-renderer"
90519051
};
9052-
var internals$jscomp$inline_1268 = {
9053-
bundleType: devToolsConfig$jscomp$inline_1070.bundleType,
9054-
version: devToolsConfig$jscomp$inline_1070.version,
9055-
rendererPackageName: devToolsConfig$jscomp$inline_1070.rendererPackageName,
9056-
rendererConfig: devToolsConfig$jscomp$inline_1070.rendererConfig,
9052+
var internals$jscomp$inline_1267 = {
9053+
bundleType: devToolsConfig$jscomp$inline_1069.bundleType,
9054+
version: devToolsConfig$jscomp$inline_1069.version,
9055+
rendererPackageName: devToolsConfig$jscomp$inline_1069.rendererPackageName,
9056+
rendererConfig: devToolsConfig$jscomp$inline_1069.rendererConfig,
90579057
overrideHookState: null,
90589058
overrideHookStateDeletePath: null,
90599059
overrideHookStateRenamePath: null,
@@ -9070,26 +9070,26 @@ var internals$jscomp$inline_1268 = {
90709070
return null === fiber ? null : fiber.stateNode;
90719071
},
90729072
findFiberByHostInstance:
9073-
devToolsConfig$jscomp$inline_1070.findFiberByHostInstance ||
9073+
devToolsConfig$jscomp$inline_1069.findFiberByHostInstance ||
90749074
emptyFindFiberByHostInstance,
90759075
findHostInstancesForRefresh: null,
90769076
scheduleRefresh: null,
90779077
scheduleRoot: null,
90789078
setRefreshHandler: null,
90799079
getCurrentFiber: null,
9080-
reconcilerVersion: "18.3.0-canary-d9e00f795-20230922"
9080+
reconcilerVersion: "18.3.0-canary-7f6201889-20230922"
90819081
};
90829082
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
9083-
var hook$jscomp$inline_1269 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
9083+
var hook$jscomp$inline_1268 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
90849084
if (
9085-
!hook$jscomp$inline_1269.isDisabled &&
9086-
hook$jscomp$inline_1269.supportsFiber
9085+
!hook$jscomp$inline_1268.isDisabled &&
9086+
hook$jscomp$inline_1268.supportsFiber
90879087
)
90889088
try {
9089-
(rendererID = hook$jscomp$inline_1269.inject(
9090-
internals$jscomp$inline_1268
9089+
(rendererID = hook$jscomp$inline_1268.inject(
9090+
internals$jscomp$inline_1267
90919091
)),
9092-
(injectedHook = hook$jscomp$inline_1269);
9092+
(injectedHook = hook$jscomp$inline_1268);
90939093
} catch (err) {}
90949094
}
90959095
exports._Scheduler = Scheduler;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.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-canary-d9e00f795-20230922";
30+
var ReactVersion = "18.3.0-canary-7f6201889-20230922";
3131

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

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,4 +616,4 @@ exports.useSyncExternalStore = function (
616616
exports.useTransition = function () {
617617
return ReactCurrentDispatcher.current.useTransition();
618618
};
619-
exports.version = "18.3.0-canary-d9e00f795-20230922";
619+
exports.version = "18.3.0-canary-7f6201889-20230922";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ exports.useSyncExternalStore = function (
619619
exports.useTransition = function () {
620620
return ReactCurrentDispatcher.current.useTransition();
621621
};
622-
exports.version = "18.3.0-canary-d9e00f795-20230922";
622+
exports.version = "18.3.0-canary-7f6201889-20230922";
623623

624624
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
625625
if (
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
d9e00f795b77676fb14f2a3c6f421f48f73bec2a
1+
7f6201889e8e628eeb53e05d8850ddffa3c2e74a

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<01008a8950368c139ee32158a8728c5d>>
10+
* @generated SignedSource<<bfbfdcdd5acb2e3049107f9e3d279ba1>>
1111
*/
1212

1313
'use strict';
@@ -4997,34 +4997,28 @@ var cancelTimeout = clearTimeout;
49974997
var noTimeout = -1; // -------------------
49984998
function cloneInstance(
49994999
instance,
5000-
updatePayload,
50015000
type,
50025001
oldProps,
50035002
newProps,
50045003
internalInstanceHandle,
50055004
keepChildren,
50065005
recyclableInstance
50075006
) {
5008-
{
5009-
var viewConfig = instance.canonical.viewConfig;
5010-
updatePayload = diff(oldProps, newProps, viewConfig.validAttributes); // TODO: If the event handlers have changed, we need to update the current props
5011-
// in the commit phase but there is no host config hook to do it yet.
5012-
// So instead we hack it by updating it in the render phase.
5013-
5014-
instance.canonical.currentProps = newProps;
5015-
}
5007+
var viewConfig = instance.canonical.viewConfig;
5008+
var updatePayload = diff(oldProps, newProps, viewConfig.validAttributes); // TODO: If the event handlers have changed, we need to update the current props
5009+
// in the commit phase but there is no host config hook to do it yet.
5010+
// So instead we hack it by updating it in the render phase.
50165011

5012+
instance.canonical.currentProps = newProps;
50175013
var node = instance.node;
50185014
var clone;
50195015

50205016
if (keepChildren) {
50215017
if (updatePayload !== null) {
50225018
clone = cloneNodeWithNewProps(node, updatePayload);
50235019
} else {
5024-
{
5025-
// No changes
5026-
return instance;
5027-
}
5020+
// No changes
5021+
return instance;
50285022
}
50295023
} else {
50305024
if (updatePayload !== null) {
@@ -18880,14 +18874,9 @@ function updateHostComponent(
1888018874
workInProgress.stateNode = currentInstance;
1888118875
return;
1888218876
}
18883-
1888418877
getHostContext();
18885-
18886-
var _updatePayload = null;
18887-
1888818878
var newInstance = cloneInstance(
1888918879
currentInstance,
18890-
_updatePayload,
1889118880
type,
1889218881
_oldProps,
1889318882
newProps,
@@ -19359,7 +19348,7 @@ function completeWork(current, workInProgress, renderLanes) {
1935919348
return null;
1936019349
}
1936119350

19362-
var _currentHostContext2 = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context
19351+
var _currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context
1936319352
// "stack" as the parent. Then append children as we go in beginWork
1936419353
// or completeWork depending on whether we want to add them top->down or
1936519354
// bottom->up. Top->down is faster in IE11.
@@ -19369,19 +19358,15 @@ function completeWork(current, workInProgress, renderLanes) {
1936919358
if (_wasHydrated2) {
1937019359
// TODO: Move this and createInstance step into the beginPhase
1937119360
// to consolidate.
19372-
if (prepareToHydrateHostInstance()) {
19373-
// If changes to the hydrated node need to be applied at the
19374-
// commit-phase we mark this as such.
19375-
markUpdate(workInProgress);
19376-
}
19361+
prepareToHydrateHostInstance();
1937719362
} else {
1937819363
var _rootContainerInstance = getRootHostContainer();
1937919364

1938019365
var _instance3 = createInstance(
1938119366
_type2,
1938219367
newProps,
1938319368
_rootContainerInstance,
19384-
_currentHostContext2,
19369+
_currentHostContext,
1938519370
workInProgress
1938619371
);
1938719372

@@ -19424,7 +19409,7 @@ function completeWork(current, workInProgress, renderLanes) {
1942419409

1942519410
var _rootContainerInstance2 = getRootHostContainer();
1942619411

19427-
var _currentHostContext3 = getHostContext();
19412+
var _currentHostContext2 = getHostContext();
1942819413

1942919414
var _wasHydrated3 = popHydrationState();
1943019415

@@ -19436,7 +19421,7 @@ function completeWork(current, workInProgress, renderLanes) {
1943619421
workInProgress.stateNode = createTextInstance(
1943719422
newText,
1943819423
_rootContainerInstance2,
19439-
_currentHostContext3,
19424+
_currentHostContext2,
1944019425
workInProgress
1944119426
);
1944219427
}
@@ -27037,7 +27022,7 @@ function createFiberRoot(
2703727022
return root;
2703827023
}
2703927024

27040-
var ReactVersion = "18.3.0-canary-f73f8a34";
27025+
var ReactVersion = "18.3.0-canary-b65b3ea2";
2704127026

2704227027
function createPortal$1(
2704327028
children,

0 commit comments

Comments
 (0)