diff --git a/package.json b/package.json
index 38dd195e185806..a69f9e0be07ea9 100644
--- a/package.json
+++ b/package.json
@@ -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",
@@ -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",
@@ -258,4 +258,4 @@
"pnpm": "8.14.0"
},
"packageManager": "pnpm@8.14.0"
-}
+}
\ No newline at end of file
diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js
index 2cf4461b3bb816..f37efea75879fc 100644
--- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js
+++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js
@@ -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;
@@ -6673,8 +6673,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.
+}
+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) {
@@ -6682,13 +6683,12 @@ function getComponentNameFromType(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;
}
@@ -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;
@@ -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 {
@@ -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) {
@@ -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) {
@@ -10978,6 +11016,7 @@ function abortTask(task, request, error) {
}
encodeErrorForBoundary(boundary, _errorDigest, errorMessage, _errorInfo);
+ untrackBoundary(request, boundary);
if (boundary.parentFlushed) {
request.clientRenderedBoundaries.push(boundary);
diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js
index edf204ea3deccd..a5b433744222b9 100644
--- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js
+++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js
@@ -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
@@ -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) {
@@ -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;
}
@@ -5038,6 +5044,7 @@ function getComponentNameFromType(type) {
}
if (typeof type === 'object') {
+
switch (type.$$typeof) {
case REACT_CONTEXT_TYPE:
const context = type;
@@ -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 {
@@ -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) {
@@ -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) {
@@ -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);
diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.min.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.min.js
index 8dd258377fe477..2e0d284577a705 100644
--- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.min.js
+++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.min.js
@@ -63,23 +63,23 @@ function Mb(a,b){a.push(O("script"));var c=null,d=null,e;for(e in b)if(z.call(b,
function Nb(a,b,c){a.push(O(c));var d=c=null,e;for(e in b)if(z.call(b,e)){var f=b[e];if(null!=f)switch(e){case "children":c=f;break;case "dangerouslySetInnerHTML":d=f;break;default:K(a,e,f)}}a.push(">");M(a,d,c);return"string"===typeof c?(a.push(A(c)),null):c}var Ob=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Pb=new Map;function O(a){var b=Pb.get(a);if(void 0===b){if(!Ob.test(a))throw Error(q(65,a));b="<"+a;Pb.set(a,b)}return b}
function Qb(a,b,c,d,e,f,g){switch(b){case "div":case "span":case "svg":case "path":case "a":case "g":case "p":case "li":break;case "select":a.push(O("select"));var h=null,k=null,l;for(l in c)if(z.call(c,l)){var m=c[l];if(null!=m)switch(l){case "children":h=m;break;case "dangerouslySetInnerHTML":k=m;break;case "defaultValue":case "value":break;default:K(a,l,m)}}a.push(">");M(a,k,h);return h;case "option":var p=f.selectedValue;a.push(O("option"));var n=null,r=null,D=null,B=null,y;for(y in c)if(z.call(c,
y)){var v=c[y];if(null!=v)switch(y){case "children":n=v;break;case "selected":D=v;break;case "dangerouslySetInnerHTML":B=v;break;case "value":r=v;default:K(a,y,v)}}if(null!=p){var u=null!==r?""+r:Gb(n);if(Fa(p))for(var F=0;F