Skip to content

Commit 6b841fa

Browse files
committed
Refactor DOMProperty and CSSProperty (#26513)
This is a step towards getting rid of the meta programming in DOMProperty and CSSProperty. This moves isAttributeNameSafe and isUnitlessNumber to a separate shared modules. isUnitlessNumber is now a single switch instead of meta-programming. There is a slight behavior change here in that I hard code a specific set of vendor-prefixed attributes instead of prefixing all the unitless properties. I based this list on what getComputedStyle returns in current browsers. I removed Opera prefixes because they were [removed in Opera](https://dev.opera.com/blog/css-vendor-prefixes-in-opera-12-50-snapshots/) itself. I included the ms ones mentioned [in the original PR](5abcce5). These shouldn't really be used anymore anyway so should be pretty safe. Worst case, they'll fallback to the other property if you specify both. Finally I inline the mustUseProperty special cases - which are also the only thing that uses propertyName. These are really all controlled components and all booleans. I'm making a small breaking change here by treating `checked` and `selected` specially only on the `input` and `option` tags instead of all tags. That's because those are the only DOM nodes that actually have those properties but we used to set them as expandos instead of attributes before. That's why one of the tests is updated to now use `input` instead of testing an expando on a `div` which isn't a real use case. Interestingly this also uncovered that we update checked twice for some reason but keeping that logic for now. Ideally `multiple` and `muted` should move into `select` and `audio`/`video` respectively for the same reason. No change to the attribute-behavior fixture. DiffTrain build for commit 73deff0.
1 parent fea9a7d commit 6b841fa

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -23755,7 +23755,7 @@ function createFiberRoot(
2375523755
return root;
2375623756
}
2375723757

23758-
var ReactVersion = "18.3.0-next-2d51251e6-20230330";
23758+
var ReactVersion = "18.3.0-next-73deff0d5-20230330";
2375923759

2376023760
// Might add PROFILE later.
2376123761

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -8640,7 +8640,7 @@ var devToolsConfig$jscomp$inline_1007 = {
86408640
throw Error("TestRenderer does not support findFiberByHostInstance()");
86418641
},
86428642
bundleType: 0,
8643-
version: "18.3.0-next-2d51251e6-20230330",
8643+
version: "18.3.0-next-73deff0d5-20230330",
86448644
rendererPackageName: "react-test-renderer"
86458645
};
86468646
var internals$jscomp$inline_1198 = {
@@ -8671,7 +8671,7 @@ var internals$jscomp$inline_1198 = {
86718671
scheduleRoot: null,
86728672
setRefreshHandler: null,
86738673
getCurrentFiber: null,
8674-
reconcilerVersion: "18.3.0-next-2d51251e6-20230330"
8674+
reconcilerVersion: "18.3.0-next-73deff0d5-20230330"
86758675
};
86768676
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
86778677
var hook$jscomp$inline_1199 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -9065,7 +9065,7 @@ var devToolsConfig$jscomp$inline_1050 = {
90659065
throw Error("TestRenderer does not support findFiberByHostInstance()");
90669066
},
90679067
bundleType: 0,
9068-
version: "18.3.0-next-2d51251e6-20230330",
9068+
version: "18.3.0-next-73deff0d5-20230330",
90699069
rendererPackageName: "react-test-renderer"
90709070
};
90719071
var internals$jscomp$inline_1239 = {
@@ -9096,7 +9096,7 @@ var internals$jscomp$inline_1239 = {
90969096
scheduleRoot: null,
90979097
setRefreshHandler: null,
90989098
getCurrentFiber: null,
9099-
reconcilerVersion: "18.3.0-next-2d51251e6-20230330"
9099+
reconcilerVersion: "18.3.0-next-73deff0d5-20230330"
91009100
};
91019101
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
91029102
var hook$jscomp$inline_1240 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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

+1-1
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-2d51251e6-20230330";
30+
var ReactVersion = "18.3.0-next-73deff0d5-20230330";
3131

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

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

+1-1
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-2d51251e6-20230330";
642+
exports.version = "18.3.0-next-73deff0d5-20230330";

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

+1-1
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-2d51251e6-20230330";
645+
exports.version = "18.3.0-next-73deff0d5-20230330";
646646

647647
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
648648
if (
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2d51251e608b7b1a8baf79ae6bdba81ed8e1939a
1+
73deff0d5162160c0aafa5cd0b87e11143fe9938

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -27021,7 +27021,7 @@ function createFiberRoot(
2702127021
return root;
2702227022
}
2702327023

27024-
var ReactVersion = "18.3.0-next-2d51251e6-20230330";
27024+
var ReactVersion = "18.3.0-next-73deff0d5-20230330";
2702527025

2702627026
function createPortal$1(
2702727027
children,

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -9507,7 +9507,7 @@ var roots = new Map(),
95079507
devToolsConfig$jscomp$inline_1027 = {
95089508
findFiberByHostInstance: getInstanceFromNode,
95099509
bundleType: 0,
9510-
version: "18.3.0-next-2d51251e6-20230330",
9510+
version: "18.3.0-next-73deff0d5-20230330",
95119511
rendererPackageName: "react-native-renderer",
95129512
rendererConfig: {
95139513
getInspectorDataForViewTag: function () {
@@ -9549,7 +9549,7 @@ var internals$jscomp$inline_1273 = {
95499549
scheduleRoot: null,
95509550
setRefreshHandler: null,
95519551
getCurrentFiber: null,
9552-
reconcilerVersion: "18.3.0-next-2d51251e6-20230330"
9552+
reconcilerVersion: "18.3.0-next-73deff0d5-20230330"
95539553
};
95549554
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
95559555
var hook$jscomp$inline_1274 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -10215,7 +10215,7 @@ var roots = new Map(),
1021510215
devToolsConfig$jscomp$inline_1106 = {
1021610216
findFiberByHostInstance: getInstanceFromNode,
1021710217
bundleType: 0,
10218-
version: "18.3.0-next-2d51251e6-20230330",
10218+
version: "18.3.0-next-73deff0d5-20230330",
1021910219
rendererPackageName: "react-native-renderer",
1022010220
rendererConfig: {
1022110221
getInspectorDataForViewTag: function () {
@@ -10270,7 +10270,7 @@ var roots = new Map(),
1027010270
scheduleRoot: null,
1027110271
setRefreshHandler: null,
1027210272
getCurrentFiber: null,
10273-
reconcilerVersion: "18.3.0-next-2d51251e6-20230330"
10273+
reconcilerVersion: "18.3.0-next-73deff0d5-20230330"
1027410274
});
1027510275
exports.createPortal = function (children, containerTag) {
1027610276
return createPortal$1(

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -27561,7 +27561,7 @@ function createFiberRoot(
2756127561
return root;
2756227562
}
2756327563

27564-
var ReactVersion = "18.3.0-next-2d51251e6-20230330";
27564+
var ReactVersion = "18.3.0-next-73deff0d5-20230330";
2756527565

2756627566
function createPortal$1(
2756727567
children,

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -9763,7 +9763,7 @@ var roots = new Map(),
97639763
devToolsConfig$jscomp$inline_1086 = {
97649764
findFiberByHostInstance: getInstanceFromTag,
97659765
bundleType: 0,
9766-
version: "18.3.0-next-2d51251e6-20230330",
9766+
version: "18.3.0-next-73deff0d5-20230330",
97679767
rendererPackageName: "react-native-renderer",
97689768
rendererConfig: {
97699769
getInspectorDataForViewTag: function () {
@@ -9805,7 +9805,7 @@ var internals$jscomp$inline_1339 = {
98059805
scheduleRoot: null,
98069806
setRefreshHandler: null,
98079807
getCurrentFiber: null,
9808-
reconcilerVersion: "18.3.0-next-2d51251e6-20230330"
9808+
reconcilerVersion: "18.3.0-next-73deff0d5-20230330"
98099809
};
98109810
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
98119811
var hook$jscomp$inline_1340 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -10471,7 +10471,7 @@ var roots = new Map(),
1047110471
devToolsConfig$jscomp$inline_1165 = {
1047210472
findFiberByHostInstance: getInstanceFromTag,
1047310473
bundleType: 0,
10474-
version: "18.3.0-next-2d51251e6-20230330",
10474+
version: "18.3.0-next-73deff0d5-20230330",
1047510475
rendererPackageName: "react-native-renderer",
1047610476
rendererConfig: {
1047710477
getInspectorDataForViewTag: function () {
@@ -10526,7 +10526,7 @@ var roots = new Map(),
1052610526
scheduleRoot: null,
1052710527
setRefreshHandler: null,
1052810528
getCurrentFiber: null,
10529-
reconcilerVersion: "18.3.0-next-2d51251e6-20230330"
10529+
reconcilerVersion: "18.3.0-next-73deff0d5-20230330"
1053010530
});
1053110531
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
1053210532
computeComponentStackForErrorReporting: function (reactTag) {

0 commit comments

Comments
 (0)