Skip to content

Commit

Permalink
Refactor ReactDOMComponent to use flatter property operations (#26433)
Browse files Browse the repository at this point in the history
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 [520f7f3](520f7f3)
  • Loading branch information
sebmarkbage committed Mar 21, 2023
1 parent c596d33 commit c226b42
Show file tree
Hide file tree
Showing 25 changed files with 9,510 additions and 7,577 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0131d0cff40d4054ac72c857d3a13c5173c46e0a
520f7f3ed4d01e9e50a73d7d04ff138e3c71ac86
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (
}
"use strict";

var ReactVersion = "18.3.0-www-modern-1ad200fa";
var ReactVersion = "18.3.0-www-modern-04bef010";

// ATTENTION
// When adding new symbols to this file,
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
return self;
}

var ReactVersion = "18.3.0-www-classic-ca4ffb9c";
var ReactVersion = "18.3.0-www-classic-5ff0222e";

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactART-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -9610,7 +9610,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "18.3.0-www-modern-52358352",
version: "18.3.0-www-modern-4e328d6f",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1313 = {
Expand Down Expand Up @@ -9641,7 +9641,7 @@ var internals$jscomp$inline_1313 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-modern-52358352"
reconcilerVersion: "18.3.0-www-modern-4e328d6f"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1314 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Loading

0 comments on commit c226b42

Please sign in to comment.