Skip to content

Commit d082ee5

Browse files
committed
Update React from d900fadbf to db69f95e4
React upstream changes: - facebook/react#27401 - facebook/react#27443 - facebook/react#27445 - facebook/react#27364 - facebook/react#27440 - facebook/react#27436
1 parent a46c5af commit d082ee5

File tree

80 files changed

+3221
-2593
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+3221
-2593
lines changed

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,16 @@
192192
"random-seed": "0.3.0",
193193
"react": "18.2.0",
194194
"react-17": "npm:[email protected]",
195-
"react-builtin": "npm:[email protected]d900fadbf-20230929",
195+
"react-builtin": "npm:[email protected]db69f95e4-20231002",
196196
"react-dom": "18.2.0",
197197
"react-dom-17": "npm:[email protected]",
198-
"react-dom-builtin": "npm:[email protected]d900fadbf-20230929",
199-
"react-dom-experimental-builtin": "npm:[email protected]d900fadbf-20230929",
200-
"react-experimental-builtin": "npm:[email protected]d900fadbf-20230929",
201-
"react-server-dom-turbopack": "18.3.0-canary-d900fadbf-20230929",
202-
"react-server-dom-turbopack-experimental": "npm:[email protected]d900fadbf-20230929",
203-
"react-server-dom-webpack": "18.3.0-canary-d900fadbf-20230929",
204-
"react-server-dom-webpack-experimental": "npm:[email protected]d900fadbf-20230929",
198+
"react-dom-builtin": "npm:[email protected]db69f95e4-20231002",
199+
"react-dom-experimental-builtin": "npm:[email protected]db69f95e4-20231002",
200+
"react-experimental-builtin": "npm:[email protected]db69f95e4-20231002",
201+
"react-server-dom-turbopack": "18.3.0-canary-db69f95e4-20231002",
202+
"react-server-dom-turbopack-experimental": "npm:[email protected]db69f95e4-20231002",
203+
"react-server-dom-webpack": "18.3.0-canary-db69f95e4-20231002",
204+
"react-server-dom-webpack-experimental": "npm:[email protected]db69f95e4-20231002",
205205
"react-ssr-prepass": "1.0.8",
206206
"react-virtualized": "9.22.3",
207207
"relay-compiler": "13.0.2",
@@ -211,8 +211,8 @@
211211
"resolve-from": "5.0.0",
212212
"sass": "1.54.0",
213213
"satori": "0.10.6",
214-
"scheduler-builtin": "npm:[email protected]d900fadbf-20230929",
215-
"scheduler-experimental-builtin": "npm:[email protected]d900fadbf-20230929",
214+
"scheduler-builtin": "npm:[email protected]db69f95e4-20231002",
215+
"scheduler-experimental-builtin": "npm:[email protected]db69f95e4-20231002",
216216
"seedrandom": "3.0.5",
217217
"selenium-webdriver": "4.0.0-beta.4",
218218
"semver": "7.3.7",

packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js

Lines changed: 18 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
1717
var React = require("next/dist/compiled/react-experimental");
1818
var ReactDOM = require('react-dom');
1919

20-
var ReactVersion = '18.3.0-experimental-d900fadbf-20230929';
20+
var ReactVersion = '18.3.0-experimental-db69f95e4-20231002';
2121

2222
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
2323

@@ -8983,11 +8983,7 @@ function replaySuspenseBoundary(request, task, keyPath, props, id, childNodes, c
89838983

89848984
try {
89858985
// We use the safe form because we don't handle suspending here. Only error handling.
8986-
if (typeof childSlots === 'number') {
8987-
resumeNode(request, task, childSlots, content, -1);
8988-
} else {
8989-
renderNode(request, task, content, -1);
8990-
}
8986+
renderNode(request, task, content, -1);
89918987

89928988
if (task.replay.pendingTasks === 1 && task.replay.nodes.length > 0) {
89938989
throw new Error("Couldn't find all resumable slots by key/index during replaying. " + "The tree doesn't match so React will fallback to client rendering.");
@@ -9038,24 +9034,15 @@ function replaySuspenseBoundary(request, task, keyPath, props, id, childNodes, c
90389034
task.keyPath = prevKeyPath;
90399035
}
90409036

9041-
var fallbackKeyPath = [keyPath[0], 'Suspense Fallback', keyPath[2]];
9042-
var suspendedFallbackTask; // We create suspended task for the fallback because we don't want to actually work
9037+
var fallbackKeyPath = [keyPath[0], 'Suspense Fallback', keyPath[2]]; // We create suspended task for the fallback because we don't want to actually work
90439038
// on it yet in case we finish the main content, so we queue for later.
90449039

9045-
if (typeof fallbackSlots === 'number') {
9046-
// Resuming directly in the fallback.
9047-
var resumedSegment = createPendingSegment(request, 0, null, task.formatContext, false, false);
9048-
resumedSegment.id = fallbackSlots;
9049-
resumedSegment.parentFlushed = true;
9050-
suspendedFallbackTask = createRenderTask(request, null, fallback, -1, parentBoundary, resumedSegment, fallbackAbortSet, fallbackKeyPath, task.formatContext, task.legacyContext, task.context, task.treeContext);
9051-
} else {
9052-
var fallbackReplay = {
9053-
nodes: fallbackNodes,
9054-
slots: fallbackSlots,
9055-
pendingTasks: 0
9056-
};
9057-
suspendedFallbackTask = createReplayTask(request, null, fallbackReplay, fallback, -1, parentBoundary, fallbackAbortSet, fallbackKeyPath, task.formatContext, task.legacyContext, task.context, task.treeContext);
9058-
}
9040+
var fallbackReplay = {
9041+
nodes: fallbackNodes,
9042+
slots: fallbackSlots,
9043+
pendingTasks: 0
9044+
};
9045+
var suspendedFallbackTask = createReplayTask(request, null, fallbackReplay, fallback, -1, parentBoundary, fallbackAbortSet, fallbackKeyPath, task.formatContext, task.legacyContext, task.context, task.treeContext);
90599046

90609047
{
90619048
suspendedFallbackTask.componentStack = task.componentStack;
@@ -9605,37 +9592,6 @@ function resumeNode(request, task, segmentId, node, childIndex) {
96059592
}
96069593
}
96079594

9608-
function resumeElement(request, task, keyPath, segmentId, prevThenableState, type, props, ref) {
9609-
var prevReplay = task.replay;
9610-
var blockedBoundary = task.blockedBoundary;
9611-
var resumedSegment = createPendingSegment(request, 0, null, task.formatContext, false, false);
9612-
resumedSegment.id = segmentId;
9613-
resumedSegment.parentFlushed = true;
9614-
9615-
try {
9616-
// Convert the current ReplayTask to a RenderTask.
9617-
var renderTask = task;
9618-
renderTask.replay = null;
9619-
renderTask.blockedSegment = resumedSegment;
9620-
renderElement(request, task, keyPath, prevThenableState, type, props, ref);
9621-
resumedSegment.status = COMPLETED;
9622-
9623-
if (blockedBoundary === null) {
9624-
request.completedRootSegment = resumedSegment;
9625-
} else {
9626-
queueCompletedSegment(blockedBoundary, resumedSegment);
9627-
9628-
if (blockedBoundary.parentFlushed) {
9629-
request.partialBoundaries.push(blockedBoundary);
9630-
}
9631-
}
9632-
} finally {
9633-
// Restore to a ReplayTask.
9634-
task.replay = prevReplay;
9635-
task.blockedSegment = null;
9636-
}
9637-
}
9638-
96399595
function replayElement(request, task, keyPath, prevThenableState, name, keyOrIndex, childIndex, type, props, ref, replay) {
96409596
// We're replaying. Find the path to follow.
96419597
var replayNodes = replay.nodes;
@@ -9664,12 +9620,7 @@ function replayElement(request, task, keyPath, prevThenableState, name, keyOrInd
96649620
};
96659621

96669622
try {
9667-
if (typeof childSlots === 'number') {
9668-
// Matched a resumable element.
9669-
resumeElement(request, task, keyPath, childSlots, prevThenableState, type, props, ref);
9670-
} else {
9671-
renderElement(request, task, keyPath, prevThenableState, type, props, ref);
9672-
}
9623+
renderElement(request, task, keyPath, prevThenableState, type, props, ref);
96739624

96749625
if (task.replay.pendingTasks === 1 && task.replay.nodes.length > 0 // TODO check remaining slots
96759626
) {
@@ -9758,8 +9709,15 @@ prevThenableState, node, childIndex) {
97589709

97599710

97609711
function renderNodeDestructiveImpl(request, task, prevThenableState, node, childIndex) {
9761-
// Stash the node we're working on. We'll pick up from this task in case
9712+
if (task.replay !== null && typeof task.replay.slots === 'number') {
9713+
// TODO: Figure out a cheaper place than this hot path to do this check.
9714+
var resumeSegmentID = task.replay.slots;
9715+
resumeNode(request, task, resumeSegmentID, node, childIndex);
9716+
return;
9717+
} // Stash the node we're working on. We'll pick up from this task in case
97629718
// something suspends.
9719+
9720+
97639721
task.node = node;
97649722
task.childIndex = childIndex; // Handle object types
97659723

0 commit comments

Comments
 (0)