Commit a6e4791
authored
[Fizz] Fix root segment IDs (#27371)
Typically we assign IDs lazily when flushing to minimize the ids we have
to assign and we try to maximize inlining.
When we prerender we could always flush into a buffer before returning
but that's not actually what we do right now. We complete rendering
before returning but we don't actually run the flush path until someone
reads the resulting stream. We assign IDs eagerly when something
postpone so that we can refer to those ids in the holes without flushing
first.
This leads to some interesting conditions that needs to consider this.
This PR also deals with rootSegmentId which is the ID of the segment
that contains the body of a Suspense boundary. The boundary needs to
know this in addition to the Suspense Boundary's ID to know how to
inject the root segment into the boundary.
Why is the suspense boundary ID and the rootSegmentID just not the same
ID? Why don't segments and suspense boundary not share ID namespace?
That's a good question and I don't really remember. It might not be a
good reason and maybe they should just be the same.1 parent 95c9554 commit a6e4791
1 file changed
+16
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
| |||
1957 | 1958 | | |
1958 | 1959 | | |
1959 | 1960 | | |
| 1961 | + | |
1960 | 1962 | | |
1961 | 1963 | | |
1962 | 1964 | | |
| |||
1971 | 1973 | | |
1972 | 1974 | | |
1973 | 1975 | | |
| 1976 | + | |
1974 | 1977 | | |
1975 | 1978 | | |
1976 | 1979 | | |
| |||
2021 | 2024 | | |
2022 | 2025 | | |
2023 | 2026 | | |
2024 | | - | |
| 2027 | + | |
2025 | 2028 | | |
2026 | 2029 | | |
2027 | 2030 | | |
| |||
2316 | 2319 | | |
2317 | 2320 | | |
2318 | 2321 | | |
2319 | | - | |
| 2322 | + | |
| 2323 | + | |
| 2324 | + | |
2320 | 2325 | | |
2321 | 2326 | | |
2322 | 2327 | | |
| |||
2668 | 2673 | | |
2669 | 2674 | | |
2670 | 2675 | | |
| 2676 | + | |
| 2677 | + | |
2671 | 2678 | | |
2672 | 2679 | | |
2673 | 2680 | | |
2674 | 2681 | | |
| 2682 | + | |
2675 | 2683 | | |
2676 | | - | |
2677 | 2684 | | |
2678 | | - | |
2679 | | - | |
2680 | 2685 | | |
2681 | 2686 | | |
2682 | 2687 | | |
2683 | 2688 | | |
2684 | 2689 | | |
| 2690 | + | |
| 2691 | + | |
2685 | 2692 | | |
2686 | 2693 | | |
2687 | 2694 | | |
| |||
2868 | 2875 | | |
2869 | 2876 | | |
2870 | 2877 | | |
| 2878 | + | |
| 2879 | + | |
| 2880 | + | |
| 2881 | + | |
2871 | 2882 | | |
2872 | 2883 | | |
2873 | 2884 | | |
| |||
0 commit comments