Commit 1d1b26c
authored
[Flight] Serialize already resolved Promises as debug models (#33588)
We already support serializing the values of instrumented Promises as
debug values such as in console logs. However, we don't support plain
native promises.
This waits a microtask to see if we can read the value within a
microtask and if so emit it. This is so that we can still close the
connection.
Otherwise, we emit a "halted" row into its row id which replaces the old
"Infinite Promise" reference.
We could potentially wait until the end of the render before cancelling
so that if it resolves before we exit we can still include its value but
that would require a bit more work. Ideally we'd have a way to get these
lazily later anyway.1 parent fe3f0ec commit 1d1b26c
File tree
4 files changed
+204
-47
lines changed- packages
- react-client/src
- __tests__
- react-noop-renderer/src
- react-server/src
4 files changed
+204
-47
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
158 | 159 | | |
159 | 160 | | |
160 | 161 | | |
| |||
221 | 222 | | |
222 | 223 | | |
223 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
224 | 234 | | |
225 | 235 | | |
226 | 236 | | |
227 | 237 | | |
228 | 238 | | |
229 | 239 | | |
230 | | - | |
| 240 | + | |
| 241 | + | |
231 | 242 | | |
232 | 243 | | |
233 | 244 | | |
| |||
311 | 322 | | |
312 | 323 | | |
313 | 324 | | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
314 | 328 | | |
315 | 329 | | |
316 | 330 | | |
| |||
368 | 382 | | |
369 | 383 | | |
370 | 384 | | |
| 385 | + | |
371 | 386 | | |
372 | 387 | | |
373 | 388 | | |
| |||
1367 | 1382 | | |
1368 | 1383 | | |
1369 | 1384 | | |
| 1385 | + | |
1370 | 1386 | | |
1371 | 1387 | | |
1372 | 1388 | | |
| |||
1470 | 1486 | | |
1471 | 1487 | | |
1472 | 1488 | | |
1473 | | - | |
1474 | | - | |
1475 | | - | |
1476 | | - | |
1477 | 1489 | | |
1478 | 1490 | | |
1479 | 1491 | | |
| |||
1769 | 1781 | | |
1770 | 1782 | | |
1771 | 1783 | | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
1772 | 1800 | | |
1773 | 1801 | | |
1774 | 1802 | | |
| |||
3339 | 3367 | | |
3340 | 3368 | | |
3341 | 3369 | | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
| 3373 | + | |
3342 | 3374 | | |
3343 | 3375 | | |
3344 | 3376 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3213 | 3213 | | |
3214 | 3214 | | |
3215 | 3215 | | |
3216 | | - | |
| 3216 | + | |
| 3217 | + | |
3217 | 3218 | | |
3218 | 3219 | | |
3219 | 3220 | | |
| |||
3258 | 3259 | | |
3259 | 3260 | | |
3260 | 3261 | | |
| 3262 | + | |
| 3263 | + | |
| 3264 | + | |
| 3265 | + | |
| 3266 | + | |
3261 | 3267 | | |
3262 | 3268 | | |
3263 | | - | |
| 3269 | + | |
3264 | 3270 | | |
3265 | 3271 | | |
3266 | 3272 | | |
| |||
3280 | 3286 | | |
3281 | 3287 | | |
3282 | 3288 | | |
| 3289 | + | |
| 3290 | + | |
| 3291 | + | |
| 3292 | + | |
| 3293 | + | |
| 3294 | + | |
| 3295 | + | |
| 3296 | + | |
| 3297 | + | |
| 3298 | + | |
| 3299 | + | |
| 3300 | + | |
| 3301 | + | |
| 3302 | + | |
| 3303 | + | |
| 3304 | + | |
| 3305 | + | |
3283 | 3306 | | |
3284 | 3307 | | |
3285 | 3308 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
77 | 81 | | |
78 | 82 | | |
79 | 83 | | |
| |||
0 commit comments