Skip to content

Commit 95cf715

Browse files
committed
Use already extracted values instead of reading off props for controlled components (#26596)
Since `props.x` is a possibly megamorphic access, it can be slow to access and trigger recompilation. When we are looping over the props and pattern matching every key, anyway, we've already done this work. We can just reuse the same value by stashing it outside the loop in the stack. This only makes sense for updates in diffInCommitPhase since otherwise we don't have the full set of props in that loop. We also have to be careful not to skip over equal values since we need to extract them anyway. DiffTrain build for commit 6b90976.
1 parent 32f13ee commit 95cf715

File tree

13 files changed

+19
-19
lines changed

13 files changed

+19
-19
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23752,7 +23752,7 @@ function createFiberRoot(
2375223752
return root;
2375323753
}
2375423754

23755-
var ReactVersion = "18.3.0-next-343a45ffa-20230411";
23755+
var ReactVersion = "18.3.0-next-6b90976bc-20230411";
2375623756

2375723757
// Might add PROFILE later.
2375823758

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8610,7 +8610,7 @@ var devToolsConfig$jscomp$inline_1021 = {
86108610
throw Error("TestRenderer does not support findFiberByHostInstance()");
86118611
},
86128612
bundleType: 0,
8613-
version: "18.3.0-next-343a45ffa-20230411",
8613+
version: "18.3.0-next-6b90976bc-20230411",
86148614
rendererPackageName: "react-test-renderer"
86158615
};
86168616
var internals$jscomp$inline_1204 = {
@@ -8641,7 +8641,7 @@ var internals$jscomp$inline_1204 = {
86418641
scheduleRoot: null,
86428642
setRefreshHandler: null,
86438643
getCurrentFiber: null,
8644-
reconcilerVersion: "18.3.0-next-343a45ffa-20230411"
8644+
reconcilerVersion: "18.3.0-next-6b90976bc-20230411"
86458645
};
86468646
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
86478647
var hook$jscomp$inline_1205 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9036,7 +9036,7 @@ var devToolsConfig$jscomp$inline_1063 = {
90369036
throw Error("TestRenderer does not support findFiberByHostInstance()");
90379037
},
90389038
bundleType: 0,
9039-
version: "18.3.0-next-343a45ffa-20230411",
9039+
version: "18.3.0-next-6b90976bc-20230411",
90409040
rendererPackageName: "react-test-renderer"
90419041
};
90429042
var internals$jscomp$inline_1245 = {
@@ -9067,7 +9067,7 @@ var internals$jscomp$inline_1245 = {
90679067
scheduleRoot: null,
90689068
setRefreshHandler: null,
90699069
getCurrentFiber: null,
9070-
reconcilerVersion: "18.3.0-next-343a45ffa-20230411"
9070+
reconcilerVersion: "18.3.0-next-6b90976bc-20230411"
90719071
};
90729072
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
90739073
var hook$jscomp$inline_1246 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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-next-343a45ffa-20230411";
30+
var ReactVersion = "18.3.0-next-6b90976bc-20230411";
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
@@ -639,4 +639,4 @@ exports.useSyncExternalStore = function (
639639
);
640640
};
641641
exports.useTransition = useTransition;
642-
exports.version = "18.3.0-next-343a45ffa-20230411";
642+
exports.version = "18.3.0-next-6b90976bc-20230411";

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
@@ -642,7 +642,7 @@ exports.useSyncExternalStore = function (
642642
);
643643
};
644644
exports.useTransition = useTransition;
645-
exports.version = "18.3.0-next-343a45ffa-20230411";
645+
exports.version = "18.3.0-next-6b90976bc-20230411";
646646

647647
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
648648
if (
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
343a45ffa48065e60699bbe68f82d7b62fa02840
1+
6b90976bc10f325146b193286435a4b5015ef605

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27059,7 +27059,7 @@ function createFiberRoot(
2705927059
return root;
2706027060
}
2706127061

27062-
var ReactVersion = "18.3.0-next-343a45ffa-20230411";
27062+
var ReactVersion = "18.3.0-next-6b90976bc-20230411";
2706327063

2706427064
function createPortal$1(
2706527065
children,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9479,7 +9479,7 @@ var roots = new Map(),
94799479
devToolsConfig$jscomp$inline_1045 = {
94809480
findFiberByHostInstance: getInstanceFromNode,
94819481
bundleType: 0,
9482-
version: "18.3.0-next-343a45ffa-20230411",
9482+
version: "18.3.0-next-6b90976bc-20230411",
94839483
rendererPackageName: "react-native-renderer",
94849484
rendererConfig: {
94859485
getInspectorDataForViewTag: function () {
@@ -9521,7 +9521,7 @@ var internals$jscomp$inline_1274 = {
95219521
scheduleRoot: null,
95229522
setRefreshHandler: null,
95239523
getCurrentFiber: null,
9524-
reconcilerVersion: "18.3.0-next-343a45ffa-20230411"
9524+
reconcilerVersion: "18.3.0-next-6b90976bc-20230411"
95259525
};
95269526
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
95279527
var hook$jscomp$inline_1275 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10188,7 +10188,7 @@ var roots = new Map(),
1018810188
devToolsConfig$jscomp$inline_1123 = {
1018910189
findFiberByHostInstance: getInstanceFromNode,
1019010190
bundleType: 0,
10191-
version: "18.3.0-next-343a45ffa-20230411",
10191+
version: "18.3.0-next-6b90976bc-20230411",
1019210192
rendererPackageName: "react-native-renderer",
1019310193
rendererConfig: {
1019410194
getInspectorDataForViewTag: function () {
@@ -10243,7 +10243,7 @@ var roots = new Map(),
1024310243
scheduleRoot: null,
1024410244
setRefreshHandler: null,
1024510245
getCurrentFiber: null,
10246-
reconcilerVersion: "18.3.0-next-343a45ffa-20230411"
10246+
reconcilerVersion: "18.3.0-next-6b90976bc-20230411"
1024710247
});
1024810248
exports.createPortal = function (children, containerTag) {
1024910249
return createPortal$1(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27572,7 +27572,7 @@ function createFiberRoot(
2757227572
return root;
2757327573
}
2757427574

27575-
var ReactVersion = "18.3.0-next-343a45ffa-20230411";
27575+
var ReactVersion = "18.3.0-next-6b90976bc-20230411";
2757627576

2757727577
function createPortal$1(
2757827578
children,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9738,7 +9738,7 @@ var roots = new Map(),
97389738
devToolsConfig$jscomp$inline_1100 = {
97399739
findFiberByHostInstance: getInstanceFromTag,
97409740
bundleType: 0,
9741-
version: "18.3.0-next-343a45ffa-20230411",
9741+
version: "18.3.0-next-6b90976bc-20230411",
97429742
rendererPackageName: "react-native-renderer",
97439743
rendererConfig: {
97449744
getInspectorDataForViewTag: function () {
@@ -9780,7 +9780,7 @@ var internals$jscomp$inline_1343 = {
97809780
scheduleRoot: null,
97819781
setRefreshHandler: null,
97829782
getCurrentFiber: null,
9783-
reconcilerVersion: "18.3.0-next-343a45ffa-20230411"
9783+
reconcilerVersion: "18.3.0-next-6b90976bc-20230411"
97849784
};
97859785
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
97869786
var hook$jscomp$inline_1344 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10447,7 +10447,7 @@ var roots = new Map(),
1044710447
devToolsConfig$jscomp$inline_1178 = {
1044810448
findFiberByHostInstance: getInstanceFromTag,
1044910449
bundleType: 0,
10450-
version: "18.3.0-next-343a45ffa-20230411",
10450+
version: "18.3.0-next-6b90976bc-20230411",
1045110451
rendererPackageName: "react-native-renderer",
1045210452
rendererConfig: {
1045310453
getInspectorDataForViewTag: function () {
@@ -10502,7 +10502,7 @@ var roots = new Map(),
1050210502
scheduleRoot: null,
1050310503
setRefreshHandler: null,
1050410504
getCurrentFiber: null,
10505-
reconcilerVersion: "18.3.0-next-343a45ffa-20230411"
10505+
reconcilerVersion: "18.3.0-next-6b90976bc-20230411"
1050610506
});
1050710507
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
1050810508
computeComponentStackForErrorReporting: function (reactTag) {

0 commit comments

Comments
 (0)