Skip to content

Commit 5a26a33

Browse files
committed
Store instance handles in an internal map behind flag (react#35053)
We already append `randomKey` to each handle name to prevent external libraries from accessing and relying on these internals. But more libraries recently have been getting around this by simply iterating over the element properties and using a `startsWith` check. This flag allows us to experiment with moving these handles to an internal map. This PR starts with the two most common internals, the props object and the fiber. We can consider moving additional properties such as the container root and others depending on perf results. DiffTrain build for [a44e750](react@a44e750)
1 parent 4abf7a2 commit 5a26a33

37 files changed

Lines changed: 1566 additions & 1176 deletions

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5a2205ba28a02596461187eecdffd066075d8685
1+
a44e750e87fd0869cdeda0418e279e19c1ee07dd
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5a2205ba28a02596461187eecdffd066075d8685
1+
a44e750e87fd0869cdeda0418e279e19c1ee07dd

compiled/facebook-www/React-dev.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,7 @@ __DEV__ &&
14991499
exports.useTransition = function () {
15001500
return resolveDispatcher().useTransition();
15011501
};
1502-
exports.version = "19.3.0-www-classic-5a2205ba-20251105";
1502+
exports.version = "19.3.0-www-classic-a44e750e-20251106";
15031503
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15041504
"function" ===
15051505
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,7 @@ __DEV__ &&
14991499
exports.useTransition = function () {
15001500
return resolveDispatcher().useTransition();
15011501
};
1502-
exports.version = "19.3.0-www-modern-5a2205ba-20251105";
1502+
exports.version = "19.3.0-www-modern-a44e750e-20251106";
15031503
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15041504
"function" ===
15051505
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,4 +606,4 @@ exports.useSyncExternalStore = function (
606606
exports.useTransition = function () {
607607
return ReactSharedInternals.H.useTransition();
608608
};
609-
exports.version = "19.3.0-www-classic-5a2205ba-20251105";
609+
exports.version = "19.3.0-www-classic-a44e750e-20251106";

compiled/facebook-www/React-prod.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,4 +606,4 @@ exports.useSyncExternalStore = function (
606606
exports.useTransition = function () {
607607
return ReactSharedInternals.H.useTransition();
608608
};
609-
exports.version = "19.3.0-www-modern-5a2205ba-20251105";
609+
exports.version = "19.3.0-www-modern-a44e750e-20251106";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ exports.useSyncExternalStore = function (
610610
exports.useTransition = function () {
611611
return ReactSharedInternals.H.useTransition();
612612
};
613-
exports.version = "19.3.0-www-classic-5a2205ba-20251105";
613+
exports.version = "19.3.0-www-classic-a44e750e-20251106";
614614
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
615615
"function" ===
616616
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-profiling.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ exports.useSyncExternalStore = function (
610610
exports.useTransition = function () {
611611
return ReactSharedInternals.H.useTransition();
612612
};
613-
exports.version = "19.3.0-www-modern-5a2205ba-20251105";
613+
exports.version = "19.3.0-www-modern-a44e750e-20251106";
614614
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
615615
"function" ===
616616
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.classic.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11685,7 +11685,7 @@ __DEV__ &&
1168511685
function commitAppearingPairViewTransitions(placement) {
1168611686
if (0 !== (placement.subtreeFlags & 18874368))
1168711687
for (placement = placement.child; null !== placement; ) {
11688-
if (22 !== placement.tag || null !== placement.memoizedState)
11688+
if (22 !== placement.tag || null === placement.memoizedState)
1168911689
if (
1169011690
(commitAppearingPairViewTransitions(placement),
1169111691
30 === placement.tag &&
@@ -11747,7 +11747,7 @@ __DEV__ &&
1174711747
var pairs = appearingViewTransitions;
1174811748
if (0 !== (deletion.subtreeFlags & 18874368))
1174911749
for (deletion = deletion.child; null !== deletion; ) {
11750-
if (22 !== deletion.tag || null !== deletion.memoizedState) {
11750+
if (22 !== deletion.tag || null === deletion.memoizedState) {
1175111751
if (30 === deletion.tag && 0 !== (deletion.flags & 18874368)) {
1175211752
var props = deletion.memoizedProps,
1175311753
name = props.name;
@@ -11841,7 +11841,7 @@ __DEV__ &&
1184111841
function restorePairedViewTransitions(parent) {
1184211842
if (0 !== (parent.subtreeFlags & 18874368))
1184311843
for (parent = parent.child; null !== parent; ) {
11844-
if (22 !== parent.tag || null !== parent.memoizedState) {
11844+
if (22 !== parent.tag || null === parent.memoizedState) {
1184511845
if (30 === parent.tag && 0 !== (parent.flags & 18874368)) {
1184611846
var instance = parent.stateNode;
1184711847
null !== instance.paired && (instance.paired = null);
@@ -20441,10 +20441,10 @@ __DEV__ &&
2044120441
(function () {
2044220442
var internals = {
2044320443
bundleType: 1,
20444-
version: "19.3.0-www-classic-5a2205ba-20251105",
20444+
version: "19.3.0-www-classic-a44e750e-20251106",
2044520445
rendererPackageName: "react-art",
2044620446
currentDispatcherRef: ReactSharedInternals,
20447-
reconcilerVersion: "19.3.0-www-classic-5a2205ba-20251105"
20447+
reconcilerVersion: "19.3.0-www-classic-a44e750e-20251106"
2044820448
};
2044920449
internals.overrideHookState = overrideHookState;
2045020450
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -20479,7 +20479,7 @@ __DEV__ &&
2047920479
exports.Shape = Shape;
2048020480
exports.Surface = Surface;
2048120481
exports.Text = Text;
20482-
exports.version = "19.3.0-www-classic-5a2205ba-20251105";
20482+
exports.version = "19.3.0-www-classic-a44e750e-20251106";
2048320483
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2048420484
"function" ===
2048520485
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.modern.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11503,7 +11503,7 @@ __DEV__ &&
1150311503
function commitAppearingPairViewTransitions(placement) {
1150411504
if (0 !== (placement.subtreeFlags & 18874368))
1150511505
for (placement = placement.child; null !== placement; ) {
11506-
if (22 !== placement.tag || null !== placement.memoizedState)
11506+
if (22 !== placement.tag || null === placement.memoizedState)
1150711507
if (
1150811508
(commitAppearingPairViewTransitions(placement),
1150911509
30 === placement.tag &&
@@ -11565,7 +11565,7 @@ __DEV__ &&
1156511565
var pairs = appearingViewTransitions;
1156611566
if (0 !== (deletion.subtreeFlags & 18874368))
1156711567
for (deletion = deletion.child; null !== deletion; ) {
11568-
if (22 !== deletion.tag || null !== deletion.memoizedState) {
11568+
if (22 !== deletion.tag || null === deletion.memoizedState) {
1156911569
if (30 === deletion.tag && 0 !== (deletion.flags & 18874368)) {
1157011570
var props = deletion.memoizedProps,
1157111571
name = props.name;
@@ -11659,7 +11659,7 @@ __DEV__ &&
1165911659
function restorePairedViewTransitions(parent) {
1166011660
if (0 !== (parent.subtreeFlags & 18874368))
1166111661
for (parent = parent.child; null !== parent; ) {
11662-
if (22 !== parent.tag || null !== parent.memoizedState) {
11662+
if (22 !== parent.tag || null === parent.memoizedState) {
1166311663
if (30 === parent.tag && 0 !== (parent.flags & 18874368)) {
1166411664
var instance = parent.stateNode;
1166511665
null !== instance.paired && (instance.paired = null);
@@ -20212,10 +20212,10 @@ __DEV__ &&
2021220212
(function () {
2021320213
var internals = {
2021420214
bundleType: 1,
20215-
version: "19.3.0-www-modern-5a2205ba-20251105",
20215+
version: "19.3.0-www-modern-a44e750e-20251106",
2021620216
rendererPackageName: "react-art",
2021720217
currentDispatcherRef: ReactSharedInternals,
20218-
reconcilerVersion: "19.3.0-www-modern-5a2205ba-20251105"
20218+
reconcilerVersion: "19.3.0-www-modern-a44e750e-20251106"
2021920219
};
2022020220
internals.overrideHookState = overrideHookState;
2022120221
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -20250,7 +20250,7 @@ __DEV__ &&
2025020250
exports.Shape = Shape;
2025120251
exports.Surface = Surface;
2025220252
exports.Text = Text;
20253-
exports.version = "19.3.0-www-modern-5a2205ba-20251105";
20253+
exports.version = "19.3.0-www-modern-a44e750e-20251106";
2025420254
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2025520255
"function" ===
2025620256
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)