Skip to content

Commit

Permalink
(backport) Update React from 60a927d04 to 4b84f1161 (#63476)
Browse files Browse the repository at this point in the history
Updates React from 60a927d04 to 4b84f1161.

### React upstream changes

- facebook/react#28585

Closes NEXT-2865
  • Loading branch information
ztanner authored Mar 19, 2024
1 parent c227315 commit e6a117b
Show file tree
Hide file tree
Showing 111 changed files with 404 additions and 638 deletions.
20 changes: 10 additions & 10 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-60a927d04-20240113",
"react-builtin": "npm:react@18.3.0-canary-4b84f1161-20240318",
"react-dom": "18.2.0",
"react-dom-17": "npm:react-dom@17.0.2",
"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-dom-builtin": "npm:react-dom@18.3.0-canary-4b84f1161-20240318",
"react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-4b84f1161-20240318",
"react-experimental-builtin": "npm:react@0.0.0-experimental-4b84f1161-20240318",
"react-server-dom-turbopack": "18.3.0-canary-4b84f1161-20240318",
"react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-4b84f1161-20240318",
"react-server-dom-webpack": "18.3.0-canary-4b84f1161-20240318",
"react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-4b84f1161-20240318",
"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-60a927d04-20240113",
"scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-60a927d04-20240113",
"scheduler-builtin": "npm:scheduler@0.24.0-canary-4b84f1161-20240318",
"scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-4b84f1161-20240318",
"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-60a927d04-20240113';
var ReactVersion = '18.3.0-experimental-4b84f1161-20240318';

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

Expand Down Expand Up @@ -186,9 +186,6 @@ function stringToChunk(content) {
function stringToPrecomputedChunk(content) {
return content;
}
function clonePrecomputedChunk(chunk) {
return chunk;
}
function closeWithError(destination, error) {
// $FlowFixMe[incompatible-call]: This is an Error object or the destination accepts other types.
destination.destroy(error);
Expand Down Expand Up @@ -4730,7 +4727,7 @@ function writeCompletedBoundaryInstruction(destination, resumableState, renderSt
if (requiresStyleInsertion) {
if ((resumableState.instructions & SentCompleteBoundaryFunction) === NothingSent) {
resumableState.instructions |= SentStyleInsertionFunction | SentCompleteBoundaryFunction;
writeChunk(destination, clonePrecomputedChunk(completeBoundaryWithStylesScript1FullBoth));
writeChunk(destination, completeBoundaryWithStylesScript1FullBoth);
} else if ((resumableState.instructions & SentStyleInsertionFunction) === NothingSent) {
resumableState.instructions |= SentStyleInsertionFunction;
writeChunk(destination, completeBoundaryWithStylesScript1FullPartial);
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-60a927d04-20240113';
var ReactVersion = '18.3.0-experimental-4b84f1161-20240318';

// 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 @@ -140,9 +140,6 @@ function stringToChunk(content) {
function stringToPrecomputedChunk(content) {
return content;
}
function clonePrecomputedChunk(chunk) {
return chunk;
}
function closeWithError(destination, error) {
// $FlowFixMe[incompatible-call]: This is an Error object or the destination accepts other types.
destination.destroy(error);
Expand Down Expand Up @@ -3116,7 +3113,7 @@ function writeCompletedBoundaryInstruction(destination, resumableState, renderSt
if (requiresStyleInsertion) {
if ((resumableState.instructions & SentCompleteBoundaryFunction) === NothingSent) {
resumableState.instructions |= SentStyleInsertionFunction | SentCompleteBoundaryFunction;
writeChunk(destination, clonePrecomputedChunk(completeBoundaryWithStylesScript1FullBoth));
writeChunk(destination, completeBoundaryWithStylesScript1FullBoth);
} else if ((resumableState.instructions & SentStyleInsertionFunction) === NothingSent) {
resumableState.instructions |= SentStyleInsertionFunction;
writeChunk(destination, completeBoundaryWithStylesScript1FullPartial);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var React = require("next/dist/compiled/react-experimental");
var ReactDOM = require('react-dom');
var stream = require('stream');

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

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

Expand Down Expand Up @@ -187,9 +187,6 @@ function stringToChunk(content) {
function stringToPrecomputedChunk(content) {
return content;
}
function clonePrecomputedChunk(chunk) {
return chunk;
}
function closeWithError(destination, error) {
// $FlowFixMe[incompatible-call]: This is an Error object or the destination accepts other types.
destination.destroy(error);
Expand Down Expand Up @@ -4731,7 +4728,7 @@ function writeCompletedBoundaryInstruction(destination, resumableState, renderSt
if (requiresStyleInsertion) {
if ((resumableState.instructions & SentCompleteBoundaryFunction) === NothingSent) {
resumableState.instructions |= SentStyleInsertionFunction | SentCompleteBoundaryFunction;
writeChunk(destination, clonePrecomputedChunk(completeBoundaryWithStylesScript1FullBoth));
writeChunk(destination, completeBoundaryWithStylesScript1FullBoth);
} else if ((resumableState.instructions & SentStyleInsertionFunction) === NothingSent) {
resumableState.instructions |= SentStyleInsertionFunction;
writeChunk(destination, completeBoundaryWithStylesScript1FullPartial);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var React = require("next/dist/compiled/react-experimental");
var ReactDOM = require('react-dom');
var stream = require('stream');

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

// 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 @@ -128,9 +128,6 @@ function stringToChunk(content) {
function stringToPrecomputedChunk(content) {
return content;
}
function clonePrecomputedChunk(chunk) {
return chunk;
}
function closeWithError(destination, error) {
// $FlowFixMe[incompatible-call]: This is an Error object or the destination accepts other types.
destination.destroy(error);
Expand Down Expand Up @@ -3104,7 +3101,7 @@ function writeCompletedBoundaryInstruction(destination, resumableState, renderSt
if (requiresStyleInsertion) {
if ((resumableState.instructions & SentCompleteBoundaryFunction) === NothingSent) {
resumableState.instructions |= SentStyleInsertionFunction | SentCompleteBoundaryFunction;
writeChunk(destination, clonePrecomputedChunk(completeBoundaryWithStylesScript1FullBoth));
writeChunk(destination, completeBoundaryWithStylesScript1FullBoth);
} else if ((resumableState.instructions & SentStyleInsertionFunction) === NothingSent) {
resumableState.instructions |= SentStyleInsertionFunction;
writeChunk(destination, completeBoundaryWithStylesScript1FullPartial);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function printWarning(level, format, args) {
}
}

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

var Internals = {
usingClientEntryPoint: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

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

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

const Internals = {
usingClientEntryPoint: false,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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-60a927d04-20240113';
var ReactVersion = '18.3.0-experimental-4b84f1161-20240318';

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

Expand Down Expand Up @@ -169,7 +169,7 @@ function murmurhash3_32_gc(key, seed) {
function scheduleWork(callback) {
callback();
}
var VIEW_SIZE = 512;
var VIEW_SIZE = 2048;
var currentView = null;
var writtenBytes = 0;
function beginWriting(destination) {
Expand All @@ -182,15 +182,9 @@ function writeChunk(destination, chunk) {
}

if (chunk.byteLength > VIEW_SIZE) {
{
if (precomputedChunkSet.has(chunk)) {
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.');
}
} // this chunk may overflow a single view which implies it was not
// this chunk may overflow a single view which implies it was not
// one that is cached by the streaming renderer. We will enqueu
// it directly and expect it is not re-used


if (writtenBytes > 0) {
destination.enqueue(new Uint8Array(currentView.buffer, 0, writtenBytes));
currentView = new Uint8Array(VIEW_SIZE);
Expand Down Expand Up @@ -245,19 +239,17 @@ var textEncoder = new TextEncoder();
function stringToChunk(content) {
return textEncoder.encode(content);
}
var precomputedChunkSet = new Set() ;
function stringToPrecomputedChunk(content) {
var precomputedChunk = textEncoder.encode(content);

{
precomputedChunkSet.add(precomputedChunk);
if (precomputedChunk.byteLength > VIEW_SIZE) {
error('precomputed chunks must be smaller than the view size configured for this host. This is a bug in React.');
}
}

return precomputedChunk;
}
function clonePrecomputedChunk(precomputedChunk) {
return precomputedChunk.byteLength > VIEW_SIZE ? precomputedChunk.slice() : precomputedChunk;
}
function closeWithError(destination, error) {
// $FlowFixMe[method-unbinding]
if (typeof destination.error === 'function') {
Expand Down Expand Up @@ -4838,7 +4830,7 @@ function writeCompletedBoundaryInstruction(destination, resumableState, renderSt
if (requiresStyleInsertion) {
if ((resumableState.instructions & SentCompleteBoundaryFunction) === NothingSent) {
resumableState.instructions |= SentStyleInsertionFunction | SentCompleteBoundaryFunction;
writeChunk(destination, clonePrecomputedChunk(completeBoundaryWithStylesScript1FullBoth));
writeChunk(destination, completeBoundaryWithStylesScript1FullBoth);
} else if ((resumableState.instructions & SentStyleInsertionFunction) === NothingSent) {
resumableState.instructions |= SentStyleInsertionFunction;
writeChunk(destination, completeBoundaryWithStylesScript1FullPartial);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
var React = require("next/dist/compiled/react-experimental");
var ReactDOM = require('react-dom');

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

// Do not require this module directly! Use normal `invariant` calls with
// template literal strings. The messages will be replaced with error codes
Expand Down Expand Up @@ -123,7 +123,7 @@ function murmurhash3_32_gc(key, seed) {
function scheduleWork(callback) {
callback();
}
const VIEW_SIZE = 512;
const VIEW_SIZE = 2048;
let currentView = null;
let writtenBytes = 0;
function beginWriting(destination) {
Expand All @@ -136,10 +136,9 @@ function writeChunk(destination, chunk) {
}

if (chunk.byteLength > VIEW_SIZE) {
// this chunk may overflow a single view which implies it was not
// one that is cached by the streaming renderer. We will enqueu
// it directly and expect it is not re-used


if (writtenBytes > 0) {
destination.enqueue(new Uint8Array(currentView.buffer, 0, writtenBytes));
currentView = new Uint8Array(VIEW_SIZE);
Expand Down Expand Up @@ -199,9 +198,6 @@ function stringToPrecomputedChunk(content) {

return precomputedChunk;
}
function clonePrecomputedChunk(precomputedChunk) {
return precomputedChunk.byteLength > VIEW_SIZE ? precomputedChunk.slice() : precomputedChunk;
}
function closeWithError(destination, error) {
// $FlowFixMe[method-unbinding]
if (typeof destination.error === 'function') {
Expand Down Expand Up @@ -3216,7 +3212,7 @@ function writeCompletedBoundaryInstruction(destination, resumableState, renderSt
if (requiresStyleInsertion) {
if ((resumableState.instructions & SentCompleteBoundaryFunction) === NothingSent) {
resumableState.instructions |= SentStyleInsertionFunction | SentCompleteBoundaryFunction;
writeChunk(destination, clonePrecomputedChunk(completeBoundaryWithStylesScript1FullBoth));
writeChunk(destination, completeBoundaryWithStylesScript1FullBoth);
} else if ((resumableState.instructions & SentStyleInsertionFunction) === NothingSent) {
resumableState.instructions |= SentStyleInsertionFunction;
writeChunk(destination, completeBoundaryWithStylesScript1FullPartial);
Expand Down
Loading

0 comments on commit e6a117b

Please sign in to comment.