Commit eee3aa6
committed
Clean interface for public instances between React and React Native (#26416)
## Summary
We are going to move the definition of public instances from React to
React Native to have them together with the native methods in Fabric
that they invoke. This will allow us to have a better type safety
between them and iterate faster on the implementation of this proposal:
react-native-community/discussions-and-proposals#607
The interface between React and React Native would look like this after
this change and a following PR (#26418):
React → React Native:
```javascript
ReactNativePrivateInterface.createPublicInstance // to provide via refs
ReactNativePrivateInterface.getNodeFromPublicInstance // for DevTools, commands, etc.
ReactNativePrivateInterface.getNativeTagFromPublicInstance // to implement `findNodeHandle`
```
React Native → React (ReactFabric):
```javascript
ReactFabric.getNodeFromInternalInstanceHandle // to get most recent node to call into native
ReactFabric.getPublicInstanceFromInternalInstanceHandle // to get public instances from results from native
```
## How did you test this change?
Flow
Existing unit tests
DiffTrain build for commit facebook/react@3554c88.1 parent df61ea1 commit eee3aa6
13 files changed
Lines changed: 180 additions & 163 deletions
File tree
- compiled-rn/facebook-fbsource/xplat/js
- RKJSModules/vendor
- react-test-renderer/cjs
- react/cjs
- react-native-github/Libraries/Renderer
- implementations
- shims
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23499 | 23499 | | |
23500 | 23500 | | |
23501 | 23501 | | |
23502 | | - | |
| 23502 | + | |
23503 | 23503 | | |
23504 | 23504 | | |
23505 | 23505 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8526 | 8526 | | |
8527 | 8527 | | |
8528 | 8528 | | |
8529 | | - | |
| 8529 | + | |
8530 | 8530 | | |
8531 | 8531 | | |
8532 | 8532 | | |
| |||
8557 | 8557 | | |
8558 | 8558 | | |
8559 | 8559 | | |
8560 | | - | |
| 8560 | + | |
8561 | 8561 | | |
8562 | 8562 | | |
8563 | 8563 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8953 | 8953 | | |
8954 | 8954 | | |
8955 | 8955 | | |
8956 | | - | |
| 8956 | + | |
8957 | 8957 | | |
8958 | 8958 | | |
8959 | 8959 | | |
| |||
8984 | 8984 | | |
8985 | 8985 | | |
8986 | 8986 | | |
8987 | | - | |
| 8987 | + | |
8988 | 8988 | | |
8989 | 8989 | | |
8990 | 8990 | | |
| |||
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: 23 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26257 | 26257 | | |
26258 | 26258 | | |
26259 | 26259 | | |
26260 | | - | |
| 26260 | + | |
26261 | 26261 | | |
26262 | 26262 | | |
26263 | 26263 | | |
| |||
26792 | 26792 | | |
26793 | 26793 | | |
26794 | 26794 | | |
| 26795 | + | |
26795 | 26796 | | |
26796 | 26797 | | |
26797 | 26798 | | |
26798 | | - | |
26799 | | - | |
| 26799 | + | |
| 26800 | + | |
| 26801 | + | |
| 26802 | + | |
| 26803 | + | |
| 26804 | + | |
| 26805 | + | |
| 26806 | + | |
26800 | 26807 | | |
26801 | 26808 | | |
26802 | 26809 | | |
| |||
26933 | 26940 | | |
26934 | 26941 | | |
26935 | 26942 | | |
26936 | | - | |
26937 | | - | |
26938 | | - | |
26939 | | - | |
26940 | | - | |
| 26943 | + | |
26941 | 26944 | | |
26942 | | - | |
26943 | | - | |
26944 | | - | |
| 26945 | + | |
| 26946 | + | |
26945 | 26947 | | |
26946 | 26948 | | |
26947 | 26949 | | |
| |||
26967 | 26969 | | |
26968 | 26970 | | |
26969 | 26971 | | |
26970 | | - | |
26971 | | - | |
26972 | | - | |
26973 | | - | |
26974 | | - | |
| 26972 | + | |
26975 | 26973 | | |
26976 | | - | |
26977 | | - | |
26978 | | - | |
| 26974 | + | |
| 26975 | + | |
26979 | 26976 | | |
26980 | 26977 | | |
26981 | 26978 | | |
| |||
27466 | 27463 | | |
27467 | 27464 | | |
27468 | 27465 | | |
| 27466 | + | |
| 27467 | + | |
| 27468 | + | |
| 27469 | + | |
27469 | 27470 | | |
27470 | 27471 | | |
27471 | 27472 | | |
| |||
27803 | 27804 | | |
27804 | 27805 | | |
27805 | 27806 | | |
27806 | | - | |
27807 | | - | |
27808 | | - | |
27809 | | - | |
27810 | | - | |
27811 | | - | |
| 27807 | + | |
27812 | 27808 | | |
27813 | 27809 | | |
27814 | 27810 | | |
| |||
27971 | 27967 | | |
27972 | 27968 | | |
27973 | 27969 | | |
| 27970 | + | |
| 27971 | + | |
27974 | 27972 | | |
27975 | 27973 | | |
27976 | 27974 | | |
| |||
Lines changed: 17 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9461 | 9461 | | |
9462 | 9462 | | |
9463 | 9463 | | |
9464 | | - | |
| 9464 | + | |
9465 | 9465 | | |
9466 | 9466 | | |
9467 | 9467 | | |
| |||
9503 | 9503 | | |
9504 | 9504 | | |
9505 | 9505 | | |
9506 | | - | |
| 9506 | + | |
9507 | 9507 | | |
9508 | 9508 | | |
9509 | 9509 | | |
| |||
9530 | 9530 | | |
9531 | 9531 | | |
9532 | 9532 | | |
9533 | | - | |
| 9533 | + | |
| 9534 | + | |
| 9535 | + | |
| 9536 | + | |
9534 | 9537 | | |
9535 | | - | |
9536 | | - | |
9537 | | - | |
| 9538 | + | |
9538 | 9539 | | |
9539 | 9540 | | |
9540 | 9541 | | |
| |||
9585 | 9586 | | |
9586 | 9587 | | |
9587 | 9588 | | |
| 9589 | + | |
| 9590 | + | |
| 9591 | + | |
| 9592 | + | |
| 9593 | + | |
9588 | 9594 | | |
9589 | 9595 | | |
9590 | 9596 | | |
| |||
9620 | 9626 | | |
9621 | 9627 | | |
9622 | 9628 | | |
9623 | | - | |
| 9629 | + | |
| 9630 | + | |
| 9631 | + | |
| 9632 | + | |
9624 | 9633 | | |
9625 | | - | |
9626 | | - | |
9627 | | - | |
| 9634 | + | |
9628 | 9635 | | |
9629 | 9636 | | |
9630 | 9637 | | |
| |||
Lines changed: 17 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10171 | 10171 | | |
10172 | 10172 | | |
10173 | 10173 | | |
10174 | | - | |
| 10174 | + | |
10175 | 10175 | | |
10176 | 10176 | | |
10177 | 10177 | | |
| |||
10226 | 10226 | | |
10227 | 10227 | | |
10228 | 10228 | | |
10229 | | - | |
| 10229 | + | |
10230 | 10230 | | |
10231 | 10231 | | |
10232 | 10232 | | |
| |||
10240 | 10240 | | |
10241 | 10241 | | |
10242 | 10242 | | |
10243 | | - | |
| 10243 | + | |
| 10244 | + | |
| 10245 | + | |
| 10246 | + | |
10244 | 10247 | | |
10245 | | - | |
10246 | | - | |
10247 | | - | |
| 10248 | + | |
10248 | 10249 | | |
10249 | 10250 | | |
10250 | 10251 | | |
| |||
10295 | 10296 | | |
10296 | 10297 | | |
10297 | 10298 | | |
| 10299 | + | |
| 10300 | + | |
| 10301 | + | |
| 10302 | + | |
| 10303 | + | |
10298 | 10304 | | |
10299 | 10305 | | |
10300 | 10306 | | |
| |||
10332 | 10338 | | |
10333 | 10339 | | |
10334 | 10340 | | |
10335 | | - | |
| 10341 | + | |
| 10342 | + | |
| 10343 | + | |
| 10344 | + | |
10336 | 10345 | | |
10337 | | - | |
10338 | | - | |
10339 | | - | |
| 10346 | + | |
10340 | 10347 | | |
10341 | 10348 | | |
10342 | 10349 | | |
| |||
0 commit comments