Commit 759ba05
committed
[Flight] Add approximate parent context for FormatContext (facebook#34601)
Flight doesn't have any semantically sound notion of a parent context.
That's why we removed Server Context. Each root can really start
anywhere in the tree when you refetch subtrees. Additionally when you
dedupe elements they can end up in multiple different parent contexts.
However, we do have a DEV only version of this with debugTask being
tracked for the nearest parent element to track the context of
properties inside of it.
To apply certain DOM specific hints and optimizations when you render
host components we need some information of the context. This is usually
very local so doesn't suffer from the likelihood that you refetch in the
middle. We'll also only use this information for optimistic hints and
not hard semantics so getting it wrong isn't terrible.
```
<picture>
<img />
</picture>
<noscript>
<p>
<img />
</p>
</noscript>
```
For example, in these cases we should exclude preloading the image but
we have to know if that's the scope we're in.
We can easily get this wrong if they're split or even if they're wrapped
in client components that we don't know about like:
```
<NoScript>
<p>
<img />
</p>
</NoScript>
```
However, getting it wrong in either direction is not the end of the
world. It's about covering the common cases well.
DiffTrain build for [b0c1dc0](facebook@b0c1dc0)1 parent 61447e2 commit 759ba05
File tree
24 files changed
+87
-87
lines changed- compiled-rn
- facebook-fbsource/xplat/js
- RKJSModules/vendor/react
- react-dom/cjs
- react-test-renderer/cjs
- react/cjs
- react-native-github/Libraries/Renderer
- implementations
- tools/eslint-plugin-react-hooks
24 files changed
+87
-87
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | | - | |
| 407 | + | |
408 | 408 | | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
29920 | 29920 | | |
29921 | 29921 | | |
29922 | 29922 | | |
29923 | | - | |
| 29923 | + | |
29924 | 29924 | | |
29925 | 29925 | | |
29926 | 29926 | | |
29927 | | - | |
| 29927 | + | |
29928 | 29928 | | |
29929 | 29929 | | |
29930 | 29930 | | |
| |||
29961 | 29961 | | |
29962 | 29962 | | |
29963 | 29963 | | |
29964 | | - | |
| 29964 | + | |
29965 | 29965 | | |
29966 | 29966 | | |
29967 | | - | |
| 29967 | + | |
29968 | 29968 | | |
29969 | 29969 | | |
29970 | 29970 | | |
| |||
30113 | 30113 | | |
30114 | 30114 | | |
30115 | 30115 | | |
30116 | | - | |
| 30116 | + | |
30117 | 30117 | | |
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
17529 | 17529 | | |
17530 | 17530 | | |
17531 | 17531 | | |
17532 | | - | |
| 17532 | + | |
17533 | 17533 | | |
17534 | 17534 | | |
17535 | 17535 | | |
17536 | 17536 | | |
17537 | 17537 | | |
17538 | 17538 | | |
17539 | | - | |
| 17539 | + | |
17540 | 17540 | | |
17541 | 17541 | | |
17542 | 17542 | | |
| |||
17558 | 17558 | | |
17559 | 17559 | | |
17560 | 17560 | | |
17561 | | - | |
| 17561 | + | |
17562 | 17562 | | |
17563 | 17563 | | |
17564 | | - | |
| 17564 | + | |
17565 | 17565 | | |
17566 | 17566 | | |
17567 | 17567 | | |
| |||
17668 | 17668 | | |
17669 | 17669 | | |
17670 | 17670 | | |
17671 | | - | |
| 17671 | + | |
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
19622 | 19622 | | |
19623 | 19623 | | |
19624 | 19624 | | |
19625 | | - | |
| 19625 | + | |
19626 | 19626 | | |
19627 | 19627 | | |
19628 | 19628 | | |
19629 | 19629 | | |
19630 | 19630 | | |
19631 | 19631 | | |
19632 | | - | |
| 19632 | + | |
19633 | 19633 | | |
19634 | 19634 | | |
19635 | 19635 | | |
| |||
19651 | 19651 | | |
19652 | 19652 | | |
19653 | 19653 | | |
19654 | | - | |
| 19654 | + | |
19655 | 19655 | | |
19656 | 19656 | | |
19657 | | - | |
| 19657 | + | |
19658 | 19658 | | |
19659 | 19659 | | |
19660 | 19660 | | |
| |||
19777 | 19777 | | |
19778 | 19778 | | |
19779 | 19779 | | |
19780 | | - | |
| 19780 | + | |
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
29976 | 29976 | | |
29977 | 29977 | | |
29978 | 29978 | | |
29979 | | - | |
| 29979 | + | |
29980 | 29980 | | |
29981 | 29981 | | |
29982 | 29982 | | |
29983 | | - | |
| 29983 | + | |
29984 | 29984 | | |
29985 | 29985 | | |
29986 | 29986 | | |
| |||
30017 | 30017 | | |
30018 | 30018 | | |
30019 | 30019 | | |
30020 | | - | |
| 30020 | + | |
30021 | 30021 | | |
30022 | 30022 | | |
30023 | | - | |
| 30023 | + | |
30024 | 30024 | | |
30025 | 30025 | | |
30026 | 30026 | | |
| |||
30485 | 30485 | | |
30486 | 30486 | | |
30487 | 30487 | | |
30488 | | - | |
| 30488 | + | |
30489 | 30489 | | |
30490 | 30490 | | |
30491 | 30491 | | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
17540 | 17540 | | |
17541 | 17541 | | |
17542 | 17542 | | |
17543 | | - | |
| 17543 | + | |
17544 | 17544 | | |
17545 | 17545 | | |
17546 | 17546 | | |
17547 | 17547 | | |
17548 | 17548 | | |
17549 | 17549 | | |
17550 | | - | |
| 17550 | + | |
17551 | 17551 | | |
17552 | 17552 | | |
17553 | 17553 | | |
| |||
17569 | 17569 | | |
17570 | 17570 | | |
17571 | 17571 | | |
17572 | | - | |
| 17572 | + | |
17573 | 17573 | | |
17574 | 17574 | | |
17575 | | - | |
| 17575 | + | |
17576 | 17576 | | |
17577 | 17577 | | |
17578 | 17578 | | |
| |||
17832 | 17832 | | |
17833 | 17833 | | |
17834 | 17834 | | |
17835 | | - | |
| 17835 | + | |
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
19637 | 19637 | | |
19638 | 19638 | | |
19639 | 19639 | | |
19640 | | - | |
| 19640 | + | |
19641 | 19641 | | |
19642 | 19642 | | |
19643 | 19643 | | |
19644 | 19644 | | |
19645 | 19645 | | |
19646 | 19646 | | |
19647 | | - | |
| 19647 | + | |
19648 | 19648 | | |
19649 | 19649 | | |
19650 | 19650 | | |
| |||
19666 | 19666 | | |
19667 | 19667 | | |
19668 | 19668 | | |
19669 | | - | |
| 19669 | + | |
19670 | 19670 | | |
19671 | 19671 | | |
19672 | | - | |
| 19672 | + | |
19673 | 19673 | | |
19674 | 19674 | | |
19675 | 19675 | | |
| |||
19945 | 19945 | | |
19946 | 19946 | | |
19947 | 19947 | | |
19948 | | - | |
| 19948 | + | |
19949 | 19949 | | |
19950 | 19950 | | |
19951 | 19951 | | |
| |||
0 commit comments