Commit c2d1035
authored
Configure the requested environment and annotate tasks at boundary between environments (#30455)
This enables configuring the name of the requested environment.
When we currently use createTask, we start with a `"use server"`
annotation. This option basically configures that string.
I now also deal with the case when switching environments along the
owner path. If you go from `"Third Party"` to `"Server"` to `"Client"`,
it'll have a task named `"use third party"` at the root, then `"use
server"` and then finally `"use client"`.
We don't really have the concept of a Server Component making a request
during render to then create another Server Component. Really the inner
one should conceptually have the first one as its owner in that case. So
currently the inner one will always have a null owner. We could somehow
connect them in this server-to-server case.
We don't currently have a way to configure the `"use client"` option but
I figured maybe that could be inferred by the server environment that
the Flight Client is executed within.
Note: We did talk before about annotating each stack frame with the
environment. You can effectively do that manually when parsing
`rsc://React/{environment}/` from `captureOwnerStack`. However, we can't
do that natively. At least not without deeper integration. Because it's
the source map that's responsible for the actual function name of each
stack frame - not what we give it at runtime. So for the native stacks,
the task showing the change in environment is more practical.1 parent e5d2245 commit c2d1035
File tree
10 files changed
+129
-39
lines changed- packages
- react-client/src
- react-noop-renderer/src
- react-server-dom-esm/src
- react-server-dom-turbopack/src
- react-server-dom-webpack/src
10 files changed
+129
-39
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| 258 | + | |
258 | 259 | | |
259 | 260 | | |
260 | 261 | | |
| |||
692 | 693 | | |
693 | 694 | | |
694 | 695 | | |
695 | | - | |
| 696 | + | |
696 | 697 | | |
697 | 698 | | |
698 | 699 | | |
| |||
737 | 738 | | |
738 | 739 | | |
739 | 740 | | |
740 | | - | |
| 741 | + | |
741 | 742 | | |
742 | 743 | | |
743 | 744 | | |
| |||
1355 | 1356 | | |
1356 | 1357 | | |
1357 | 1358 | | |
| 1359 | + | |
1358 | 1360 | | |
1359 | 1361 | | |
1360 | 1362 | | |
| |||
1371 | 1373 | | |
1372 | 1374 | | |
1373 | 1375 | | |
1374 | | - | |
1375 | | - | |
1376 | | - | |
1377 | | - | |
1378 | | - | |
1379 | | - | |
1380 | | - | |
1381 | | - | |
1382 | 1376 | | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
1383 | 1388 | | |
1384 | 1389 | | |
| 1390 | + | |
1385 | 1391 | | |
1386 | 1392 | | |
1387 | 1393 | | |
| |||
1396 | 1402 | | |
1397 | 1403 | | |
1398 | 1404 | | |
| 1405 | + | |
1399 | 1406 | | |
1400 | 1407 | | |
1401 | 1408 | | |
| |||
1407 | 1414 | | |
1408 | 1415 | | |
1409 | 1416 | | |
| 1417 | + | |
1410 | 1418 | | |
1411 | 1419 | | |
1412 | 1420 | | |
| |||
1864 | 1872 | | |
1865 | 1873 | | |
1866 | 1874 | | |
1867 | | - | |
| 1875 | + | |
1868 | 1876 | | |
1869 | 1877 | | |
1870 | 1878 | | |
| |||
2098 | 2106 | | |
2099 | 2107 | | |
2100 | 2108 | | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
2101 | 2130 | | |
2102 | 2131 | | |
2103 | 2132 | | |
| 2133 | + | |
2104 | 2134 | | |
2105 | 2135 | | |
2106 | 2136 | | |
2107 | 2137 | | |
2108 | 2138 | | |
2109 | | - | |
2110 | | - | |
2111 | | - | |
2112 | | - | |
2113 | | - | |
2114 | 2139 | | |
2115 | 2140 | | |
2116 | 2141 | | |
2117 | 2142 | | |
2118 | 2143 | | |
2119 | | - | |
2120 | 2144 | | |
2121 | | - | |
2122 | | - | |
2123 | | - | |
2124 | | - | |
2125 | | - | |
2126 | | - | |
2127 | | - | |
2128 | | - | |
2129 | | - | |
2130 | | - | |
2131 | | - | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
2132 | 2182 | | |
2133 | | - | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
2134 | 2192 | | |
2135 | | - | |
| 2193 | + | |
2136 | 2194 | | |
2137 | | - | |
| 2195 | + | |
2138 | 2196 | | |
2139 | | - | |
| 2197 | + | |
2140 | 2198 | | |
2141 | 2199 | | |
2142 | | - | |
| 2200 | + | |
2143 | 2201 | | |
2144 | | - | |
2145 | | - | |
2146 | | - | |
2147 | 2202 | | |
2148 | 2203 | | |
2149 | 2204 | | |
| |||
2216 | 2271 | | |
2217 | 2272 | | |
2218 | 2273 | | |
2219 | | - | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
2220 | 2277 | | |
2221 | 2278 | | |
2222 | 2279 | | |
| |||
2266 | 2323 | | |
2267 | 2324 | | |
2268 | 2325 | | |
2269 | | - | |
| 2326 | + | |
2270 | 2327 | | |
2271 | 2328 | | |
2272 | 2329 | | |
| |||
2275 | 2332 | | |
2276 | 2333 | | |
2277 | 2334 | | |
2278 | | - | |
| 2335 | + | |
2279 | 2336 | | |
2280 | 2337 | | |
2281 | 2338 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
91 | 95 | | |
92 | 96 | | |
93 | 97 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
91 | 95 | | |
92 | 96 | | |
93 | 97 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
83 | 87 | | |
84 | 88 | | |
85 | 89 | | |
| |||
0 commit comments