Skip to content

Commit 7d0009a

Browse files
committed
Refactor ReactDOMComponent to use flatter property operations (#26433)
This is in line with the refactor I already did on Fizz earlier and brings Fiber up to a similar structure. We end up with a lot of extra checks due the extra abstractions we use to check the various properties. This uses a flatter and more inline model which makes it easier to see what each property does. The tradeoff is that a change might need changes in more places. The general structure is that there's a switch for tag first, then a switch for each attribute special case, then a switch for the value. So it's easy to follow where each scenario will end up and there shouldn't be any unnecessary code executed along the way. My goal is to eventually get rid of the meta-programming in DOMProperty and CSSProperty but I'm leaving that in for now - in line with Fizz. My next step is moving around things a bit in the diff/commit phases. This is the first step to more refactors for perf and size, but also because I'm adding more special cases so I need to have a flatter structure that I can reason about for those special cases. DiffTrain build for commit 520f7f3.
1 parent 86e74c8 commit 7d0009a

File tree

12 files changed

+18
-18
lines changed

12 files changed

+18
-18
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
@@ -23588,7 +23588,7 @@ function createFiberRoot(
2358823588
return root;
2358923589
}
2359023590

23591-
var ReactVersion = "18.3.0-next-0131d0cff-20230320";
23591+
var ReactVersion = "18.3.0-next-520f7f3ed-20230320";
2359223592

2359323593
// Might add PROFILE later.
2359423594

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
@@ -8561,7 +8561,7 @@ var devToolsConfig$jscomp$inline_1013 = {
85618561
throw Error("TestRenderer does not support findFiberByHostInstance()");
85628562
},
85638563
bundleType: 0,
8564-
version: "18.3.0-next-0131d0cff-20230320",
8564+
version: "18.3.0-next-520f7f3ed-20230320",
85658565
rendererPackageName: "react-test-renderer"
85668566
};
85678567
var internals$jscomp$inline_1201 = {
@@ -8592,7 +8592,7 @@ var internals$jscomp$inline_1201 = {
85928592
scheduleRoot: null,
85938593
setRefreshHandler: null,
85948594
getCurrentFiber: null,
8595-
reconcilerVersion: "18.3.0-next-0131d0cff-20230320"
8595+
reconcilerVersion: "18.3.0-next-520f7f3ed-20230320"
85968596
};
85978597
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
85988598
var hook$jscomp$inline_1202 = __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
@@ -8988,7 +8988,7 @@ var devToolsConfig$jscomp$inline_1054 = {
89888988
throw Error("TestRenderer does not support findFiberByHostInstance()");
89898989
},
89908990
bundleType: 0,
8991-
version: "18.3.0-next-0131d0cff-20230320",
8991+
version: "18.3.0-next-520f7f3ed-20230320",
89928992
rendererPackageName: "react-test-renderer"
89938993
};
89948994
var internals$jscomp$inline_1240 = {
@@ -9019,7 +9019,7 @@ var internals$jscomp$inline_1240 = {
90199019
scheduleRoot: null,
90209020
setRefreshHandler: null,
90219021
getCurrentFiber: null,
9022-
reconcilerVersion: "18.3.0-next-0131d0cff-20230320"
9022+
reconcilerVersion: "18.3.0-next-520f7f3ed-20230320"
90239023
};
90249024
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
90259025
var hook$jscomp$inline_1241 = __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-0131d0cff-20230320";
30+
var ReactVersion = "18.3.0-next-520f7f3ed-20230320";
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-0131d0cff-20230320";
642+
exports.version = "18.3.0-next-520f7f3ed-20230320";

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-0131d0cff-20230320";
645+
exports.version = "18.3.0-next-520f7f3ed-20230320";
646646

647647
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
648648
if (

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
@@ -26342,7 +26342,7 @@ function createFiberRoot(
2634226342
return root;
2634326343
}
2634426344

26345-
var ReactVersion = "18.3.0-next-0131d0cff-20230320";
26345+
var ReactVersion = "18.3.0-next-520f7f3ed-20230320";
2634626346

2634726347
function createPortal$1(
2634826348
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
@@ -9496,7 +9496,7 @@ var roots = new Map(),
94969496
devToolsConfig$jscomp$inline_1033 = {
94979497
findFiberByHostInstance: getInstanceFromNode,
94989498
bundleType: 0,
9499-
version: "18.3.0-next-0131d0cff-20230320",
9499+
version: "18.3.0-next-520f7f3ed-20230320",
95009500
rendererPackageName: "react-native-renderer",
95019501
rendererConfig: {
95029502
getInspectorDataForViewTag: function () {
@@ -9538,7 +9538,7 @@ var internals$jscomp$inline_1276 = {
95389538
scheduleRoot: null,
95399539
setRefreshHandler: null,
95409540
getCurrentFiber: null,
9541-
reconcilerVersion: "18.3.0-next-0131d0cff-20230320"
9541+
reconcilerVersion: "18.3.0-next-520f7f3ed-20230320"
95429542
};
95439543
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
95449544
var hook$jscomp$inline_1277 = __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
@@ -10206,7 +10206,7 @@ var roots = new Map(),
1020610206
devToolsConfig$jscomp$inline_1110 = {
1020710207
findFiberByHostInstance: getInstanceFromNode,
1020810208
bundleType: 0,
10209-
version: "18.3.0-next-0131d0cff-20230320",
10209+
version: "18.3.0-next-520f7f3ed-20230320",
1021010210
rendererPackageName: "react-native-renderer",
1021110211
rendererConfig: {
1021210212
getInspectorDataForViewTag: function () {
@@ -10261,7 +10261,7 @@ var roots = new Map(),
1026110261
scheduleRoot: null,
1026210262
setRefreshHandler: null,
1026310263
getCurrentFiber: null,
10264-
reconcilerVersion: "18.3.0-next-0131d0cff-20230320"
10264+
reconcilerVersion: "18.3.0-next-520f7f3ed-20230320"
1026510265
});
1026610266
exports.createPortal = function (children, containerTag) {
1026710267
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
@@ -27393,7 +27393,7 @@ function createFiberRoot(
2739327393
return root;
2739427394
}
2739527395

27396-
var ReactVersion = "18.3.0-next-0131d0cff-20230320";
27396+
var ReactVersion = "18.3.0-next-520f7f3ed-20230320";
2739727397

2739827398
function createPortal$1(
2739927399
children,

0 commit comments

Comments
 (0)