Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Updated React from 593ecee66 to 2c338b16f.
  • Loading branch information
gnoff committed Nov 16, 2023
commit 2a4b3e88e71beb170962af96f37fb814448f9f76
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,16 @@
"random-seed": "0.3.0",
"react": "18.2.0",
"react-17": "npm:[email protected]",
"react-builtin": "npm:[email protected]593ecee66-20231114",
"react-builtin": "npm:[email protected]2c338b16f-20231116",
"react-dom": "18.2.0",
"react-dom-17": "npm:[email protected]",
"react-dom-builtin": "npm:[email protected]593ecee66-20231114",
"react-dom-experimental-builtin": "npm:[email protected]593ecee66-20231114",
"react-experimental-builtin": "npm:[email protected]593ecee66-20231114",
"react-server-dom-turbopack": "18.3.0-canary-593ecee66-20231114",
"react-server-dom-turbopack-experimental": "npm:[email protected]593ecee66-20231114",
"react-server-dom-webpack": "18.3.0-canary-593ecee66-20231114",
"react-server-dom-webpack-experimental": "npm:[email protected]593ecee66-20231114",
"react-dom-builtin": "npm:[email protected]2c338b16f-20231116",
"react-dom-experimental-builtin": "npm:[email protected]2c338b16f-20231116",
"react-experimental-builtin": "npm:[email protected]2c338b16f-20231116",
"react-server-dom-turbopack": "18.3.0-canary-2c338b16f-20231116",
"react-server-dom-turbopack-experimental": "npm:[email protected]2c338b16f-20231116",
"react-server-dom-webpack": "18.3.0-canary-2c338b16f-20231116",
"react-server-dom-webpack-experimental": "npm:[email protected]2c338b16f-20231116",
"react-ssr-prepass": "1.0.8",
"react-virtualized": "9.22.3",
"relay-compiler": "13.0.2",
Expand All @@ -212,8 +212,8 @@
"resolve-from": "5.0.0",
"sass": "1.54.0",
"satori": "0.10.6",
"scheduler-builtin": "npm:[email protected]593ecee66-20231114",
"scheduler-experimental-builtin": "npm:[email protected]593ecee66-20231114",
"scheduler-builtin": "npm:[email protected]2c338b16f-20231116",
"scheduler-experimental-builtin": "npm:[email protected]2c338b16f-20231116",
"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-593ecee66-20231114';
var ReactVersion = '18.3.0-experimental-2c338b16f-20231116';

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

Expand Down Expand Up @@ -6449,6 +6449,9 @@ function emitEarlyPreloads(renderState, resumableState, shellComplete) {
var headers = renderState.headers;

if (headers) {
// Even if onHeaders throws we don't want to call this again so
// we drop the headers state from this point onwards.
renderState.headers = null;
var linkHeader = headers.preconnects;

if (headers.fontPreloads) {
Expand Down Expand Up @@ -6519,7 +6522,6 @@ function emitEarlyPreloads(renderState, resumableState, shellComplete) {
onHeaders({});
}

renderState.headers = null;
return;
}
}
Expand Down Expand Up @@ -11075,6 +11077,15 @@ function abortTask(task, request, error) {
if (request.allPendingTasks === 0) {
completeAll(request);
}
}

function safelyEmitEarlyPreloads(request, shellComplete) {
try {
emitEarlyPreloads(request.renderState, request.resumableState, shellComplete);
} catch (error) {
// We assume preloads are optimistic and thus non-fatal if errored.
logRecoverableError(request, error);
}
} // I extracted this function out because we want to ensure we consistently emit preloads before
// transitioning to the next request stage and this transition can happen in multiple places in this
// implementation.
Expand All @@ -11088,7 +11099,7 @@ function completeShell(request) {
// we should only be calling completeShell when the shell is complete so we
// just use a literal here
var shellComplete = true;
emitEarlyPreloads(request.renderState, request.resumableState, shellComplete);
safelyEmitEarlyPreloads(request, shellComplete);
} // We have completed the shell so the shell can't error anymore.


Expand All @@ -11108,7 +11119,7 @@ function completeAll(request) {
var shellComplete = request.trackedPostpones === null ? // Render, we assume it is completed
true : // Prerender Request, we use the state of the root segment
request.completedRootSegment === null || request.completedRootSegment.status !== POSTPONED;
emitEarlyPreloads(request.renderState, request.resumableState, shellComplete);
safelyEmitEarlyPreloads(request, shellComplete);
var onAllReady = request.onAllReady;
onAllReady();
}
Expand Down Expand Up @@ -11837,7 +11848,7 @@ function startWork(request) {

function enqueueEarlyPreloadsAfterInitialWork(request) {
var shellComplete = request.pendingRootTasks === 0;
emitEarlyPreloads(request.renderState, request.resumableState, shellComplete);
safelyEmitEarlyPreloads(request, shellComplete);
}

function enqueueFlush(request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function formatProdErrorMessage(code) {
return "Minified React error #" + code + "; visit " + url + " for the full message or " + 'use the non-minified dev environment for full errors and additional ' + 'helpful warnings.';
}

var ReactVersion = '18.3.0-experimental-593ecee66-20231114';
var ReactVersion = '18.3.0-experimental-2c338b16f-20231116';

// A pure JS implementation of a string hashing function. We do not use it for
// security or obfuscation purposes, only to create compact hashes. So we
Expand Down Expand Up @@ -4774,6 +4774,9 @@ function emitEarlyPreloads(renderState, resumableState, shellComplete) {
const headers = renderState.headers;

if (headers) {
// Even if onHeaders throws we don't want to call this again so
// we drop the headers state from this point onwards.
renderState.headers = null;
let linkHeader = headers.preconnects;

if (headers.fontPreloads) {
Expand Down Expand Up @@ -4844,7 +4847,6 @@ function emitEarlyPreloads(renderState, resumableState, shellComplete) {
onHeaders({});
}

renderState.headers = null;
return;
}
}
Expand Down Expand Up @@ -8004,6 +8006,15 @@ function abortTask(task, request, error) {
if (request.allPendingTasks === 0) {
completeAll(request);
}
}

function safelyEmitEarlyPreloads(request, shellComplete) {
try {
emitEarlyPreloads(request.renderState, request.resumableState, shellComplete);
} catch (error) {
// We assume preloads are optimistic and thus non-fatal if errored.
logRecoverableError(request, error);
}
} // I extracted this function out because we want to ensure we consistently emit preloads before
// transitioning to the next request stage and this transition can happen in multiple places in this
// implementation.
Expand All @@ -8017,7 +8028,7 @@ function completeShell(request) {
// we should only be calling completeShell when the shell is complete so we
// just use a literal here
const shellComplete = true;
emitEarlyPreloads(request.renderState, request.resumableState, shellComplete);
safelyEmitEarlyPreloads(request, shellComplete);
} // We have completed the shell so the shell can't error anymore.


Expand All @@ -8037,7 +8048,7 @@ function completeAll(request) {
const shellComplete = request.trackedPostpones === null ? // Render, we assume it is completed
true : // Prerender Request, we use the state of the root segment
request.completedRootSegment === null || request.completedRootSegment.status !== POSTPONED;
emitEarlyPreloads(request.renderState, request.resumableState, shellComplete);
safelyEmitEarlyPreloads(request, shellComplete);
const onAllReady = request.onAllReady;
onAllReady();
}
Expand Down Expand Up @@ -8725,7 +8736,7 @@ function startWork(request) {

function enqueueEarlyPreloadsAfterInitialWork(request) {
const shellComplete = request.pendingRootTasks === 0;
emitEarlyPreloads(request.renderState, request.resumableState, shellComplete);
safelyEmitEarlyPreloads(request, shellComplete);
}

function enqueueFlush(request) {
Expand Down
Loading