Skip to content

Commit

Permalink
Update React from f1039be4a to 60a927d04
Browse files Browse the repository at this point in the history
  • Loading branch information
acdlite committed Jan 14, 2024
1 parent 2bc2425 commit 4df9c84
Show file tree
Hide file tree
Showing 75 changed files with 4,490 additions and 3,448 deletions.
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,16 @@
"random-seed": "0.3.0",
"react": "18.2.0",
"react-17": "npm:react@17.0.2",
"react-builtin": "npm:react@18.3.0-canary-f1039be4a-20240107",
"react-builtin": "npm:react@18.3.0-canary-60a927d04-20240113",
"react-dom": "18.2.0",
"react-dom-17": "npm:react-dom@17.0.2",
"react-dom-builtin": "npm:react-dom@18.3.0-canary-f1039be4a-20240107",
"react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-f1039be4a-20240107",
"react-experimental-builtin": "npm:react@0.0.0-experimental-f1039be4a-20240107",
"react-server-dom-turbopack": "18.3.0-canary-f1039be4a-20240107",
"react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-f1039be4a-20240107",
"react-server-dom-webpack": "18.3.0-canary-f1039be4a-20240107",
"react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-f1039be4a-20240107",
"react-dom-builtin": "npm:react-dom@18.3.0-canary-60a927d04-20240113",
"react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-60a927d04-20240113",
"react-experimental-builtin": "npm:react@0.0.0-experimental-60a927d04-20240113",
"react-server-dom-turbopack": "18.3.0-canary-60a927d04-20240113",
"react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-60a927d04-20240113",
"react-server-dom-webpack": "18.3.0-canary-60a927d04-20240113",
"react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-60a927d04-20240113",
"react-ssr-prepass": "1.0.8",
"react-virtualized": "9.22.3",
"relay-compiler": "13.0.2",
Expand All @@ -216,8 +216,8 @@
"resolve-from": "5.0.0",
"sass": "1.54.0",
"satori": "0.10.9",
"scheduler-builtin": "npm:scheduler@0.24.0-canary-f1039be4a-20240107",
"scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-f1039be4a-20240107",
"scheduler-builtin": "npm:scheduler@0.24.0-canary-60a927d04-20240113",
"scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-60a927d04-20240113",
"seedrandom": "3.0.5",
"selenium-webdriver": "4.0.0-beta.4",
"semver": "7.3.7",
Expand Down Expand Up @@ -258,4 +258,4 @@
"pnpm": "8.14.0"
},
"packageManager": "pnpm@8.14.0"
}
}
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-f1039be4a-20240107';
var ReactVersion = '18.3.0-experimental-60a927d04-20240113';

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

Expand Down Expand Up @@ -6673,22 +6673,22 @@ function getWrappedName(outerType, innerType, wrapperName) {

function getContextName(type) {
return type.displayName || 'Context';
} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
}

var REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference'); // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.

function getComponentNameFromType(type) {
if (type == null) {
// Host root, text node or just invalid type.
return null;
}

{
if (typeof type.tag === 'number') {
error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
if (typeof type === 'function') {
if (type.$$typeof === REACT_CLIENT_REFERENCE) {
// TODO: Create a convention for naming client references with debug info.
return null;
}
}

if (typeof type === 'function') {
return type.displayName || type.name || null;
}

Expand Down Expand Up @@ -6723,6 +6723,12 @@ function getComponentNameFromType(type) {
}

if (typeof type === 'object') {
{
if (typeof type.tag === 'number') {
error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
}
}

switch (type.$$typeof) {
case REACT_CONTEXT_TYPE:
var context = type;
Expand Down Expand Up @@ -9415,7 +9421,8 @@ function renderSuspenseBoundary(request, someTask, keyPath, props) {
errorDigest = logRecoverableError(request, error, thrownInfo);
}

encodeErrorForBoundary(newBoundary, errorDigest, error, thrownInfo); // We don't need to decrement any task numbers because we didn't spawn any new task.
encodeErrorForBoundary(newBoundary, errorDigest, error, thrownInfo);
untrackBoundary(request, newBoundary); // We don't need to decrement any task numbers because we didn't spawn any new task.
// We don't need to schedule any task because we know the parent has written yet.
// We do need to fallthrough to create the fallback though.
} finally {
Expand Down Expand Up @@ -10596,6 +10603,36 @@ function trackPostpone(request, trackedPostpones, task, segment) {

slots[task.childIndex] = segment.id;
}
} // In case a boundary errors, we need to stop tracking it because we won't
// resume it.


function untrackBoundary(request, boundary) {
var trackedPostpones = request.trackedPostpones;

if (trackedPostpones === null) {
return;
}

var boundaryKeyPath = boundary.trackedContentKeyPath;

if (boundaryKeyPath === null) {
return;
}

var boundaryNode = trackedPostpones.workingMap.get(boundaryKeyPath);

if (boundaryNode === undefined) {
return;
} // Downgrade to plain ReplayNode since we won't replay through it.
// $FlowFixMe[cannot-write]: We intentionally downgrade this to the other tuple.


boundaryNode.length = 4; // Remove any resumable slots.

boundaryNode[2] = [];
boundaryNode[3] = null; // TODO: We should really just remove the boundary from all parent paths too so
// we don't replay the path to it.
}

function injectPostponedHole(request, task, reason, thrownInfo) {
Expand Down Expand Up @@ -10814,7 +10851,8 @@ function erroredTask(request, boundary, error, errorInfo) {

if (boundary.status !== CLIENT_RENDERED) {
boundary.status = CLIENT_RENDERED;
encodeErrorForBoundary(boundary, errorDigest, error, errorInfo); // Regardless of what happens next, this boundary won't be displayed,
encodeErrorForBoundary(boundary, errorDigest, error, errorInfo);
untrackBoundary(request, boundary); // Regardless of what happens next, this boundary won't be displayed,
// so we can flush it, if the parent already flushed.

if (boundary.parentFlushed) {
Expand Down Expand Up @@ -10978,6 +11016,7 @@ function abortTask(task, request, error) {
}

encodeErrorForBoundary(boundary, _errorDigest, errorMessage, _errorInfo);
untrackBoundary(request, boundary);

if (boundary.parentFlushed) {
request.clientRenderedBoundaries.push(boundary);
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-f1039be4a-20240107';
var ReactVersion = '18.3.0-experimental-60a927d04-20240113';

// 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 @@ -4994,8 +4994,9 @@ function getWrappedName(outerType, innerType, wrapperName) {

function getContextName(type) {
return type.displayName || 'Context';
} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
}

const REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference'); // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.

function getComponentNameFromType(type) {
if (type == null) {
Expand All @@ -5004,6 +5005,11 @@ function getComponentNameFromType(type) {
}

if (typeof type === 'function') {
if (type.$$typeof === REACT_CLIENT_REFERENCE) {
// TODO: Create a convention for naming client references with debug info.
return null;
}

return type.displayName || type.name || null;
}

Expand Down Expand Up @@ -5038,6 +5044,7 @@ function getComponentNameFromType(type) {
}

if (typeof type === 'object') {

switch (type.$$typeof) {
case REACT_CONTEXT_TYPE:
const context = type;
Expand Down Expand Up @@ -6995,7 +7002,8 @@ function renderSuspenseBoundary(request, someTask, keyPath, props) {
errorDigest = logRecoverableError(request, error, thrownInfo);
}

encodeErrorForBoundary(newBoundary, errorDigest); // We don't need to decrement any task numbers because we didn't spawn any new task.
encodeErrorForBoundary(newBoundary, errorDigest);
untrackBoundary(request, newBoundary); // We don't need to decrement any task numbers because we didn't spawn any new task.
// We don't need to schedule any task because we know the parent has written yet.
// We do need to fallthrough to create the fallback though.
} finally {
Expand Down Expand Up @@ -7994,6 +8002,36 @@ function trackPostpone(request, trackedPostpones, task, segment) {

slots[task.childIndex] = segment.id;
}
} // In case a boundary errors, we need to stop tracking it because we won't
// resume it.


function untrackBoundary(request, boundary) {
const trackedPostpones = request.trackedPostpones;

if (trackedPostpones === null) {
return;
}

const boundaryKeyPath = boundary.trackedContentKeyPath;

if (boundaryKeyPath === null) {
return;
}

const boundaryNode = trackedPostpones.workingMap.get(boundaryKeyPath);

if (boundaryNode === undefined) {
return;
} // Downgrade to plain ReplayNode since we won't replay through it.
// $FlowFixMe[cannot-write]: We intentionally downgrade this to the other tuple.


boundaryNode.length = 4; // Remove any resumable slots.

boundaryNode[2] = [];
boundaryNode[3] = null; // TODO: We should really just remove the boundary from all parent paths too so
// we don't replay the path to it.
}

function injectPostponedHole(request, task, reason, thrownInfo) {
Expand Down Expand Up @@ -8210,7 +8248,8 @@ function erroredTask(request, boundary, error, errorInfo) {

if (boundary.status !== CLIENT_RENDERED) {
boundary.status = CLIENT_RENDERED;
encodeErrorForBoundary(boundary, errorDigest); // Regardless of what happens next, this boundary won't be displayed,
encodeErrorForBoundary(boundary, errorDigest);
untrackBoundary(request, boundary); // Regardless of what happens next, this boundary won't be displayed,
// so we can flush it, if the parent already flushed.

if (boundary.parentFlushed) {
Expand Down Expand Up @@ -8348,6 +8387,7 @@ function abortTask(task, request, error) {
const errorDigest = logRecoverableError(request, error, errorInfo);

encodeErrorForBoundary(boundary, errorDigest);
untrackBoundary(request, boundary);

if (boundary.parentFlushed) {
request.clientRenderedBoundaries.push(boundary);
Expand Down
Loading

0 comments on commit 4df9c84

Please sign in to comment.