Skip to content

Commit

Permalink
update vendored React packages to the the latest canary (#53742)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnoff authored Aug 8, 2023
1 parent ee15b3b commit f0dab3a
Show file tree
Hide file tree
Showing 60 changed files with 915 additions and 1,226 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,14 @@
"random-seed": "0.3.0",
"react": "18.2.0",
"react-17": "npm:[email protected]",
"react-builtin": "npm:[email protected]9377e1010-20230712",
"react-builtin": "npm:[email protected]cb3404a0c-20230807",
"react-dom": "18.2.0",
"react-dom-17": "npm:[email protected]",
"react-dom-builtin": "npm:[email protected]9377e1010-20230712",
"react-dom-experimental-builtin": "npm:[email protected]9377e1010-20230712",
"react-experimental-builtin": "npm:[email protected]9377e1010-20230712",
"react-server-dom-webpack": "18.3.0-canary-9377e1010-20230712",
"react-server-dom-webpack-experimental": "npm:[email protected]9377e1010-20230712",
"react-dom-builtin": "npm:[email protected]cb3404a0c-20230807",
"react-dom-experimental-builtin": "npm:[email protected]cb3404a0c-20230807",
"react-experimental-builtin": "npm:[email protected]cb3404a0c-20230807",
"react-server-dom-webpack": "18.3.0-canary-cb3404a0c-20230807",
"react-server-dom-webpack-experimental": "npm:[email protected]cb3404a0c-20230807",
"react-ssr-prepass": "1.0.8",
"react-virtualized": "9.22.3",
"relay-compiler": "13.0.2",
Expand All @@ -206,8 +206,8 @@
"resolve-from": "5.0.0",
"sass": "1.54.0",
"satori": "0.10.1",
"scheduler-builtin": "npm:[email protected]9377e1010-20230712",
"scheduler-experimental-builtin": "npm:[email protected]9377e1010-20230712",
"scheduler-builtin": "npm:[email protected]cb3404a0c-20230807",
"scheduler-experimental-builtin": "npm:[email protected]cb3404a0c-20230807",
"seedrandom": "3.0.5",
"selenium-webdriver": "4.0.0-beta.4",
"semver": "7.3.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
var React = require("next/dist/compiled/react-experimental");
var ReactDOM = require('react-dom');

var ReactVersion = '18.3.0-experimental-9377e1010-20230712';
var ReactVersion = '18.3.0-experimental-cb3404a0c-20230807';

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

Expand Down Expand Up @@ -3330,6 +3330,9 @@ function pushMeta(target, props, responseState, textEmbedded, insertionMode, nos

if (typeof props.charSet === 'string') {
return pushSelfClosing(responseState.charsetChunks, props, 'meta');
} else if (props.name === 'viewport') {
// "viewport" isn't related to preconnect but it has the right priority
return pushSelfClosing(responseState.preconnectChunks, props, 'meta');
} else {
return pushSelfClosing(responseState.hoistableChunks, props, 'meta');
}
Expand Down Expand Up @@ -5160,14 +5163,11 @@ function writePreamble(destination, resources, responseState, willFlushAllSegmen
resources.fontPreloads.clear(); // Flush unblocked stylesheets by precedence

resources.precedences.forEach(flushAllStylesInPreamble, destination);
resources.bootstrapScripts.forEach(flushResourceInPreamble, destination);
resources.scripts.forEach(flushResourceInPreamble, destination);
resources.scripts.clear();
resources.explicitStylesheetPreloads.forEach(flushResourceInPreamble, destination);
resources.explicitStylesheetPreloads.clear();
resources.explicitScriptPreloads.forEach(flushResourceInPreamble, destination);
resources.explicitScriptPreloads.clear();
resources.explicitOtherPreloads.forEach(flushResourceInPreamble, destination);
resources.explicitOtherPreloads.clear(); // Write embedding preloadChunks
resources.explicitPreloads.forEach(flushResourceInPreamble, destination);
resources.explicitPreloads.clear(); // Write embedding preloadChunks

var preloadChunks = responseState.preloadChunks;

Expand Down Expand Up @@ -5218,15 +5218,13 @@ function writeHoistables(destination, resources, responseState) {
resources.fontPreloads.clear(); // Preload any stylesheets. these will emit in a render instruction that follows this
// but we want to kick off preloading as soon as possible

resources.precedences.forEach(preloadLateStyles, destination);
resources.precedences.forEach(preloadLateStyles, destination); // bootstrap scripts should flush above script priority but these can only flush in the preamble
// so we elide the code here for performance

resources.scripts.forEach(flushResourceLate, destination);
resources.scripts.clear();
resources.explicitStylesheetPreloads.forEach(flushResourceLate, destination);
resources.explicitStylesheetPreloads.clear();
resources.explicitScriptPreloads.forEach(flushResourceLate, destination);
resources.explicitScriptPreloads.clear();
resources.explicitOtherPreloads.forEach(flushResourceLate, destination);
resources.explicitOtherPreloads.clear(); // Write embedding preloadChunks
resources.explicitPreloads.forEach(flushResourceLate, destination);
resources.explicitPreloads.clear(); // Write embedding preloadChunks

var preloadChunks = responseState.preloadChunks;

Expand Down Expand Up @@ -5646,11 +5644,9 @@ function createResources() {
// usedImagePreloads: new Set(),
precedences: new Map(),
stylePrecedences: new Map(),
bootstrapScripts: new Set(),
scripts: new Set(),
explicitStylesheetPreloads: new Set(),
// explicitImagePreloads: new Set(),
explicitScriptPreloads: new Set(),
explicitOtherPreloads: new Set(),
explicitPreloads: new Set(),
// like a module global for currently rendering boundary
boundaryResources: null
};
Expand Down Expand Up @@ -5876,29 +5872,10 @@ function preload(href, options) {
pushLinkImpl(resource.chunks, resource.props);
}

switch (as) {
case 'font':
{
resources.fontPreloads.add(resource);
break;
}

case 'style':
{
resources.explicitStylesheetPreloads.add(resource);
break;
}

case 'script':
{
resources.explicitScriptPreloads.add(resource);
break;
}

default:
{
resources.explicitOtherPreloads.add(resource);
}
if (as === 'font') {
resources.fontPreloads.add(resource);
} else {
resources.explicitPreloads.add(resource);
}

flushResources(request);
Expand Down Expand Up @@ -6120,6 +6097,7 @@ function preloadBootstrapScript(resources, src, nonce, integrity, crossOrigin) {
rel: 'preload',
href: src,
as: 'script',
fetchPriority: 'low',
nonce: nonce,
integrity: integrity,
crossOrigin: crossOrigin
Expand All @@ -6131,7 +6109,7 @@ function preloadBootstrapScript(resources, src, nonce, integrity, crossOrigin) {
props: props
};
resources.preloadsMap.set(key, resource);
resources.explicitScriptPreloads.add(resource);
resources.bootstrapScripts.add(resource);
pushLinkImpl(resource.chunks, props);
} // This function is only safe to call at Request start time since it assumes
// that each module has not already been preloaded. If we find a need to preload
Expand All @@ -6154,6 +6132,7 @@ function preloadBootstrapModule(resources, src, nonce, integrity, crossOrigin) {
var props = {
rel: 'modulepreload',
href: src,
fetchPriority: 'low',
nonce: nonce,
integrity: integrity,
crossOrigin: crossOrigin
Expand All @@ -6165,7 +6144,7 @@ function preloadBootstrapModule(resources, src, nonce, integrity, crossOrigin) {
props: props
};
resources.preloadsMap.set(key, resource);
resources.explicitScriptPreloads.add(resource);
resources.bootstrapScripts.add(resource);
pushLinkImpl(resource.chunks, props);
return;
}
Expand Down
Loading

0 comments on commit f0dab3a

Please sign in to comment.