Skip to content

Commit e6a117b

Browse files
authored
(backport) Update React from 60a927d04 to 4b84f1161 (#63476)
Updates React from 60a927d04 to 4b84f1161. ### React upstream changes - facebook/react#28585 Closes NEXT-2865
1 parent c227315 commit e6a117b

File tree

111 files changed

+404
-638
lines changed

Some content is hidden

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

111 files changed

+404
-638
lines changed

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,16 @@
197197
"random-seed": "0.3.0",
198198
"react": "18.2.0",
199199
"react-17": "npm:[email protected]",
200-
"react-builtin": "npm:[email protected]60a927d04-20240113",
200+
"react-builtin": "npm:[email protected]4b84f1161-20240318",
201201
"react-dom": "18.2.0",
202202
"react-dom-17": "npm:[email protected]",
203-
"react-dom-builtin": "npm:[email protected]60a927d04-20240113",
204-
"react-dom-experimental-builtin": "npm:[email protected]60a927d04-20240113",
205-
"react-experimental-builtin": "npm:[email protected]60a927d04-20240113",
206-
"react-server-dom-turbopack": "18.3.0-canary-60a927d04-20240113",
207-
"react-server-dom-turbopack-experimental": "npm:[email protected]60a927d04-20240113",
208-
"react-server-dom-webpack": "18.3.0-canary-60a927d04-20240113",
209-
"react-server-dom-webpack-experimental": "npm:[email protected]60a927d04-20240113",
203+
"react-dom-builtin": "npm:[email protected]4b84f1161-20240318",
204+
"react-dom-experimental-builtin": "npm:[email protected]4b84f1161-20240318",
205+
"react-experimental-builtin": "npm:[email protected]4b84f1161-20240318",
206+
"react-server-dom-turbopack": "18.3.0-canary-4b84f1161-20240318",
207+
"react-server-dom-turbopack-experimental": "npm:[email protected]4b84f1161-20240318",
208+
"react-server-dom-webpack": "18.3.0-canary-4b84f1161-20240318",
209+
"react-server-dom-webpack-experimental": "npm:[email protected]4b84f1161-20240318",
210210
"react-ssr-prepass": "1.0.8",
211211
"react-virtualized": "9.22.3",
212212
"relay-compiler": "13.0.2",
@@ -216,8 +216,8 @@
216216
"resolve-from": "5.0.0",
217217
"sass": "1.54.0",
218218
"satori": "0.10.9",
219-
"scheduler-builtin": "npm:[email protected]60a927d04-20240113",
220-
"scheduler-experimental-builtin": "npm:[email protected]60a927d04-20240113",
219+
"scheduler-builtin": "npm:[email protected]4b84f1161-20240318",
220+
"scheduler-experimental-builtin": "npm:[email protected]4b84f1161-20240318",
221221
"seedrandom": "3.0.5",
222222
"selenium-webdriver": "4.0.0-beta.4",
223223
"semver": "7.3.7",

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

Lines changed: 2 additions & 5 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-60a927d04-20240113';
20+
var ReactVersion = '18.3.0-experimental-4b84f1161-20240318';
2121

2222
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
2323

@@ -186,9 +186,6 @@ function stringToChunk(content) {
186186
function stringToPrecomputedChunk(content) {
187187
return content;
188188
}
189-
function clonePrecomputedChunk(chunk) {
190-
return chunk;
191-
}
192189
function closeWithError(destination, error) {
193190
// $FlowFixMe[incompatible-call]: This is an Error object or the destination accepts other types.
194191
destination.destroy(error);
@@ -4730,7 +4727,7 @@ function writeCompletedBoundaryInstruction(destination, resumableState, renderSt
47304727
if (requiresStyleInsertion) {
47314728
if ((resumableState.instructions & SentCompleteBoundaryFunction) === NothingSent) {
47324729
resumableState.instructions |= SentStyleInsertionFunction | SentCompleteBoundaryFunction;
4733-
writeChunk(destination, clonePrecomputedChunk(completeBoundaryWithStylesScript1FullBoth));
4730+
writeChunk(destination, completeBoundaryWithStylesScript1FullBoth);
47344731
} else if ((resumableState.instructions & SentStyleInsertionFunction) === NothingSent) {
47354732
resumableState.instructions |= SentStyleInsertionFunction;
47364733
writeChunk(destination, completeBoundaryWithStylesScript1FullPartial);

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function formatProdErrorMessage(code) {
2626
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.';
2727
}
2828

29-
var ReactVersion = '18.3.0-experimental-60a927d04-20240113';
29+
var ReactVersion = '18.3.0-experimental-4b84f1161-20240318';
3030

3131
// A pure JS implementation of a string hashing function. We do not use it for
3232
// security or obfuscation purposes, only to create compact hashes. So we
@@ -140,9 +140,6 @@ function stringToChunk(content) {
140140
function stringToPrecomputedChunk(content) {
141141
return content;
142142
}
143-
function clonePrecomputedChunk(chunk) {
144-
return chunk;
145-
}
146143
function closeWithError(destination, error) {
147144
// $FlowFixMe[incompatible-call]: This is an Error object or the destination accepts other types.
148145
destination.destroy(error);
@@ -3116,7 +3113,7 @@ function writeCompletedBoundaryInstruction(destination, resumableState, renderSt
31163113
if (requiresStyleInsertion) {
31173114
if ((resumableState.instructions & SentCompleteBoundaryFunction) === NothingSent) {
31183115
resumableState.instructions |= SentStyleInsertionFunction | SentCompleteBoundaryFunction;
3119-
writeChunk(destination, clonePrecomputedChunk(completeBoundaryWithStylesScript1FullBoth));
3116+
writeChunk(destination, completeBoundaryWithStylesScript1FullBoth);
31203117
} else if ((resumableState.instructions & SentStyleInsertionFunction) === NothingSent) {
31213118
resumableState.instructions |= SentStyleInsertionFunction;
31223119
writeChunk(destination, completeBoundaryWithStylesScript1FullPartial);

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

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var React = require("next/dist/compiled/react-experimental");
1818
var ReactDOM = require('react-dom');
1919
var stream = require('stream');
2020

21-
var ReactVersion = '18.3.0-experimental-60a927d04-20240113';
21+
var ReactVersion = '18.3.0-experimental-4b84f1161-20240318';
2222

2323
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
2424

@@ -187,9 +187,6 @@ function stringToChunk(content) {
187187
function stringToPrecomputedChunk(content) {
188188
return content;
189189
}
190-
function clonePrecomputedChunk(chunk) {
191-
return chunk;
192-
}
193190
function closeWithError(destination, error) {
194191
// $FlowFixMe[incompatible-call]: This is an Error object or the destination accepts other types.
195192
destination.destroy(error);
@@ -4731,7 +4728,7 @@ function writeCompletedBoundaryInstruction(destination, resumableState, renderSt
47314728
if (requiresStyleInsertion) {
47324729
if ((resumableState.instructions & SentCompleteBoundaryFunction) === NothingSent) {
47334730
resumableState.instructions |= SentStyleInsertionFunction | SentCompleteBoundaryFunction;
4734-
writeChunk(destination, clonePrecomputedChunk(completeBoundaryWithStylesScript1FullBoth));
4731+
writeChunk(destination, completeBoundaryWithStylesScript1FullBoth);
47354732
} else if ((resumableState.instructions & SentStyleInsertionFunction) === NothingSent) {
47364733
resumableState.instructions |= SentStyleInsertionFunction;
47374734
writeChunk(destination, completeBoundaryWithStylesScript1FullPartial);

packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var React = require("next/dist/compiled/react-experimental");
1414
var ReactDOM = require('react-dom');
1515
var stream = require('stream');
1616

17-
var ReactVersion = '18.3.0-experimental-60a927d04-20240113';
17+
var ReactVersion = '18.3.0-experimental-4b84f1161-20240318';
1818

1919
// A pure JS implementation of a string hashing function. We do not use it for
2020
// security or obfuscation purposes, only to create compact hashes. So we
@@ -128,9 +128,6 @@ function stringToChunk(content) {
128128
function stringToPrecomputedChunk(content) {
129129
return content;
130130
}
131-
function clonePrecomputedChunk(chunk) {
132-
return chunk;
133-
}
134131
function closeWithError(destination, error) {
135132
// $FlowFixMe[incompatible-call]: This is an Error object or the destination accepts other types.
136133
destination.destroy(error);
@@ -3104,7 +3101,7 @@ function writeCompletedBoundaryInstruction(destination, resumableState, renderSt
31043101
if (requiresStyleInsertion) {
31053102
if ((resumableState.instructions & SentCompleteBoundaryFunction) === NothingSent) {
31063103
resumableState.instructions |= SentStyleInsertionFunction | SentCompleteBoundaryFunction;
3107-
writeChunk(destination, clonePrecomputedChunk(completeBoundaryWithStylesScript1FullBoth));
3104+
writeChunk(destination, completeBoundaryWithStylesScript1FullBoth);
31083105
} else if ((resumableState.instructions & SentStyleInsertionFunction) === NothingSent) {
31093106
resumableState.instructions |= SentStyleInsertionFunction;
31103107
writeChunk(destination, completeBoundaryWithStylesScript1FullPartial);

packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-rendering-stub.development.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function printWarning(level, format, args) {
5555
}
5656
}
5757

58-
var ReactVersion = '18.3.0-experimental-60a927d04-20240113';
58+
var ReactVersion = '18.3.0-experimental-4b84f1161-20240318';
5959

6060
var Internals = {
6161
usingClientEntryPoint: false,

packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-rendering-stub.production.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
var React = require("next/dist/compiled/react-experimental");
1414

15-
var ReactVersion = '18.3.0-experimental-60a927d04-20240113';
15+
var ReactVersion = '18.3.0-experimental-4b84f1161-20240318';
1616

1717
const Internals = {
1818
usingClientEntryPoint: false,

packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-rendering-stub.production.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 7 additions & 15 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-60a927d04-20240113';
20+
var ReactVersion = '18.3.0-experimental-4b84f1161-20240318';
2121

2222
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
2323

@@ -169,7 +169,7 @@ function murmurhash3_32_gc(key, seed) {
169169
function scheduleWork(callback) {
170170
callback();
171171
}
172-
var VIEW_SIZE = 512;
172+
var VIEW_SIZE = 2048;
173173
var currentView = null;
174174
var writtenBytes = 0;
175175
function beginWriting(destination) {
@@ -182,15 +182,9 @@ function writeChunk(destination, chunk) {
182182
}
183183

184184
if (chunk.byteLength > VIEW_SIZE) {
185-
{
186-
if (precomputedChunkSet.has(chunk)) {
187-
error('A large precomputed chunk was passed to writeChunk without being copied.' + ' Large chunks get enqueued directly and are not copied. This is incompatible with precomputed chunks because you cannot enqueue the same precomputed chunk twice.' + ' Use "cloneChunk" to make a copy of this large precomputed chunk before writing it. This is a bug in React.');
188-
}
189-
} // this chunk may overflow a single view which implies it was not
185+
// this chunk may overflow a single view which implies it was not
190186
// one that is cached by the streaming renderer. We will enqueu
191187
// it directly and expect it is not re-used
192-
193-
194188
if (writtenBytes > 0) {
195189
destination.enqueue(new Uint8Array(currentView.buffer, 0, writtenBytes));
196190
currentView = new Uint8Array(VIEW_SIZE);
@@ -245,19 +239,17 @@ var textEncoder = new TextEncoder();
245239
function stringToChunk(content) {
246240
return textEncoder.encode(content);
247241
}
248-
var precomputedChunkSet = new Set() ;
249242
function stringToPrecomputedChunk(content) {
250243
var precomputedChunk = textEncoder.encode(content);
251244

252245
{
253-
precomputedChunkSet.add(precomputedChunk);
246+
if (precomputedChunk.byteLength > VIEW_SIZE) {
247+
error('precomputed chunks must be smaller than the view size configured for this host. This is a bug in React.');
248+
}
254249
}
255250

256251
return precomputedChunk;
257252
}
258-
function clonePrecomputedChunk(precomputedChunk) {
259-
return precomputedChunk.byteLength > VIEW_SIZE ? precomputedChunk.slice() : precomputedChunk;
260-
}
261253
function closeWithError(destination, error) {
262254
// $FlowFixMe[method-unbinding]
263255
if (typeof destination.error === 'function') {
@@ -4838,7 +4830,7 @@ function writeCompletedBoundaryInstruction(destination, resumableState, renderSt
48384830
if (requiresStyleInsertion) {
48394831
if ((resumableState.instructions & SentCompleteBoundaryFunction) === NothingSent) {
48404832
resumableState.instructions |= SentStyleInsertionFunction | SentCompleteBoundaryFunction;
4841-
writeChunk(destination, clonePrecomputedChunk(completeBoundaryWithStylesScript1FullBoth));
4833+
writeChunk(destination, completeBoundaryWithStylesScript1FullBoth);
48424834
} else if ((resumableState.instructions & SentStyleInsertionFunction) === NothingSent) {
48434835
resumableState.instructions |= SentStyleInsertionFunction;
48444836
writeChunk(destination, completeBoundaryWithStylesScript1FullPartial);

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
var React = require("next/dist/compiled/react-experimental");
1414
var ReactDOM = require('react-dom');
1515

16-
var ReactVersion = '18.3.0-experimental-60a927d04-20240113';
16+
var ReactVersion = '18.3.0-experimental-4b84f1161-20240318';
1717

1818
// Do not require this module directly! Use normal `invariant` calls with
1919
// template literal strings. The messages will be replaced with error codes
@@ -123,7 +123,7 @@ function murmurhash3_32_gc(key, seed) {
123123
function scheduleWork(callback) {
124124
callback();
125125
}
126-
const VIEW_SIZE = 512;
126+
const VIEW_SIZE = 2048;
127127
let currentView = null;
128128
let writtenBytes = 0;
129129
function beginWriting(destination) {
@@ -136,10 +136,9 @@ function writeChunk(destination, chunk) {
136136
}
137137

138138
if (chunk.byteLength > VIEW_SIZE) {
139+
// this chunk may overflow a single view which implies it was not
139140
// one that is cached by the streaming renderer. We will enqueu
140141
// it directly and expect it is not re-used
141-
142-
143142
if (writtenBytes > 0) {
144143
destination.enqueue(new Uint8Array(currentView.buffer, 0, writtenBytes));
145144
currentView = new Uint8Array(VIEW_SIZE);
@@ -199,9 +198,6 @@ function stringToPrecomputedChunk(content) {
199198

200199
return precomputedChunk;
201200
}
202-
function clonePrecomputedChunk(precomputedChunk) {
203-
return precomputedChunk.byteLength > VIEW_SIZE ? precomputedChunk.slice() : precomputedChunk;
204-
}
205201
function closeWithError(destination, error) {
206202
// $FlowFixMe[method-unbinding]
207203
if (typeof destination.error === 'function') {
@@ -3216,7 +3212,7 @@ function writeCompletedBoundaryInstruction(destination, resumableState, renderSt
32163212
if (requiresStyleInsertion) {
32173213
if ((resumableState.instructions & SentCompleteBoundaryFunction) === NothingSent) {
32183214
resumableState.instructions |= SentStyleInsertionFunction | SentCompleteBoundaryFunction;
3219-
writeChunk(destination, clonePrecomputedChunk(completeBoundaryWithStylesScript1FullBoth));
3215+
writeChunk(destination, completeBoundaryWithStylesScript1FullBoth);
32203216
} else if ((resumableState.instructions & SentStyleInsertionFunction) === NothingSent) {
32213217
resumableState.instructions |= SentStyleInsertionFunction;
32223218
writeChunk(destination, completeBoundaryWithStylesScript1FullPartial);

0 commit comments

Comments
 (0)