Unverified Commit 287e379b authored by Shu Ding's avatar Shu Ding Committed by GitHub

Vendor `react@experimental` (#48697)

Part of #47759 (which had been reverted twice so here we only land a part of the change), relates to NEXT-926. Thanks to #48506 we can soon switch between these two channels during runtime.

Also fixes a problem of `renderKind` (only revealed after upgrading React), it should be also based on the `match` kind.
parent f08cab3b
...@@ -196,10 +196,12 @@ ...@@ -196,10 +196,12 @@
"random-seed": "0.3.0", "random-seed": "0.3.0",
"react": "18.2.0", "react": "18.2.0",
"react-17": "npm:react@17.0.2", "react-17": "npm:react@17.0.2",
"react-builtin": "npm:react@18.3.0-next-1f248bdd7-20230419", "react-builtin": "npm:react@18.3.0-next-c8369527e-20230420",
"react-experimental-builtin": "npm:react@0.0.0-experimental-c8369527e-20230420",
"react-dom": "18.2.0", "react-dom": "18.2.0",
"react-dom-17": "npm:react-dom@17.0.2", "react-dom-17": "npm:react-dom@17.0.2",
"react-dom-builtin": "npm:react-dom@18.3.0-next-1f248bdd7-20230419", "react-dom-builtin": "npm:react-dom@18.3.0-next-c8369527e-20230420",
"react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-c8369527e-20230420",
"react-server-dom-webpack": "18.3.0-next-1f248bdd7-20230419", "react-server-dom-webpack": "18.3.0-next-1f248bdd7-20230419",
"react-ssr-prepass": "1.0.8", "react-ssr-prepass": "1.0.8",
"react-virtualized": "9.22.3", "react-virtualized": "9.22.3",
...@@ -211,6 +213,8 @@ ...@@ -211,6 +213,8 @@
"rimraf": "3.0.2", "rimraf": "3.0.2",
"sass": "1.54.0", "sass": "1.54.0",
"satori": "0.4.4", "satori": "0.4.4",
"scheduler-builtin": "npm:scheduler@0.24.0-next-c8369527e-20230420",
"scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-c8369527e-20230420",
"seedrandom": "3.0.5", "seedrandom": "3.0.5",
"selenium-webdriver": "4.0.0-beta.4", "selenium-webdriver": "4.0.0-beta.4",
"semver": "7.3.7", "semver": "7.3.7",
......
...@@ -1943,6 +1943,25 @@ if (!process.env.NEXT_MANUAL_SIG_HANDLE) { ...@@ -1943,6 +1943,25 @@ if (!process.env.NEXT_MANUAL_SIG_HANDLE) {
let handler let handler
const currentPort = parseInt(process.env.PORT, 10) || 3000
const hostname = process.env.HOSTNAME || 'localhost'
const keepAliveTimeout = parseInt(process.env.KEEP_ALIVE_TIMEOUT, 10);
const nextConfig = ${JSON.stringify({
...serverConfig,
distDir: `./${path.relative(dir, distDir)}`,
})}
${
// In standalone mode, we don't have separated render workers so if both
// app and pages are used, we need to resolve to the prebundled React
// to ensure the correctness of the version for app.
`\
if (nextConfig && nextConfig.experimental && nextConfig.experimental.appDir) {
process.env.__NEXT_PRIVATE_PREBUNDLED_REACT = '1'
}
`
}
const server = http.createServer(async (req, res) => { const server = http.createServer(async (req, res) => {
try { try {
await handler(req, res) await handler(req, res)
...@@ -1952,9 +1971,6 @@ const server = http.createServer(async (req, res) => { ...@@ -1952,9 +1971,6 @@ const server = http.createServer(async (req, res) => {
res.end('internal server error') res.end('internal server error')
} }
}) })
const currentPort = parseInt(process.env.PORT, 10) || 3000
const hostname = process.env.HOSTNAME || 'localhost'
const keepAliveTimeout = parseInt(process.env.KEEP_ALIVE_TIMEOUT, 10);
if ( if (
!Number.isNaN(keepAliveTimeout) && !Number.isNaN(keepAliveTimeout) &&
...@@ -1974,10 +1990,7 @@ server.listen(currentPort, (err) => { ...@@ -1974,10 +1990,7 @@ server.listen(currentPort, (err) => {
dir: path.join(__dirname), dir: path.join(__dirname),
dev: false, dev: false,
customServer: false, customServer: false,
conf: ${JSON.stringify({ conf: nextConfig,
...serverConfig,
distDir: `./${path.relative(dir, distDir)}`,
})},
}) })
handler = nextServer.getRequestHandler() handler = nextServer.getRequestHandler()
......
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
/**
* @license React
* react-dom-server-rendering-stub.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
if (process.env.NODE_ENV !== "production") {
(function() {
'use strict';
var ReactVersion = '18.3.0-experimental-c8369527e-20230420';
var Internals = {
usingClientEntryPoint: false,
Events: null,
Dispatcher: {
current: null
}
};
function prefetchDNS() {
var dispatcher = Internals.Dispatcher.current;
if (dispatcher) {
dispatcher.prefetchDNS.apply(this, arguments);
} // We don't error because preconnect needs to be resilient to being called in a variety of scopes
// and the runtime may not be capable of responding. The function is optimistic and not critical
// so we favor silent bailout over warning or erroring.
}
function preconnect() {
var dispatcher = Internals.Dispatcher.current;
if (dispatcher) {
dispatcher.preconnect.apply(this, arguments);
} // We don't error because preconnect needs to be resilient to being called in a variety of scopes
// and the runtime may not be capable of responding. The function is optimistic and not critical
// so we favor silent bailout over warning or erroring.
}
function preload() {
var dispatcher = Internals.Dispatcher.current;
if (dispatcher) {
dispatcher.preload.apply(this, arguments);
} // We don't error because preload needs to be resilient to being called in a variety of scopes
// and the runtime may not be capable of responding. The function is optimistic and not critical
// so we favor silent bailout over warning or erroring.
}
function preinit() {
var dispatcher = Internals.Dispatcher.current;
if (dispatcher) {
dispatcher.preinit.apply(this, arguments);
} // We don't error because preinit needs to be resilient to being called in a variety of scopes
// and the runtime may not be capable of responding. The function is optimistic and not critical
// so we favor silent bailout over warning or erroring.
}
function createPortal() {
throw new Error('createPortal was called on the server. Portals are not currently' + ' supported on the server. Update your program to conditionally call' + ' createPortal on the client only.');
}
function flushSync() {
throw new Error('flushSync was called on the server. This is likely caused by a' + ' function being called during render or in module scope that was' + ' intended to be called from an effect or event handler. Update your' + ' to not call flushSync no the server.');
}
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
exports.createPortal = createPortal;
exports.flushSync = flushSync;
exports.preconnect = preconnect;
exports.prefetchDNS = prefetchDNS;
exports.preinit = preinit;
exports.preload = preload;
exports.version = ReactVersion;
})();
}
/**
* @license React
* react-dom-server-rendering-stub.production.min.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';var b={usingClientEntryPoint:!1,Events:null,Dispatcher:{current:null}};function d(a){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)e+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=b;
exports.createPortal=function(){throw Error(d(448));};exports.flushSync=function(){throw Error(d(449));};exports.preconnect=function(){var a=b.Dispatcher.current;a&&a.preconnect.apply(this,arguments)};exports.prefetchDNS=function(){var a=b.Dispatcher.current;a&&a.prefetchDNS.apply(this,arguments)};exports.preinit=function(){var a=b.Dispatcher.current;a&&a.preinit.apply(this,arguments)};exports.preload=function(){var a=b.Dispatcher.current;a&&a.preload.apply(this,arguments)};exports.version="18.3.0-experimental-c8369527e-20230420";
'use strict';
var m = require('react-dom');
if (process.env.NODE_ENV === 'production') {
exports.createRoot = m.createRoot;
exports.hydrateRoot = m.hydrateRoot;
} else {
var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
exports.createRoot = function (c, o) {
i.usingClientEntryPoint = true;
try {
return m.createRoot(c, o);
} finally {
i.usingClientEntryPoint = false;
}
};
exports.hydrateRoot = function (c, h, o) {
i.usingClientEntryPoint = true;
try {
return m.hydrateRoot(c, h, o);
} finally {
i.usingClientEntryPoint = false;
}
};
}
'use strict';
function checkDCE() {
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
) {
return;
}
if (process.env.NODE_ENV !== 'production') {
// This branch is unreachable because this function is only called
// in production, but the condition is true only in development.
// Therefore if the branch is still here, dead code elimination wasn't
// properly applied.
// Don't change the message. React DevTools relies on it. Also make sure
// this message doesn't occur elsewhere in this function, or it will cause
// a false positive.
throw new Error('^_^');
}
try {
// Verify that the code above has been dead code eliminated (DCE'd).
__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
} catch (err) {
// DevTools shouldn't crash React, no matter what.
// We should still report in case we break this code.
console.error(err);
}
}
if (process.env.NODE_ENV === 'production') {
// DCE check should happen before ReactDOM bundle executes so that
// DevTools can report bad minification during injection.
checkDCE();
module.exports = require('./cjs/react-dom.production.min.js');
} else {
module.exports = require('./cjs/react-dom.development.js');
}
{
"name": "react-dom-experimental-builtin",
"main": "index.js",
"exports": {
".": "./index.js",
"./client": "./client.js",
"./server": {
"workerd": "./server.edge.js",
"edge-light": "./server.edge.js",
"bun": "./server.bun.js",
"deno": "./server.browser.js",
"worker": "./server.browser.js",
"browser": "./server.browser.js",
"default": "./server.node.js"
},
"./server.browser": "./server.browser.js",
"./server.bun": "./server.bun.js",
"./server.edge": "./server.edge.js",
"./server.node": "./server.node.js",
"./static": {
"workerd": "./static.edge.js",
"edge-light": "./static.edge.js",
"deno": "./static.browser.js",
"worker": "./static.browser.js",
"browser": "./static.browser.js",
"default": "./static.node.js"
},
"./static.browser": "./static.browser.js",
"./static.edge": "./static.edge.js",
"./static.node": "./static.node.js",
"./server-rendering-stub": "./server-rendering-stub.js",
"./profiling": "./profiling.js",
"./test-utils": "./test-utils.js",
"./unstable_testing": "./unstable_testing.js",
"./unstable_server-external-runtime": "./unstable_server-external-runtime.js",
"./package.json": "./package.json"
},
"dependencies": {
"loose-envify": "^1.1.0",
"scheduler": "0.0.0-experimental-c8369527e-20230420"
},
"peerDependencies": {
"react": "0.0.0-experimental-c8369527e-20230420"
},
"browser": {
"./server.js": "./server.browser.js",
"./static.js": "./static.browser.js"
}
}
\ No newline at end of file
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-dom-server-rendering-stub.production.min.js');
} else {
module.exports = require('./cjs/react-dom-server-rendering-stub.development.js');
}
'use strict';
var l, s;
if (process.env.NODE_ENV === 'production') {
l = require('./cjs/react-dom-server-legacy.browser.production.min.js');
s = require('./cjs/react-dom-server.browser.production.min.js');
} else {
l = require('./cjs/react-dom-server-legacy.browser.development.js');
s = require('./cjs/react-dom-server.browser.development.js');
}
exports.version = l.version;
exports.renderToString = l.renderToString;
exports.renderToStaticMarkup = l.renderToStaticMarkup;
exports.renderToNodeStream = l.renderToNodeStream;
exports.renderToStaticNodeStream = l.renderToStaticNodeStream;
exports.renderToReadableStream = s.renderToReadableStream;
'use strict';
var b;
var l;
if (process.env.NODE_ENV === 'production') {
b = require('./cjs/react-dom-server.edge.production.min.js');
l = require('./cjs/react-dom-server-legacy.browser.production.min.js');
} else {
b = require('./cjs/react-dom-server.edge.development.js');
l = require('./cjs/react-dom-server-legacy.browser.development.js');
}
exports.version = b.version;
exports.renderToReadableStream = b.renderToReadableStream;
exports.renderToNodeStream = b.renderToNodeStream;
exports.renderToStaticNodeStream = b.renderToStaticNodeStream;
exports.renderToString = l.renderToString;
exports.renderToStaticMarkup = l.renderToStaticMarkup;
'use strict';
module.exports = require('./server.node');
'use strict';
var l, s;
if (process.env.NODE_ENV === 'production') {
l = require('./cjs/react-dom-server-legacy.node.production.min.js');
s = require('./cjs/react-dom-server.node.production.min.js');
} else {
l = require('./cjs/react-dom-server-legacy.node.development.js');
s = require('./cjs/react-dom-server.node.development.js');
}
exports.version = l.version;
exports.renderToString = l.renderToString;
exports.renderToStaticMarkup = l.renderToStaticMarkup;
exports.renderToNodeStream = l.renderToNodeStream;
exports.renderToStaticNodeStream = l.renderToStaticNodeStream;
exports.renderToPipeableStream = s.renderToPipeableStream;
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-dom-static.edge.production.min.js');
} else {
module.exports = require('./cjs/react-dom-static.edge.development.js');
}
...@@ -14,7 +14,7 @@ if (process.env.NODE_ENV !== "production") { ...@@ -14,7 +14,7 @@ if (process.env.NODE_ENV !== "production") {
(function() { (function() {
'use strict'; 'use strict';
var ReactVersion = '18.3.0-next-1f248bdd7-20230419'; var ReactVersion = '18.3.0-next-c8369527e-20230420';
var Internals = { var Internals = {
usingClientEntryPoint: false, usingClientEntryPoint: false,
......
...@@ -8,4 +8,4 @@ ...@@ -8,4 +8,4 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
'use strict';var b={usingClientEntryPoint:!1,Events:null,Dispatcher:{current:null}};function d(a){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)e+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=b; 'use strict';var b={usingClientEntryPoint:!1,Events:null,Dispatcher:{current:null}};function d(a){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)e+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=b;
exports.createPortal=function(){throw Error(d(448));};exports.flushSync=function(){throw Error(d(449));};exports.preconnect=function(){var a=b.Dispatcher.current;a&&a.preconnect.apply(this,arguments)};exports.prefetchDNS=function(){var a=b.Dispatcher.current;a&&a.prefetchDNS.apply(this,arguments)};exports.preinit=function(){var a=b.Dispatcher.current;a&&a.preinit.apply(this,arguments)};exports.preload=function(){var a=b.Dispatcher.current;a&&a.preload.apply(this,arguments)};exports.version="18.3.0-next-1f248bdd7-20230419"; exports.createPortal=function(){throw Error(d(448));};exports.flushSync=function(){throw Error(d(449));};exports.preconnect=function(){var a=b.Dispatcher.current;a&&a.preconnect.apply(this,arguments)};exports.prefetchDNS=function(){var a=b.Dispatcher.current;a&&a.prefetchDNS.apply(this,arguments)};exports.preinit=function(){var a=b.Dispatcher.current;a&&a.preinit.apply(this,arguments)};exports.preload=function(){var a=b.Dispatcher.current;a&&a.preload.apply(this,arguments)};exports.version="18.3.0-next-c8369527e-20230420";
{ {
"name": "react-dom", "name": "react-dom-builtin",
"version": "18.3.0-next-1f248bdd7-20230419",
"description": "React package for working with the DOM.",
"main": "index.js", "main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/facebook/react.git",
"directory": "packages/react-dom"
},
"keywords": [
"react"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/facebook/react/issues"
},
"homepage": "https://reactjs.org/",
"dependencies": {
"loose-envify": "^1.1.0",
"scheduler": "0.24.0-next-1f248bdd7-20230419"
},
"peerDependencies": {
"react": "18.3.0-next-1f248bdd7-20230419"
},
"files": [
"LICENSE",
"README.md",
"index.js",
"client.js",
"profiling.js",
"server.js",
"server.browser.js",
"server.edge.js",
"server.node.js",
"server.bun.js",
"server-rendering-stub.js",
"test-utils.js",
"unstable_server-external-runtime.js",
"cjs/",
"umd/"
],
"exports": { "exports": {
".": "./index.js", ".": "./index.js",
"./client": "./client.js", "./client": "./client.js",
...@@ -62,12 +23,14 @@ ...@@ -62,12 +23,14 @@
"./unstable_server-external-runtime": "./unstable_server-external-runtime.js", "./unstable_server-external-runtime": "./unstable_server-external-runtime.js",
"./package.json": "./package.json" "./package.json": "./package.json"
}, },
"dependencies": {
"loose-envify": "^1.1.0",
"scheduler": "0.24.0-next-c8369527e-20230420"
},
"peerDependencies": {
"react": "18.3.0-next-c8369527e-20230420"
},
"browser": { "browser": {
"./server.js": "./server.browser.js" "./server.js": "./server.browser.js"
},
"browserify": {
"transform": [
"loose-envify"
]
} }
} }
\ No newline at end of file
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
/**
* @license React
* react-jsx-dev-runtime.production.min.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';var a=Symbol.for("react.fragment");exports.Fragment=a;exports.jsxDEV=void 0;
/**
* @license React
* react-jsx-dev-runtime.profiling.min.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';var a=Symbol.for("react.fragment");exports.Fragment=a;exports.jsxDEV=void 0;
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';var f=require("next/dist/compiled/react-experimental"),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};
function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;
/**
* @license React
* react-jsx-runtime.profiling.min.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';var f=require("next/dist/compiled/react-experimental"),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};
function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react.production.min.js');
} else {
module.exports = require('./cjs/react.development.js');
}
This diff is collapsed.
This diff is collapsed.
...@@ -302,7 +302,7 @@ function generateCacheKey(request) { ...@@ -302,7 +302,7 @@ function generateCacheKey(request) {
} }
} }
var ReactVersion = '18.3.0-next-1f248bdd7-20230419'; var ReactVersion = '18.3.0-next-c8369527e-20230420';
// ATTENTION // ATTENTION
// When adding new symbols to this file, // When adding new symbols to this file,
......
This diff is collapsed.
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/scheduler.production.min.js');
} else {
module.exports = require('./cjs/scheduler.development.js');
}
This diff is collapsed.
{"name":"scheduler","main":"index.js","license":"MIT"} {
"name": "scheduler-builtin",
"main": "index.js",
"dependencies": {
"loose-envify": "^1.1.0"
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -12,21 +12,26 @@ const fetch = require('node-fetch') ...@@ -12,21 +12,26 @@ const fetch = require('node-fetch')
// Basic usage (defaults to most recent React canary version): // Basic usage (defaults to most recent React canary version):
// pnpm run sync-react // pnpm run sync-react
// //
// Specify a canary version:
// pnpm run sync-react --version 18.3.0-next-41110021f-20230301
//
// Update package.json but skip installing the dependencies automatically: // Update package.json but skip installing the dependencies automatically:
// pnpm run sync-react --no-install // pnpm run sync-react --no-install
async function main() { async function sync(channel = 'next') {
const noInstall = readBoolArg(process.argv, 'no-install') const noInstall = readBoolArg(process.argv, 'no-install')
const useExperimental = channel === 'experimental'
let newVersionStr = readStringArg(process.argv, 'version') let newVersionStr = readStringArg(process.argv, 'version')
if (newVersionStr === null) { if (newVersionStr === null) {
const { stdout, stderr } = await execa('npm', [ const { stdout, stderr } = await execa(
'npm',
[
'view', 'view',
'react@next', useExperimental ? 'react@experimental' : 'react@next',
'version', 'version',
]) ],
{
// Avoid "Usage Error: This project is configured to use pnpm".
cwd: '/tmp',
}
)
if (stderr) { if (stderr) {
console.error(stderr) console.error(stderr)
throw new Error('Failed to read latest React canary version from npm.') throw new Error('Failed to read latest React canary version from npm.')
...@@ -49,10 +54,9 @@ Or, run this command with no arguments to use the most recently published versio ...@@ -49,10 +54,9 @@ Or, run this command with no arguments to use the most recently published versio
const cwd = process.cwd() const cwd = process.cwd()
const pkgJson = await readJson(path.join(cwd, 'package.json')) const pkgJson = await readJson(path.join(cwd, 'package.json'))
const devDependencies = pkgJson.devDependencies const devDependencies = pkgJson.devDependencies
const baseVersionStr = devDependencies['react-builtin'].replace( const baseVersionStr = devDependencies[
/^npm:react@/, useExperimental ? 'react-experimental-builtin' : 'react-builtin'
'' ].replace(/^npm:react@/, '')
)
const baseVersionInfo = extractInfoFromReactCanaryVersion(baseVersionStr) const baseVersionInfo = extractInfoFromReactCanaryVersion(baseVersionStr)
if (!baseVersionInfo) { if (!baseVersionInfo) {
...@@ -64,7 +68,7 @@ Or, run this command with no arguments to use the most recently published versio ...@@ -64,7 +68,7 @@ Or, run this command with no arguments to use the most recently published versio
const { sha: newSha, dateString: newDateString } = newVersionInfo const { sha: newSha, dateString: newDateString } = newVersionInfo
const { sha: baseSha, dateString: baseDateString } = baseVersionInfo const { sha: baseSha, dateString: baseDateString } = baseVersionInfo
console.log(`Updating React to ${newSha}...\n`) console.log(`Updating "react@${channel}" to ${newSha}...\n`)
if (newSha === baseSha) { if (newSha === baseSha) {
console.log('Already up to date.') console.log('Already up to date.')
return return
...@@ -99,7 +103,7 @@ Or, run this command with no arguments to use the most recently published versio ...@@ -99,7 +103,7 @@ Or, run this command with no arguments to use the most recently published versio
} }
console.log('Building vendored React files...\n') console.log('Building vendored React files...\n')
const nccSubprocess = execa('pnpm', ['taskr', 'ncc'], { const nccSubprocess = execa('pnpm', ['taskr', 'copy_vendor_react'], {
cwd: path.join(cwd, 'packages', 'next'), cwd: path.join(cwd, 'packages', 'next'),
}) })
if (nccSubprocess.stdout) { if (nccSubprocess.stdout) {
...@@ -198,7 +202,9 @@ async function getChangelogFromGitHub(baseSha, newSha) { ...@@ -198,7 +202,9 @@ async function getChangelogFromGitHub(baseSha, newSha) {
return changelog.length > 0 ? changelog.join('\n') : null return changelog.length > 0 ? changelog.join('\n') : null
} }
main().catch((error) => { sync('next')
.then(() => sync('experimental'))
.catch((error) => {
console.error(error) console.error(error)
process.exit(1) process.exit(1)
}) })
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment