Skip to content

Commit

Permalink
[Fizz] declare bootstrap script preloads to be fetchPriority: 'low' (
Browse files Browse the repository at this point in the history
…#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 commit 9edf470.
  • Loading branch information
gnoff committed Aug 7, 2023
1 parent a3b08e5 commit 06eedd9
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23982,7 +23982,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-canary-ea17cc18f-20230807";
var ReactVersion = "18.3.0-canary-9edf470d6-20230807";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8630,7 +8630,7 @@ var devToolsConfig$jscomp$inline_1032 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-ea17cc18f-20230807",
version: "18.3.0-canary-9edf470d6-20230807",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1231 = {
Expand Down Expand Up @@ -8661,7 +8661,7 @@ var internals$jscomp$inline_1231 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-ea17cc18f-20230807"
reconcilerVersion: "18.3.0-canary-9edf470d6-20230807"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1232 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9056,7 +9056,7 @@ var devToolsConfig$jscomp$inline_1074 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-ea17cc18f-20230807",
version: "18.3.0-canary-9edf470d6-20230807",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1272 = {
Expand Down Expand Up @@ -9087,7 +9087,7 @@ var internals$jscomp$inline_1272 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-ea17cc18f-20230807"
reconcilerVersion: "18.3.0-canary-9edf470d6-20230807"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1273 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (
}
"use strict";

var ReactVersion = "18.3.0-canary-ea17cc18f-20230807";
var ReactVersion = "18.3.0-canary-9edf470d6-20230807";

// ATTENTION
// When adding new symbols to this file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,4 +616,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-ea17cc18f-20230807";
exports.version = "18.3.0-canary-9edf470d6-20230807";
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-ea17cc18f-20230807";
exports.version = "18.3.0-canary-9edf470d6-20230807";

/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ea17cc18f458010c89c1bf494be08bb782d034af
9edf470d6ed1f3ac12c23a248e64293f367c1797

0 comments on commit 06eedd9

Please sign in to comment.