You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Fizz] declare bootstrap script preloads to be fetchPriority: 'low' (#27189)
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
preloaded
DiffTrain build for [9edf470](9edf470)
resources.precedences.forEach(preloadLateStyles,destination);// bootstrap scripts should flush above script priority but these can only flush in the preamble
resources.precedences.forEach(preloadLateStyles,destination);// bootstrap scripts should flush above script priority but these can only flush in the preamble
@@ -3949,6 +3953,7 @@ function renderToStringImpl(
3949
3953
fontPreloads: newSet(),
3950
3954
precedences: newMap(),
3951
3955
stylePrecedences: newMap(),
3956
+
bootstrapScripts: newSet(),
3952
3957
scripts: newSet(),
3953
3958
explicitStylesheetPreloads: newSet(),
3954
3959
explicitScriptPreloads: newSet(),
@@ -4014,4 +4019,4 @@ exports.renderToString = function (children, options) {
4014
4019
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
@@ -3847,6 +3851,7 @@ function renderToStringImpl(
3847
3851
fontPreloads: newSet(),
3848
3852
precedences: newMap(),
3849
3853
stylePrecedences: newMap(),
3854
+
bootstrapScripts: newSet(),
3850
3855
scripts: newSet(),
3851
3856
explicitStylesheetPreloads: newSet(),
3852
3857
explicitScriptPreloads: newSet(),
@@ -3912,4 +3917,4 @@ exports.renderToString = function (children, options) {
3912
3917
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
resources.precedences.forEach(preloadLateStyles,destination);// bootstrap scripts should flush above script priority but these can only flush in the preamble
0 commit comments