Skip to content

Commit 238a514

Browse files
committed
[Fiber][Float] Error when a host fiber changes "flavor" (#29693)
Host Components can exist as four semantic types 1. regular Components (Vanilla obv) 2. singleton Components 2. hoistable components 3. resources Each of these component types have their own rules related to mounting and reconciliation however they are not direclty modeled as their own unique fiber type. This is partly for code size but also because reconciling the inner type of these components would be in a very hot path in fiber creation and reconciliation and it's just not practical to do this logic check here. Right now we have three Fiber types used to implement these 4 concepts but we probably need to reconsider the model and think of Host Components as a single fiber type with an inner implementation. Once we do this we can regularize things like transitioning between a resource and a regular component or a singleton and a hoistable instance. The cases where these transitions happen today aren't particularly common but they can be observed and currently the handling of these transitions is incomplete at best and buggy at worst. The most egregious case is the link type. This can be a regular component (stylesheet without precedence) a hoistable component (non stylesheet link tags) or a resource (stylesheet with a precedence) and if you have a single jsx slot that tries to reconcile transitions between these types it just doesn't work well. This commit adds an error for when a Hoistable goes from Instance to Resource. Currently this is only possible for `<link>` elements going to and from stylesheets with precedence. Hopefully we'll be able to remove this error and implement as an inner type before we encounter new categories for the Hoistable types detecting type shifting to and from regular components is harder to do efficiently because we don't want to reevaluate the type on every update for host components which is currently not required and would add overhead to a very hot path singletons can't really type shift in their one practical implementation (DOM) so they are only a problem in theroy not practice DiffTrain build for commit 47d0c30.
1 parent e922ffd commit 238a514

File tree

14 files changed

+36
-36
lines changed

14 files changed

+36
-36
lines changed

compiled-rn/VERSION_NATIVE_FB

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19.0.0-native-fb-b421783110-20240603
1+
19.0.0-native-fb-47d0c30246-20240603

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<b45274e97595dac7f4c14793880d9b09>>
10+
* @generated SignedSource<<dc9d00bee402968ccc0a0acd5781f81d>>
1111
*/
1212

1313
'use strict';
@@ -23495,7 +23495,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
2349523495
return root;
2349623496
}
2349723497

23498-
var ReactVersion = '19.0.0-rc-b421783110-20240603';
23498+
var ReactVersion = '19.0.0-rc-47d0c30246-20240603';
2349923499

2350023500
/*
2350123501
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<ba28f586b3622268b617dcac2950945f>>
10+
* @generated SignedSource<<af43a225a031fa209bbb69603d7f0492>>
1111
*/
1212

1313
"use strict";
@@ -9303,7 +9303,7 @@ var devToolsConfig$jscomp$inline_1047 = {
93039303
throw Error("TestRenderer does not support findFiberByHostInstance()");
93049304
},
93059305
bundleType: 0,
9306-
version: "19.0.0-rc-b421783110-20240603",
9306+
version: "19.0.0-rc-47d0c30246-20240603",
93079307
rendererPackageName: "react-test-renderer"
93089308
};
93099309
var internals$jscomp$inline_1234 = {
@@ -9334,7 +9334,7 @@ var internals$jscomp$inline_1234 = {
93349334
scheduleRoot: null,
93359335
setRefreshHandler: null,
93369336
getCurrentFiber: null,
9337-
reconcilerVersion: "19.0.0-rc-b421783110-20240603"
9337+
reconcilerVersion: "19.0.0-rc-47d0c30246-20240603"
93389338
};
93399339
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
93409340
var hook$jscomp$inline_1235 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<fcfdf0fd3bb0d87b566f5ac914885035>>
10+
* @generated SignedSource<<2890516f938b1f45917879322f9fd9a1>>
1111
*/
1212

1313
"use strict";
@@ -9925,7 +9925,7 @@ var devToolsConfig$jscomp$inline_1130 = {
99259925
throw Error("TestRenderer does not support findFiberByHostInstance()");
99269926
},
99279927
bundleType: 0,
9928-
version: "19.0.0-rc-b421783110-20240603",
9928+
version: "19.0.0-rc-47d0c30246-20240603",
99299929
rendererPackageName: "react-test-renderer"
99309930
};
99319931
(function (internals) {
@@ -9969,7 +9969,7 @@ var devToolsConfig$jscomp$inline_1130 = {
99699969
scheduleRoot: null,
99709970
setRefreshHandler: null,
99719971
getCurrentFiber: null,
9972-
reconcilerVersion: "19.0.0-rc-b421783110-20240603"
9972+
reconcilerVersion: "19.0.0-rc-47d0c30246-20240603"
99739973
});
99749974
exports._Scheduler = Scheduler;
99759975
exports.act = act;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<2e9ce1aabbcfca7c236e440ef1679dd1>>
10+
* @generated SignedSource<<076290f56a473a70b6e905d32de50aa8>>
1111
*/
1212

1313
'use strict';
@@ -24,7 +24,7 @@ if (
2424
}
2525
var dynamicFlagsUntyped = require('ReactNativeInternalFeatureFlags');
2626

27-
var ReactVersion = '19.0.0-rc-b421783110-20240603';
27+
var ReactVersion = '19.0.0-rc-47d0c30246-20240603';
2828

2929
// Re-export dynamic flags from the internal module.
3030
var dynamicFlags = dynamicFlagsUntyped; // We destructure each value before re-exporting to avoid a dynamic look-up on

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<5293bfb509c1169d297f6a33870c6d31>>
10+
* @generated SignedSource<<4106d35426d57abeb4d553dcd3c58f4d>>
1111
*/
1212

1313
"use strict";
@@ -604,4 +604,4 @@ exports.useSyncExternalStore = function (
604604
exports.useTransition = function () {
605605
return ReactSharedInternals.H.useTransition();
606606
};
607-
exports.version = "19.0.0-rc-b421783110-20240603";
607+
exports.version = "19.0.0-rc-47d0c30246-20240603";

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<59c50de1dd68b85859de8b011ed3d0dd>>
10+
* @generated SignedSource<<10e3da7162afcaf687c3691f03a4187c>>
1111
*/
1212

1313
"use strict";
@@ -608,7 +608,7 @@ exports.useSyncExternalStore = function (
608608
exports.useTransition = function () {
609609
return ReactSharedInternals.H.useTransition();
610610
};
611-
exports.version = "19.0.0-rc-b421783110-20240603";
611+
exports.version = "19.0.0-rc-47d0c30246-20240603";
612612
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
613613
"function" ===
614614
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b421783110fb20f139adf4c4f9a8911dc63f9c68
1+
47d0c30246134ad9ce04abdcf0977cf2d49d00ce

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<34be8f9a47da0534cfed1677769c8104>>
10+
* @generated SignedSource<<225a0ebde437fc1a50803c91bae99aba>>
1111
*/
1212

1313
'use strict';
@@ -26230,7 +26230,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
2623026230
return root;
2623126231
}
2623226232

26233-
var ReactVersion = '19.0.0-rc-b421783110-20240603';
26233+
var ReactVersion = '19.0.0-rc-47d0c30246-20240603';
2623426234

2623526235
/*
2623626236
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<f6ea9fb571ebb00c09e45410376d61a5>>
10+
* @generated SignedSource<<29426e54a93d4771ac8de2c90de45942>>
1111
*/
1212

1313
"use strict";
@@ -10556,7 +10556,7 @@ var roots = new Map(),
1055610556
devToolsConfig$jscomp$inline_1124 = {
1055710557
findFiberByHostInstance: getInstanceFromNode,
1055810558
bundleType: 0,
10559-
version: "19.0.0-rc-b421783110-20240603",
10559+
version: "19.0.0-rc-47d0c30246-20240603",
1056010560
rendererPackageName: "react-native-renderer",
1056110561
rendererConfig: {
1056210562
getInspectorDataForInstance: getInspectorDataForInstance,
@@ -10599,7 +10599,7 @@ var internals$jscomp$inline_1350 = {
1059910599
scheduleRoot: null,
1060010600
setRefreshHandler: null,
1060110601
getCurrentFiber: null,
10602-
reconcilerVersion: "19.0.0-rc-b421783110-20240603"
10602+
reconcilerVersion: "19.0.0-rc-47d0c30246-20240603"
1060310603
};
1060410604
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1060510605
var hook$jscomp$inline_1351 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

0 commit comments

Comments
 (0)