Commit 9edf470
authored
[Fizz] declare bootstrap script preloads to be
Generally scripts should not be preloaded before images but if they
arrive earlier than image preloads (or images) the network (or server)
may be saturated responding to inflight script preloads and not
sufficiently prioritize images arriving later. This change marks the
preloaded bootstrap script with a `low` fetch priority to signal to
supporting browsers that the request should be deprioritized. This
should make the preload operate similar to async script fetch priority
which is low by default according to https://web.dev/fetch-priority/
Additionally the bootstrap script preloads will emit before
preinitialized scripts do. Normal script preloads will continue to be
prioritized after stylesheets
This change can land separatrely but is part of a larger effort to
implement elevating image loading and making script loading less
blocking. Later changes will emit used suspensey images earlier in the
queue and will stop favoring scripts over images that are explicitly
preloadedfetchPriority: 'low' (#27189)1 parent ea17cc1 commit 9edf470
File tree
7 files changed
+83
-24
lines changed- packages
- react-dom-bindings/src/server
- react-dom/src/__tests__
- react-server-dom-fb/src/__tests__
7 files changed
+83
-24
lines changedLines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4245 | 4245 | | |
4246 | 4246 | | |
4247 | 4247 | | |
| 4248 | + | |
| 4249 | + | |
4248 | 4250 | | |
4249 | 4251 | | |
4250 | 4252 | | |
| |||
4322 | 4324 | | |
4323 | 4325 | | |
4324 | 4326 | | |
| 4327 | + | |
| 4328 | + | |
| 4329 | + | |
4325 | 4330 | | |
4326 | 4331 | | |
4327 | 4332 | | |
| |||
4875 | 4880 | | |
4876 | 4881 | | |
4877 | 4882 | | |
| 4883 | + | |
4878 | 4884 | | |
4879 | 4885 | | |
4880 | 4886 | | |
| |||
4901 | 4907 | | |
4902 | 4908 | | |
4903 | 4909 | | |
| 4910 | + | |
4904 | 4911 | | |
4905 | 4912 | | |
4906 | 4913 | | |
| |||
5470 | 5477 | | |
5471 | 5478 | | |
5472 | 5479 | | |
| 5480 | + | |
5473 | 5481 | | |
5474 | 5482 | | |
5475 | 5483 | | |
| |||
5481 | 5489 | | |
5482 | 5490 | | |
5483 | 5491 | | |
5484 | | - | |
| 5492 | + | |
5485 | 5493 | | |
5486 | 5494 | | |
5487 | 5495 | | |
| |||
5511 | 5519 | | |
5512 | 5520 | | |
5513 | 5521 | | |
| 5522 | + | |
5514 | 5523 | | |
5515 | 5524 | | |
5516 | 5525 | | |
| |||
5522 | 5531 | | |
5523 | 5532 | | |
5524 | 5533 | | |
5525 | | - | |
| 5534 | + | |
5526 | 5535 | | |
5527 | 5536 | | |
5528 | 5537 | | |
| |||
Lines changed: 66 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
613 | | - | |
614 | 613 | | |
615 | 614 | | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
616 | 623 | | |
617 | 624 | | |
618 | 625 | | |
619 | 626 | | |
620 | 627 | | |
621 | | - | |
622 | 628 | | |
623 | 629 | | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
624 | 637 | | |
625 | 638 | | |
626 | 639 | | |
| |||
640 | 653 | | |
641 | 654 | | |
642 | 655 | | |
643 | | - | |
644 | 656 | | |
645 | 657 | | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
646 | 666 | | |
647 | 667 | | |
648 | 668 | | |
649 | 669 | | |
650 | 670 | | |
651 | | - | |
652 | 671 | | |
653 | 672 | | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
654 | 680 | | |
655 | 681 | | |
656 | 682 | | |
| |||
3797 | 3823 | | |
3798 | 3824 | | |
3799 | 3825 | | |
3800 | | - | |
3801 | | - | |
3802 | | - | |
3803 | | - | |
3804 | | - | |
3805 | | - | |
| 3826 | + | |
| 3827 | + | |
| 3828 | + | |
| 3829 | + | |
| 3830 | + | |
| 3831 | + | |
| 3832 | + | |
| 3833 | + | |
| 3834 | + | |
| 3835 | + | |
| 3836 | + | |
| 3837 | + | |
| 3838 | + | |
| 3839 | + | |
| 3840 | + | |
| 3841 | + | |
| 3842 | + | |
3806 | 3843 | | |
3807 | 3844 | | |
3808 | 3845 | | |
| |||
3866 | 3903 | | |
3867 | 3904 | | |
3868 | 3905 | | |
3869 | | - | |
3870 | | - | |
3871 | | - | |
3872 | | - | |
3873 | | - | |
3874 | | - | |
| 3906 | + | |
| 3907 | + | |
| 3908 | + | |
| 3909 | + | |
| 3910 | + | |
| 3911 | + | |
| 3912 | + | |
| 3913 | + | |
| 3914 | + | |
| 3915 | + | |
| 3916 | + | |
| 3917 | + | |
| 3918 | + | |
| 3919 | + | |
| 3920 | + | |
| 3921 | + | |
| 3922 | + | |
| 3923 | + | |
3875 | 3924 | | |
3876 | 3925 | | |
| 3926 | + | |
3877 | 3927 | | |
3878 | 3928 | | |
3879 | 3929 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
500 | 500 | | |
501 | 501 | | |
502 | 502 | | |
503 | | - | |
| 503 | + | |
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
0 commit comments