Commit 08375e6
committed
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.1 parent 6b19def commit 08375e6
File tree
14 files changed
+109
-73
lines changed- compiled-rn/facebook-fbsource/xplat/js
- RKJSModules/vendor
- react-test-renderer/cjs
- react/cjs
- react-native-github/Libraries/Renderer
- implementations
- shims
14 files changed
+109
-73
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23882 | 23882 | | |
23883 | 23883 | | |
23884 | 23884 | | |
23885 | | - | |
| 23885 | + | |
23886 | 23886 | | |
23887 | 23887 | | |
23888 | 23888 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8683 | 8683 | | |
8684 | 8684 | | |
8685 | 8685 | | |
8686 | | - | |
| 8686 | + | |
8687 | 8687 | | |
8688 | 8688 | | |
8689 | 8689 | | |
| |||
8714 | 8714 | | |
8715 | 8715 | | |
8716 | 8716 | | |
8717 | | - | |
| 8717 | + | |
8718 | 8718 | | |
8719 | 8719 | | |
8720 | 8720 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9108 | 9108 | | |
9109 | 9109 | | |
9110 | 9110 | | |
9111 | | - | |
| 9111 | + | |
9112 | 9112 | | |
9113 | 9113 | | |
9114 | 9114 | | |
| |||
9139 | 9139 | | |
9140 | 9140 | | |
9141 | 9141 | | |
9142 | | - | |
| 9142 | + | |
9143 | 9143 | | |
9144 | 9144 | | |
9145 | 9145 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
639 | 639 | | |
640 | 640 | | |
641 | 641 | | |
642 | | - | |
| 642 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
642 | 642 | | |
643 | 643 | | |
644 | 644 | | |
645 | | - | |
| 645 | + | |
646 | 646 | | |
647 | 647 | | |
648 | 648 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4985 | 4985 | | |
4986 | 4986 | | |
4987 | 4987 | | |
| 4988 | + | |
| 4989 | + | |
| 4990 | + | |
| 4991 | + | |
| 4992 | + | |
| 4993 | + | |
| 4994 | + | |
| 4995 | + | |
| 4996 | + | |
| 4997 | + | |
| 4998 | + | |
| 4999 | + | |
4988 | 5000 | | |
| 5001 | + | |
| 5002 | + | |
| 5003 | + | |
| 5004 | + | |
| 5005 | + | |
4989 | 5006 | | |
4990 | 5007 | | |
4991 | 5008 | | |
| |||
27158 | 27175 | | |
27159 | 27176 | | |
27160 | 27177 | | |
27161 | | - | |
| 27178 | + | |
27162 | 27179 | | |
27163 | 27180 | | |
27164 | 27181 | | |
| |||
Lines changed: 41 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
940 | 940 | | |
941 | 941 | | |
942 | 942 | | |
943 | | - | |
| 943 | + | |
944 | 944 | | |
945 | 945 | | |
946 | 946 | | |
| |||
986 | 986 | | |
987 | 987 | | |
988 | 988 | | |
989 | | - | |
990 | | - | |
991 | | - | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
992 | 992 | | |
993 | | - | |
994 | | - | |
| 993 | + | |
| 994 | + | |
995 | 995 | | |
996 | 996 | | |
997 | | - | |
998 | | - | |
| 997 | + | |
| 998 | + | |
999 | 999 | | |
1000 | | - | |
1001 | | - | |
1002 | | - | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
1003 | 1003 | | |
1004 | | - | |
| 1004 | + | |
1005 | 1005 | | |
1006 | 1006 | | |
1007 | | - | |
| 1007 | + | |
1008 | 1008 | | |
1009 | | - | |
1010 | | - | |
1011 | | - | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
1012 | 1012 | | |
1013 | 1013 | | |
1014 | | - | |
| 1014 | + | |
1015 | 1015 | | |
1016 | 1016 | | |
1017 | 1017 | | |
| |||
9551 | 9551 | | |
9552 | 9552 | | |
9553 | 9553 | | |
9554 | | - | |
| 9554 | + | |
9555 | 9555 | | |
9556 | 9556 | | |
9557 | | - | |
| 9557 | + | |
9558 | 9558 | | |
9559 | 9559 | | |
9560 | 9560 | | |
| |||
9569 | 9569 | | |
9570 | 9570 | | |
9571 | 9571 | | |
9572 | | - | |
9573 | | - | |
9574 | | - | |
9575 | | - | |
9576 | | - | |
| 9572 | + | |
| 9573 | + | |
| 9574 | + | |
| 9575 | + | |
| 9576 | + | |
9577 | 9577 | | |
9578 | 9578 | | |
9579 | 9579 | | |
| |||
9589 | 9589 | | |
9590 | 9590 | | |
9591 | 9591 | | |
9592 | | - | |
| 9592 | + | |
9593 | 9593 | | |
9594 | 9594 | | |
9595 | 9595 | | |
9596 | 9596 | | |
9597 | 9597 | | |
9598 | 9598 | | |
9599 | | - | |
| 9599 | + | |
9600 | 9600 | | |
9601 | 9601 | | |
9602 | | - | |
| 9602 | + | |
9603 | 9603 | | |
9604 | | - | |
9605 | | - | |
| 9604 | + | |
| 9605 | + | |
9606 | 9606 | | |
9607 | 9607 | | |
9608 | | - | |
9609 | | - | |
| 9608 | + | |
| 9609 | + | |
9610 | 9610 | | |
9611 | | - | |
| 9611 | + | |
9612 | 9612 | | |
9613 | 9613 | | |
9614 | 9614 | | |
| |||
9687 | 9687 | | |
9688 | 9688 | | |
9689 | 9689 | | |
| 9690 | + | |
| 9691 | + | |
| 9692 | + | |
| 9693 | + | |
| 9694 | + | |
| 9695 | + | |
| 9696 | + | |
| 9697 | + | |
| 9698 | + | |
9690 | 9699 | | |
9691 | 9700 | | |
9692 | 9701 | | |
| |||
Lines changed: 34 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
951 | 951 | | |
952 | 952 | | |
953 | 953 | | |
954 | | - | |
| 954 | + | |
955 | 955 | | |
956 | 956 | | |
957 | 957 | | |
| |||
997 | 997 | | |
998 | 998 | | |
999 | 999 | | |
1000 | | - | |
1001 | | - | |
1002 | | - | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
1003 | 1003 | | |
1004 | | - | |
1005 | | - | |
| 1004 | + | |
| 1005 | + | |
1006 | 1006 | | |
1007 | 1007 | | |
1008 | | - | |
1009 | | - | |
| 1008 | + | |
| 1009 | + | |
1010 | 1010 | | |
1011 | | - | |
1012 | | - | |
1013 | | - | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
1014 | 1014 | | |
1015 | | - | |
| 1015 | + | |
1016 | 1016 | | |
1017 | 1017 | | |
1018 | | - | |
| 1018 | + | |
1019 | 1019 | | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
1023 | 1023 | | |
1024 | 1024 | | |
1025 | | - | |
| 1025 | + | |
1026 | 1026 | | |
1027 | 1027 | | |
1028 | 1028 | | |
| |||
10259 | 10259 | | |
10260 | 10260 | | |
10261 | 10261 | | |
10262 | | - | |
| 10262 | + | |
10263 | 10263 | | |
10264 | 10264 | | |
10265 | | - | |
| 10265 | + | |
10266 | 10266 | | |
10267 | 10267 | | |
10268 | 10268 | | |
| |||
10291 | 10291 | | |
10292 | 10292 | | |
10293 | 10293 | | |
10294 | | - | |
10295 | | - | |
10296 | | - | |
10297 | | - | |
| 10294 | + | |
| 10295 | + | |
| 10296 | + | |
| 10297 | + | |
10298 | 10298 | | |
10299 | 10299 | | |
10300 | 10300 | | |
| |||
10310 | 10310 | | |
10311 | 10311 | | |
10312 | 10312 | | |
10313 | | - | |
| 10313 | + | |
10314 | 10314 | | |
10315 | 10315 | | |
10316 | 10316 | | |
10317 | 10317 | | |
10318 | 10318 | | |
10319 | 10319 | | |
10320 | | - | |
| 10320 | + | |
10321 | 10321 | | |
10322 | 10322 | | |
10323 | 10323 | | |
| |||
10395 | 10395 | | |
10396 | 10396 | | |
10397 | 10397 | | |
| 10398 | + | |
| 10399 | + | |
| 10400 | + | |
| 10401 | + | |
| 10402 | + | |
| 10403 | + | |
| 10404 | + | |
| 10405 | + | |
| 10406 | + | |
10398 | 10407 | | |
10399 | 10408 | | |
10400 | 10409 | | |
| |||
0 commit comments