Commit 8947b45
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 6d36037 commit 8947b45
File tree
36 files changed
+342
-235
lines changed- compiled/facebook-www
36 files changed
+342
-235
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1419 | 1419 | | |
1420 | 1420 | | |
1421 | 1421 | | |
1422 | | - | |
| 1422 | + | |
1423 | 1423 | | |
1424 | 1424 | | |
1425 | 1425 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1419 | 1419 | | |
1420 | 1420 | | |
1421 | 1421 | | |
1422 | | - | |
| 1422 | + | |
1423 | 1423 | | |
1424 | 1424 | | |
1425 | 1425 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
602 | 602 | | |
603 | 603 | | |
604 | 604 | | |
605 | | - | |
| 605 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
602 | 602 | | |
603 | 603 | | |
604 | 604 | | |
605 | | - | |
| 605 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
609 | | - | |
| 609 | + | |
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
609 | | - | |
| 609 | + | |
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20224 | 20224 | | |
20225 | 20225 | | |
20226 | 20226 | | |
20227 | | - | |
| 20227 | + | |
20228 | 20228 | | |
20229 | 20229 | | |
20230 | | - | |
| 20230 | + | |
20231 | 20231 | | |
20232 | 20232 | | |
20233 | 20233 | | |
| |||
20261 | 20261 | | |
20262 | 20262 | | |
20263 | 20263 | | |
20264 | | - | |
| 20264 | + | |
20265 | 20265 | | |
20266 | 20266 | | |
20267 | 20267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19995 | 19995 | | |
19996 | 19996 | | |
19997 | 19997 | | |
19998 | | - | |
| 19998 | + | |
19999 | 19999 | | |
20000 | 20000 | | |
20001 | | - | |
| 20001 | + | |
20002 | 20002 | | |
20003 | 20003 | | |
20004 | 20004 | | |
| |||
20032 | 20032 | | |
20033 | 20033 | | |
20034 | 20034 | | |
20035 | | - | |
| 20035 | + | |
20036 | 20036 | | |
20037 | 20037 | | |
20038 | 20038 | | |
| |||
0 commit comments