Commit c91892e
authored
[Fizz] Don't flush empty segments (#24054)
Before this change, we would sometimes write segments without any content
in them. For example for a Suspense boundary that immediately suspends
we might emit something like:
<div hidden id="123">
<template id="456"></template>
</div>
Where the outer div is just a temporary wrapper and the inner one is a
placeholder for something to be added later.
This serves no purpose.
We should ideally have a heuristic that holds back segments based on byte
size and time. However, this is a straight forward clear win for now.1 parent 11c5bb6 commit c91892e
File tree
2 files changed
+30
-3
lines changed- packages
- react-dom/src/__tests__
- react-server/src
2 files changed
+30
-3
lines changedLines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
495 | 495 | | |
496 | 496 | | |
497 | 497 | | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
498 | 502 | | |
499 | 503 | | |
500 | 504 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
488 | 488 | | |
489 | 489 | | |
490 | 490 | | |
491 | | - | |
| 491 | + | |
492 | 492 | | |
493 | 493 | | |
494 | 494 | | |
| |||
1430 | 1430 | | |
1431 | 1431 | | |
1432 | 1432 | | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
1433 | 1456 | | |
1434 | 1457 | | |
1435 | 1458 | | |
| |||
1463 | 1486 | | |
1464 | 1487 | | |
1465 | 1488 | | |
1466 | | - | |
| 1489 | + | |
1467 | 1490 | | |
1468 | 1491 | | |
1469 | 1492 | | |
| |||
1482 | 1505 | | |
1483 | 1506 | | |
1484 | 1507 | | |
| 1508 | + | |
1485 | 1509 | | |
1486 | | - | |
1487 | 1510 | | |
1488 | 1511 | | |
1489 | 1512 | | |
| |||
0 commit comments