You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement public instances for text nodes in Fabric (#26516)
## Summary
This adds the ability to create public instances for text nodes in
Fabric. The implementation for the public instances lives in React
Native (as it does for host components after #26437). The logic here
just handles their lazy instantiation when requested via
`getPublicInstanceFromInternalInstanceHandle`, which is called by Fabric
with information coming from the shadow tree.
It's important that the creation of public instances for text nodes is
done lazily to avoid regressing memory usage when unused. Instances for
text nodes are left intact if the public instance is never accessed.
This is necessary to implement access to text nodes in React Native as
explained in
react-native-community/discussions-and-proposals#607
## How did you test this change?
Added unit tests (also fixed a test that was only testing the logic in a
mock :S).
DiffTrain build for commit 0700dd5.
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js
+1-1
Original file line number
Diff line number
Diff line change
@@ -23882,7 +23882,7 @@ function createFiberRoot(
23882
23882
return root;
23883
23883
}
23884
23884
23885
-
var ReactVersion = "18.3.0-next-4a1cc2ddd-20230403";
23885
+
var ReactVersion = "18.3.0-next-0700dd50b-20230404";
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js
+2-2
Original file line number
Diff line number
Diff line change
@@ -8683,7 +8683,7 @@ var devToolsConfig$jscomp$inline_1028 = {
8683
8683
throwError("TestRenderer does not support findFiberByHostInstance()");
8684
8684
},
8685
8685
bundleType: 0,
8686
-
version: "18.3.0-next-4a1cc2ddd-20230403",
8686
+
version: "18.3.0-next-0700dd50b-20230404",
8687
8687
rendererPackageName: "react-test-renderer"
8688
8688
};
8689
8689
varinternals$jscomp$inline_1220={
@@ -8714,7 +8714,7 @@ var internals$jscomp$inline_1220 = {
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js
+2-2
Original file line number
Diff line number
Diff line change
@@ -9108,7 +9108,7 @@ var devToolsConfig$jscomp$inline_1070 = {
9108
9108
throwError("TestRenderer does not support findFiberByHostInstance()");
9109
9109
},
9110
9110
bundleType: 0,
9111
-
version: "18.3.0-next-4a1cc2ddd-20230403",
9111
+
version: "18.3.0-next-0700dd50b-20230404",
9112
9112
rendererPackageName: "react-test-renderer"
9113
9113
};
9114
9114
varinternals$jscomp$inline_1261={
@@ -9139,7 +9139,7 @@ var internals$jscomp$inline_1261 = {
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js
+18-1
Original file line number
Diff line number
Diff line change
@@ -4985,7 +4985,24 @@ function getPublicInstance(instance) {
4985
4985
4986
4986
return null;
4987
4987
}
4988
+
4989
+
function getPublicTextInstance(textInstance, internalInstanceHandle) {
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js
+1-1
Original file line number
Diff line number
Diff line change
@@ -27698,7 +27698,7 @@ function createFiberRoot(
27698
27698
return root;
27699
27699
}
27700
27700
27701
-
var ReactVersion = "18.3.0-next-4a1cc2ddd-20230403";
27701
+
var ReactVersion = "18.3.0-next-0700dd50b-20230404";
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js
+2-2
Original file line number
Diff line number
Diff line change
@@ -9810,7 +9810,7 @@ var roots = new Map(),
9810
9810
devToolsConfig$jscomp$inline_1107 = {
9811
9811
findFiberByHostInstance: getInstanceFromTag,
9812
9812
bundleType: 0,
9813
-
version: "18.3.0-next-4a1cc2ddd-20230403",
9813
+
version: "18.3.0-next-0700dd50b-20230404",
9814
9814
rendererPackageName: "react-native-renderer",
9815
9815
rendererConfig: {
9816
9816
getInspectorDataForViewTag: function () {
@@ -9852,7 +9852,7 @@ var internals$jscomp$inline_1359 = {
0 commit comments