Unverified Commit 3a87e816 authored by Jiachi Liu's avatar Jiachi Liu Committed by GitHub

Disable using prebundled of react for appDir (#41635)

reverting https://github.com/vercel/next.js/pull/41337Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent 7796b1e5
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
"lint-staged": "lint-staged", "lint-staged": "lint-staged",
"next-with-deps": "./scripts/next-with-deps.sh", "next-with-deps": "./scripts/next-with-deps.sh",
"next": "node --trace-deprecation --enable-source-maps packages/next/dist/bin/next", "next": "node --trace-deprecation --enable-source-maps packages/next/dist/bin/next",
"next-react-exp": "__NEXT_REACT_CHANNEL=exp node --trace-deprecation --enable-source-maps -r ./test/lib/react-channel-require-hook.js packages/next/dist/bin/next",
"next-no-sourcemaps": "node --trace-deprecation packages/next/dist/bin/next", "next-no-sourcemaps": "node --trace-deprecation packages/next/dist/bin/next",
"clean-trace-jaeger": "rm -rf test/integration/basic/.next && TRACE_TARGET=JAEGER node --trace-deprecation --enable-source-maps packages/next/dist/bin/next build test/integration/basic", "clean-trace-jaeger": "rm -rf test/integration/basic/.next && TRACE_TARGET=JAEGER node --trace-deprecation --enable-source-maps packages/next/dist/bin/next build test/integration/basic",
"debug": "node --inspect packages/next/dist/bin/next", "debug": "node --inspect packages/next/dist/bin/next",
...@@ -180,6 +181,9 @@ ...@@ -180,6 +181,9 @@
"react-17": "npm:react@17.0.2", "react-17": "npm:react@17.0.2",
"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-exp": "npm:react@0.0.0-experimental-9cdf8a99e-20221018",
"react-dom-exp": "npm:react-dom@0.0.0-experimental-9cdf8a99e-20221018",
"react-server-dom-webpack": "0.0.0-experimental-9cdf8a99e-20221018",
"react-ssr-prepass": "1.0.8", "react-ssr-prepass": "1.0.8",
"react-virtualized": "9.22.3", "react-virtualized": "9.22.3",
"relay-compiler": "13.0.2", "relay-compiler": "13.0.2",
......
...@@ -303,7 +303,7 @@ export default async function build( ...@@ -303,7 +303,7 @@ export default async function build(
const publicDir = path.join(dir, 'public') const publicDir = path.join(dir, 'public')
const isAppDirEnabled = !!config.experimental.appDir const isAppDirEnabled = !!config.experimental.appDir
if (isAppDirEnabled) { if (isAppDirEnabled) {
process.env.HAS_APP_DIR = '1' process.env.NEXT_PREBUNDLED_REACT = '1'
} }
const { pagesDir, appDir } = findPagesDir(dir, isAppDirEnabled) const { pagesDir, appDir } = findPagesDir(dir, isAppDirEnabled)
......
...@@ -54,7 +54,7 @@ import { ...@@ -54,7 +54,7 @@ import {
} from './webpack/require-hook' } from './webpack/require-hook'
loadRequireHook() loadRequireHook()
if (process.env.HAS_APP_DIR) { if (process.env.NEXT_PREBUNDLED_REACT) {
overrideBuiltInReactPackages() overrideBuiltInReactPackages()
} }
......
...@@ -832,6 +832,9 @@ export default async function getBaseWebpackConfig( ...@@ -832,6 +832,9 @@ export default async function getBaseWebpackConfig(
[COMPILER_NAMES.edgeServer]: ['browser', 'module', 'main'], [COMPILER_NAMES.edgeServer]: ['browser', 'module', 'main'],
} }
const reactDir = path.dirname(require.resolve('react/package.json'))
const reactDomDir = path.dirname(require.resolve('react-dom/package.json'))
const resolveConfig = { const resolveConfig = {
// Disable .mjs for node_modules bundling // Disable .mjs for node_modules bundling
extensions: isNodeServer extensions: isNodeServer
...@@ -870,19 +873,25 @@ export default async function getBaseWebpackConfig( ...@@ -870,19 +873,25 @@ export default async function getBaseWebpackConfig(
next: NEXT_PROJECT_ROOT, next: NEXT_PROJECT_ROOT,
...(hasServerComponents // Disable until pre-bundling is landed
? { // ...(hasServerComponents
// For react and react-dom, alias them dynamically for server layer // ? {
// and others in the loaders configuration // // For react and react-dom, alias them dynamically for server layer
'react-dom/client$': 'next/dist/compiled/react-dom/client', // // and others in the loaders configuration
'react-dom/server$': 'next/dist/compiled/react-dom/server', // 'react-dom/client$': 'next/dist/compiled/react-dom/client',
'react-dom/server.browser$': // 'react-dom/server$': 'next/dist/compiled/react-dom/server',
'next/dist/compiled/react-dom/server.browser', // 'react-dom/server.browser$':
'react/jsx-dev-runtime$': // 'next/dist/compiled/react-dom/server.browser',
'next/dist/compiled/react/jsx-dev-runtime', // 'react/jsx-dev-runtime$':
'react/jsx-runtime$': 'next/dist/compiled/react/jsx-runtime', // 'next/dist/compiled/react/jsx-dev-runtime',
} // 'react/jsx-runtime$': 'next/dist/compiled/react/jsx-runtime',
: undefined), // }
// : undefined),
react: reactDir,
'react-dom$': reactDomDir,
'react-dom/server$': `${reactDomDir}/server`,
'react-dom/server.browser$': `${reactDomDir}/server.browser`,
'react-dom/client$': `${reactDomDir}/client`,
'styled-jsx/style$': require.resolve(`styled-jsx/style`), 'styled-jsx/style$': require.resolve(`styled-jsx/style`),
'styled-jsx$': require.resolve(`styled-jsx`), 'styled-jsx$': require.resolve(`styled-jsx`),
...@@ -1183,12 +1192,7 @@ export default async function getBaseWebpackConfig( ...@@ -1183,12 +1192,7 @@ export default async function getBaseWebpackConfig(
if (layer === WEBPACK_LAYERS.server) { if (layer === WEBPACK_LAYERS.server) {
// All packages should be bundled for the server layer if they're not opted out. // All packages should be bundled for the server layer if they're not opted out.
// This option takes priority over the transpilePackages option. // This option takes priority over the transpilePackages option.
if ( if (isResourceInPackages(res, optoutBundlingPackages)) {
isResourceInPackages(
res,
config.experimental.serverComponentsExternalPackages
)
) {
return `${externalType} ${request}` return `${externalType} ${request}`
} }
...@@ -1541,6 +1545,46 @@ export default async function getBaseWebpackConfig( ...@@ -1541,6 +1545,46 @@ export default async function getBaseWebpackConfig(
}, },
module: { module: {
rules: [ rules: [
...(hasAppDir && !isClient && !isEdgeServer
? [
{
issuerLayer: WEBPACK_LAYERS.server,
test: (req: string) => {
// If it's not a source code file, or has been opted out of
// bundling, don't resolve it.
if (
!codeCondition.test.test(req) ||
isResourceInPackages(
req,
config.experimental.serverComponentsExternalPackages
)
) {
return false
}
return true
},
resolve: process.env.__NEXT_REACT_CHANNEL
? {
conditionNames: ['react-server', 'node', 'require'],
alias: {
react: `react-${process.env.__NEXT_REACT_CHANNEL}`,
'react-dom': `react-dom-${process.env.__NEXT_REACT_CHANNEL}`,
},
}
: {
conditionNames: ['react-server', 'node', 'require'],
alias: {
// If missing the alias override here, the default alias will be used which aliases
// react to the direct file path, not the package name. In that case the condition
// will be ignored completely.
react: 'react',
'react-dom': 'react-dom',
},
},
},
]
: []),
// TODO: FIXME: do NOT webpack 5 support with this // TODO: FIXME: do NOT webpack 5 support with this
// x-ref: https://github.com/webpack/webpack/issues/11467 // x-ref: https://github.com/webpack/webpack/issues/11467
...(!config.experimental.fullySpecified ...(!config.experimental.fullySpecified
...@@ -1564,35 +1608,7 @@ export default async function getBaseWebpackConfig( ...@@ -1564,35 +1608,7 @@ export default async function getBaseWebpackConfig(
}, },
] ]
: []), : []),
...(hasAppDir && !isClient
? [
{
issuerLayer: WEBPACK_LAYERS.server,
test: (req: string) => {
// If it's not a source code file, or has been opted out of
// bundling, don't resolve it.
if (
!codeCondition.test.test(req) ||
isResourceInPackages(req, optoutBundlingPackages)
) {
return false
}
return true
},
resolve: {
conditionNames: ['react-server', 'node', 'require'],
alias: {
// If missing the alias override here, the default alias will be used which aliases
// react to the direct file path, not the package name. In that case the condition
// will be ignored completely.
react: 'react',
'react-dom': 'react-dom',
},
},
},
]
: []),
...(hasServerComponents && !isClient ...(hasServerComponents && !isClient
? [ ? [
// RSC server compilation loaders // RSC server compilation loaders
...@@ -1629,6 +1645,7 @@ export default async function getBaseWebpackConfig( ...@@ -1629,6 +1645,7 @@ export default async function getBaseWebpackConfig(
// Alias react-dom for ReactDOM.preload usage. // Alias react-dom for ReactDOM.preload usage.
// Alias react for switching between default set and share subset. // Alias react for switching between default set and share subset.
oneOf: [ oneOf: [
/*
{ {
// test: codeCondition.test, // test: codeCondition.test,
issuerLayer: WEBPACK_LAYERS.server, issuerLayer: WEBPACK_LAYERS.server,
...@@ -1647,28 +1664,34 @@ export default async function getBaseWebpackConfig( ...@@ -1647,28 +1664,34 @@ export default async function getBaseWebpackConfig(
resolve: { resolve: {
// It needs `conditionNames` here to require the proper asset, // It needs `conditionNames` here to require the proper asset,
// when react is acting as dependency of compiled/react-dom. // when react is acting as dependency of compiled/react-dom.
conditionNames: ['react-server', 'node', 'require'],
alias: { alias: {
react: 'next/dist/compiled/react/react.shared-subset', react: 'react',
// Use server rendering stub for RSC 'react-dom': 'react-dom',
// x-ref: https://github.com/facebook/react/pull/25436 // Disable before prebundling is landed
'react-dom$': // react: 'next/dist/compiled/react/react.shared-subset',
'next/dist/compiled/react-dom/server-rendering-stub', // // Use server rendering stub for RSC
}, // // x-ref: https://github.com/facebook/react/pull/25436
}, // 'react-dom$':
}, // 'next/dist/compiled/react-dom/server-rendering-stub',
{
test: codeCondition.test,
resolve: {
alias: {
react: 'next/dist/compiled/react',
'react-dom$': isClient
? 'next/dist/compiled/react-dom/index'
: 'next/dist/compiled/react-dom/server-rendering-stub',
'react-dom/client$':
'next/dist/compiled/react-dom/client',
}, },
}, },
}, },
*/
// Disable before prebundling is landed
// {
// test: codeCondition.test,
// resolve: {
// alias: {
// react: 'next/dist/compiled/react',
// 'react-dom$': isClient
// ? 'next/dist/compiled/react-dom/index'
// : 'next/dist/compiled/react-dom/server-rendering-stub',
// 'react-dom/client$':
// 'next/dist/compiled/react-dom/client',
// },
// },
// },
], ],
}, },
] ]
......
...@@ -45,6 +45,7 @@ export function loadRequireHook(aliases: [string, string][] = []) { ...@@ -45,6 +45,7 @@ export function loadRequireHook(aliases: [string, string][] = []) {
} }
export function overrideBuiltInReactPackages() { export function overrideBuiltInReactPackages() {
/*
setRequireOverrides([ setRequireOverrides([
['react', require.resolve('next/dist/compiled/react')], ['react', require.resolve('next/dist/compiled/react')],
[ [
...@@ -72,4 +73,5 @@ export function overrideBuiltInReactPackages() { ...@@ -72,4 +73,5 @@ export function overrideBuiltInReactPackages() {
require.resolve('next/dist/compiled/react-dom/server.browser'), require.resolve('next/dist/compiled/react-dom/server.browser'),
], ],
]) ])
*/
} }
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-9cdf8a99e-20221018';
var Internals = {
usingClientEntryPoint: false,
Events: null,
Dispatcher: {
current: null
}
};
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.');
}
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 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.
}
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
exports.createPortal = createPortal;
exports.flushSync = flushSync;
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.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-9cdf8a99e-20221018";
'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",
"version": "0.0.0-experimental-9cdf8a99e-20221018",
"description": "React package for working with the DOM.",
"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.0.0-experimental-9cdf8a99e-20221018"
},
"peerDependencies": {
"react": "0.0.0-experimental-9cdf8a99e-20221018"
},
"files": [
"LICENSE",
"README.md",
"index.js",
"client.js",
"profiling.js",
"server.js",
"server.browser.js",
"server.node.js",
"static.js",
"static.browser.js",
"static.node.js",
"server-rendering-stub.js",
"test-utils.js",
"unstable_testing.js",
"unstable_server-external-runtime.js",
"cjs/",
"umd/"
],
"exports": {
".": "./index.js",
"./client": "./client.js",
"./server": {
"deno": "./server.browser.js",
"worker": "./server.browser.js",
"browser": "./server.browser.js",
"default": "./server.node.js"
},
"./server.browser": "./server.browser.js",
"./server.node": "./server.node.js",
"./static": {
"deno": "./static.browser.js",
"worker": "./static.browser.js",
"browser": "./static.browser.js",
"default": "./static.node.js"
},
"./static.browser": "./static.browser.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",
"./package.json": "./package.json"
},
"browser": {
"./server.js": "./server.browser.js",
"./static.js": "./static.browser.js"
},
"browserify": {
"transform": [
"loose-envify"
]
}
}
\ 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';
module.exports = require('./server.node');
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("react"),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("react"),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;
This diff is collapsed.
/**
* @license React
* react.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 k=Symbol.for("react.element"),n=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),t=Symbol.for("react.provider"),u=Symbol.for("react.context"),v=Symbol.for("react.server_context"),w=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),B=Symbol.for("react.debug_trace_mode"),aa=Symbol.for("react.offscreen"),ba=Symbol.for("react.cache"),
C=Symbol.for("react.default_value"),D=Symbol.iterator;function ca(a){if(null===a||"object"!==typeof a)return null;a=D&&a[D]||a["@@iterator"];return"function"===typeof a?a:null}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},F=Object.assign,G={};function H(a,b,d){this.props=a;this.context=b;this.refs=G;this.updater=d||E}H.prototype.isReactComponent={};
H.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,a,b,"setState")};H.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};function I(){}I.prototype=H.prototype;function J(a,b,d){this.props=a;this.context=b;this.refs=G;this.updater=d||E}var K=J.prototype=new I;
K.constructor=J;F(K,H.prototype);K.isPureReactComponent=!0;var L=Array.isArray,M=Object.prototype.hasOwnProperty,N={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};
function P(a,b,d){var c,e={},l=null,h=null;if(null!=b)for(c in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(l=""+b.key),b)M.call(b,c)&&!O.hasOwnProperty(c)&&(e[c]=b[c]);var g=arguments.length-2;if(1===g)e.children=d;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];e.children=f}if(a&&a.defaultProps)for(c in g=a.defaultProps,g)void 0===e[c]&&(e[c]=g[c]);return{$$typeof:k,type:a,key:l,ref:h,props:e,_owner:N.current}}
function da(a,b){return{$$typeof:k,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function Q(a){return"object"===typeof a&&null!==a&&a.$$typeof===k}function escape(a){var b={"=":"=0",":":"=2"};return"$"+a.replace(/[=:]/g,function(a){return b[a]})}var R=/\/+/g;function S(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(""+a.key):b.toString(36)}
function T(a,b,d,c,e){var l=typeof a;if("undefined"===l||"boolean"===l)a=null;var h=!1;if(null===a)h=!0;else switch(l){case "string":case "number":h=!0;break;case "object":switch(a.$$typeof){case k:case n:h=!0}}if(h)return h=a,e=e(h),a=""===c?"."+S(h,0):c,L(e)?(d="",null!=a&&(d=a.replace(R,"$&/")+"/"),T(e,b,d,"",function(a){return a})):null!=e&&(Q(e)&&(e=da(e,d+(!e.key||h&&h.key===e.key?"":(""+e.key).replace(R,"$&/")+"/")+a)),b.push(e)),1;h=0;c=""===c?".":c+":";if(L(a))for(var g=0;g<a.length;g++){l=
a[g];var f=c+S(l,g);h+=T(l,b,d,f,e)}else if(f=ca(a),"function"===typeof f)for(a=f.call(a),g=0;!(l=a.next()).done;)l=l.value,f=c+S(l,g++),h+=T(l,b,d,f,e);else if("object"===l)throw b=String(a),Error("Objects are not valid as a React child (found: "+("[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b)+"). If you meant to render a collection of children, use an array instead.");return h}
function U(a,b,d){if(null==a)return a;var c=[],e=0;T(a,c,"","",function(a){return b.call(d,a,e++)});return c}function ea(a){if(-1===a._status){var b=a._result;b=b();b.then(function(b){if(0===a._status||-1===a._status)a._status=1,a._result=b},function(b){if(0===a._status||-1===a._status)a._status=2,a._result=b});-1===a._status&&(a._status=0,a._result=b)}if(1===a._status)return a._result.default;throw a._result;}
var V={current:null},W={current:null},X={transition:null},Y={ReactCurrentDispatcher:V,ReactCurrentCache:W,ReactCurrentBatchConfig:X,ReactCurrentOwner:N,ContextRegistry:{}},Z=Y.ContextRegistry;
exports.Children={map:U,forEach:function(a,b,d){U(a,function(){b.apply(this,arguments)},d)},count:function(a){var b=0;U(a,function(){b++});return b},toArray:function(a){return U(a,function(a){return a})||[]},only:function(a){if(!Q(a))throw Error("React.Children.only expected to receive a single React element child.");return a}};exports.Component=H;exports.Fragment=p;exports.Profiler=r;exports.PureComponent=J;exports.StrictMode=q;exports.Suspense=x;exports.SuspenseList=y;
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y;
exports.cloneElement=function(a,b,d){if(null===a||void 0===a)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+a+".");var c=F({},a.props),e=a.key,l=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(l=b.ref,h=N.current);void 0!==b.key&&(e=""+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)M.call(b,f)&&!O.hasOwnProperty(f)&&(c[f]=void 0===b[f]&&void 0!==g?g[f]:b[f])}var f=arguments.length-2;if(1===f)c.children=d;else if(1<f){g=Array(f);
for(var m=0;m<f;m++)g[m]=arguments[m+2];c.children=g}return{$$typeof:k,type:a.type,key:e,ref:l,props:c,_owner:h}};exports.createContext=function(a){a={$$typeof:u,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};a.Provider={$$typeof:t,_context:a};return a.Consumer=a};exports.createElement=P;exports.createFactory=function(a){var b=P.bind(null,a);b.type=a;return b};exports.createRef=function(){return{current:null}};
exports.createServerContext=function(a,b){var d=!0;if(!Z[a]){d=!1;var c={$$typeof:v,_currentValue:b,_currentValue2:b,_defaultValue:b,_threadCount:0,Provider:null,Consumer:null,_globalName:a};c.Provider={$$typeof:t,_context:c};Z[a]=c}c=Z[a];if(c._defaultValue===C)c._defaultValue=b,c._currentValue===C&&(c._currentValue=b),c._currentValue2===C&&(c._currentValue2=b);else if(d)throw Error("ServerContext: "+a+" already defined");return c};exports.experimental_use=function(a){return V.current.use(a)};
exports.experimental_useEvent=function(a){return V.current.useEvent(a)};exports.forwardRef=function(a){return{$$typeof:w,render:a}};exports.isValidElement=Q;exports.lazy=function(a){return{$$typeof:A,_payload:{_status:-1,_result:a},_init:ea}};exports.memo=function(a,b){return{$$typeof:z,type:a,compare:void 0===b?null:b}};exports.startTransition=function(a){var b=X.transition;X.transition={};try{a()}finally{X.transition=b}};exports.unstable_Cache=ba;exports.unstable_DebugTracingMode=B;
exports.unstable_Offscreen=aa;exports.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.");};exports.unstable_getCacheForType=function(a){var b=W.current;return b?b.getCacheForType(a):a()};exports.unstable_getCacheSignal=function(){var a=W.current;return a?a.getCacheSignal():(a=new AbortController,a.abort(Error("This CacheSignal was requested outside React which means that it is immediately aborted.")),a.signal)};exports.unstable_useCacheRefresh=function(){return V.current.useCacheRefresh()};
exports.unstable_useMemoCache=function(a){return V.current.useMemoCache(a)};exports.useCallback=function(a,b){return V.current.useCallback(a,b)};exports.useContext=function(a){return V.current.useContext(a)};exports.useDebugValue=function(){};exports.useDeferredValue=function(a){return V.current.useDeferredValue(a)};exports.useEffect=function(a,b){return V.current.useEffect(a,b)};exports.useId=function(){return V.current.useId()};
exports.useImperativeHandle=function(a,b,d){return V.current.useImperativeHandle(a,b,d)};exports.useInsertionEffect=function(a,b){return V.current.useInsertionEffect(a,b)};exports.useLayoutEffect=function(a,b){return V.current.useLayoutEffect(a,b)};exports.useMemo=function(a,b){return V.current.useMemo(a,b)};exports.useReducer=function(a,b,d){return V.current.useReducer(a,b,d)};exports.useRef=function(a){return V.current.useRef(a)};exports.useState=function(a){return V.current.useState(a)};
exports.useSyncExternalStore=function(a,b,d){return V.current.useSyncExternalStore(a,b,d)};exports.useTransition=function(){return V.current.useTransition()};exports.version="18.3.0-experimental-9cdf8a99e-20221018";
/**
* @license React
* react.shared-subset.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 m=Symbol.for("react.element"),n=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),t=Symbol.for("react.provider"),u=Symbol.for("react.server_context"),v=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),A=Symbol.for("react.debug_trace_mode"),B=Symbol.for("react.default_value"),C=Symbol.iterator;
function D(a){if(null===a||"object"!==typeof a)return null;a=C&&a[C]||a["@@iterator"];return"function"===typeof a?a:null}function E(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,e=1;e<arguments.length;e++)b+="&args[]="+encodeURIComponent(arguments[e]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}
var F={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},G=Object.assign,H={};function I(a,b,e){this.props=a;this.context=b;this.refs=H;this.updater=e||F}I.prototype.isReactComponent={};I.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error(E(85));this.updater.enqueueSetState(this,a,b,"setState")};I.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};
function J(){}J.prototype=I.prototype;function K(a,b,e){this.props=a;this.context=b;this.refs=H;this.updater=e||F}var L=K.prototype=new J;L.constructor=K;G(L,I.prototype);L.isPureReactComponent=!0;var M=Array.isArray,N=Object.prototype.hasOwnProperty,O={current:null},P={key:!0,ref:!0,__self:!0,__source:!0};function aa(a,b){return{$$typeof:m,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function Q(a){return"object"===typeof a&&null!==a&&a.$$typeof===m}
function escape(a){var b={"=":"=0",":":"=2"};return"$"+a.replace(/[=:]/g,function(a){return b[a]})}var R=/\/+/g;function S(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(""+a.key):b.toString(36)}
function T(a,b,e,c,d){var k=typeof a;if("undefined"===k||"boolean"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case "string":case "number":h=!0;break;case "object":switch(a.$$typeof){case m:case n:h=!0}}if(h)return h=a,d=d(h),a=""===c?"."+S(h,0):c,M(d)?(e="",null!=a&&(e=a.replace(R,"$&/")+"/"),T(d,b,e,"",function(a){return a})):null!=d&&(Q(d)&&(d=aa(d,e+(!d.key||h&&h.key===d.key?"":(""+d.key).replace(R,"$&/")+"/")+a)),b.push(d)),1;h=0;c=""===c?".":c+":";if(M(a))for(var g=0;g<a.length;g++){k=
a[g];var f=c+S(k,g);h+=T(k,b,e,f,d)}else if(f=D(a),"function"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=c+S(k,g++),h+=T(k,b,e,f,d);else if("object"===k)throw b=String(a),Error(E(31,"[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b));return h}function U(a,b,e){if(null==a)return a;var c=[],d=0;T(a,c,"","",function(a){return b.call(e,a,d++)});return c}
function ba(a){if(-1===a._status){var b=a._result;b=b();b.then(function(b){if(0===a._status||-1===a._status)a._status=1,a._result=b},function(b){if(0===a._status||-1===a._status)a._status=2,a._result=b});-1===a._status&&(a._status=0,a._result=b)}if(1===a._status)return a._result.default;throw a._result;}var V={current:null},W={current:null},X={transition:null},Y={ReactCurrentDispatcher:V,ReactCurrentCache:W,ReactCurrentBatchConfig:X,ReactCurrentOwner:O,ContextRegistry:{}},Z=Y.ContextRegistry;
exports.Children={map:U,forEach:function(a,b,e){U(a,function(){b.apply(this,arguments)},e)},count:function(a){var b=0;U(a,function(){b++});return b},toArray:function(a){return U(a,function(a){return a})||[]},only:function(a){if(!Q(a))throw Error(E(143));return a}};exports.Fragment=p;exports.Profiler=r;exports.StrictMode=q;exports.Suspense=w;exports.SuspenseList=x;exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y;
exports.cloneElement=function(a,b,e){if(null===a||void 0===a)throw Error(E(267,a));var c=G({},a.props),d=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=O.current);void 0!==b.key&&(d=""+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)N.call(b,f)&&!P.hasOwnProperty(f)&&(c[f]=void 0===b[f]&&void 0!==g?g[f]:b[f])}var f=arguments.length-2;if(1===f)c.children=e;else if(1<f){g=Array(f);for(var l=0;l<f;l++)g[l]=arguments[l+2];c.children=g}return{$$typeof:m,type:a.type,
key:d,ref:k,props:c,_owner:h}};exports.createElement=function(a,b,e){var c,d={},k=null,h=null;if(null!=b)for(c in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=""+b.key),b)N.call(b,c)&&!P.hasOwnProperty(c)&&(d[c]=b[c]);var g=arguments.length-2;if(1===g)d.children=e;else if(1<g){for(var f=Array(g),l=0;l<g;l++)f[l]=arguments[l+2];d.children=f}if(a&&a.defaultProps)for(c in g=a.defaultProps,g)void 0===d[c]&&(d[c]=g[c]);return{$$typeof:m,type:a,key:k,ref:h,props:d,_owner:O.current}};exports.createRef=function(){return{current:null}};
exports.createServerContext=function(a,b){var e=!0;if(!Z[a]){e=!1;var c={$$typeof:u,_currentValue:b,_currentValue2:b,_defaultValue:b,_threadCount:0,Provider:null,Consumer:null,_globalName:a};c.Provider={$$typeof:t,_context:c};Z[a]=c}c=Z[a];if(c._defaultValue===B)c._defaultValue=b,c._currentValue===B&&(c._currentValue=b),c._currentValue2===B&&(c._currentValue2=b);else if(e)throw Error(E(429,a));return c};exports.experimental_use=function(a){return V.current.use(a)};
exports.forwardRef=function(a){return{$$typeof:v,render:a}};exports.isValidElement=Q;exports.lazy=function(a){return{$$typeof:z,_payload:{_status:-1,_result:a},_init:ba}};exports.memo=function(a,b){return{$$typeof:y,type:a,compare:void 0===b?null:b}};exports.startTransition=function(a){var b=X.transition;X.transition={};try{a()}finally{X.transition=b}};exports.unstable_DebugTracingMode=A;exports.unstable_getCacheForType=function(a){var b=W.current;return b?b.getCacheForType(a):a()};
exports.unstable_getCacheSignal=function(){var a=W.current;if(!a){a=new AbortController;var b=Error(E(455));a.abort(b);return a.signal}return a.getCacheSignal()};exports.useCallback=function(a,b){return V.current.useCallback(a,b)};exports.useContext=function(a){return V.current.useContext(a)};exports.useDebugValue=function(){};exports.useId=function(){return V.current.useId()};exports.useMemo=function(a,b){return V.current.useMemo(a,b)};exports.version="18.3.0-experimental-9cdf8a99e-20221018";
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react.production.min.js');
} else {
module.exports = require('./cjs/react.development.js');
}
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-jsx-dev-runtime.production.min.js');
} else {
module.exports = require('./cjs/react-jsx-dev-runtime.development.js');
}
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-jsx-runtime.production.min.js');
} else {
module.exports = require('./cjs/react-jsx-runtime.development.js');
}
{
"name": "react",
"description": "React is a JavaScript library for building user interfaces.",
"keywords": [
"react"
],
"version": "0.0.0-experimental-9cdf8a99e-20221018",
"homepage": "https://reactjs.org/",
"bugs": "https://github.com/facebook/react/issues",
"license": "MIT",
"files": [
"LICENSE",
"README.md",
"index.js",
"cjs/",
"umd/",
"jsx-runtime.js",
"jsx-dev-runtime.js",
"react.shared-subset.js"
],
"main": "index.js",
"exports": {
".": {
"react-server": "./react.shared-subset.js",
"default": "./index.js"
},
"./package.json": "./package.json",
"./jsx-runtime": "./jsx-runtime.js",
"./jsx-dev-runtime": "./jsx-dev-runtime.js"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/react.git",
"directory": "packages/react"
},
"engines": {
"node": ">=0.10.0"
},
"dependencies": {
"loose-envify": "^1.1.0"
},
"browserify": {
"transform": [
"loose-envify"
]
}
}
\ No newline at end of file
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react.shared-subset.production.min.js');
} else {
module.exports = require('./cjs/react.shared-subset.development.js');
}
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.
This diff is collapsed.
{"name":"scheduler","main":"index.js","license":"MIT"}
...@@ -49,7 +49,7 @@ import { ...@@ -49,7 +49,7 @@ import {
} from '../build/webpack/require-hook' } from '../build/webpack/require-hook'
loadRequireHook() loadRequireHook()
if (process.env.HAS_APP_DIR) { if (process.env.NEXT_PREBUNDLED_REACT) {
overrideBuiltInReactPackages() overrideBuiltInReactPackages()
} }
......
...@@ -3,9 +3,9 @@ import type { IncomingMessage, ServerResponse } from 'http' ...@@ -3,9 +3,9 @@ import type { IncomingMessage, ServerResponse } from 'http'
import type { DomainLocale, NextConfigComplete } from '../server/config-shared' import type { DomainLocale, NextConfigComplete } from '../server/config-shared'
import type { NextParsedUrlQuery } from '../server/request-meta' import type { NextParsedUrlQuery } from '../server/request-meta'
// `HAS_APP_DIR` env var is inherited from parent process, // `NEXT_PREBUNDLED_REACT` env var is inherited from parent process,
// then override react packages here for export worker. // then override react packages here for export worker.
if (process.env.HAS_APP_DIR) { if (process.env.NEXT_PREBUNDLED_REACT) {
require('../build/webpack/require-hook').overrideBuiltInReactPackages() require('../build/webpack/require-hook').overrideBuiltInReactPackages()
} }
import '../server/node-polyfill-fetch' import '../server/node-polyfill-fetch'
......
...@@ -252,13 +252,8 @@ ...@@ -252,13 +252,8 @@
"punycode": "2.1.1", "punycode": "2.1.1",
"querystring-es3": "0.2.1", "querystring-es3": "0.2.1",
"raw-body": "2.4.1", "raw-body": "2.4.1",
"react": "18.2.0",
"react-builtin": "npm:react@0.0.0-experimental-9cdf8a99e-20221018",
"react-dom": "18.2.0",
"react-dom-builtin": "npm:react-dom@0.0.0-experimental-9cdf8a99e-20221018",
"react-is": "17.0.2", "react-is": "17.0.2",
"react-refresh": "0.12.0", "react-refresh": "0.12.0",
"react-server-dom-webpack": "0.0.0-experimental-9cdf8a99e-20221018",
"regenerator-runtime": "0.13.4", "regenerator-runtime": "0.13.4",
"sass-loader": "12.4.0", "sass-loader": "12.4.0",
"schema-utils2": "npm:schema-utils@2.7.1", "schema-utils2": "npm:schema-utils@2.7.1",
......
...@@ -8,11 +8,11 @@ import type { FontLoaderManifest } from '../build/webpack/plugins/font-loader-ma ...@@ -8,11 +8,11 @@ import type { FontLoaderManifest } from '../build/webpack/plugins/font-loader-ma
import React, { import React, {
// @ts-ignore // @ts-ignore
experimental_use as use, experimental_use as use,
} from 'next/dist/compiled/react' } from 'react'
// this needs to be required lazily so that `next-server` can set // this needs to be required lazily so that `next-server` can set
// the env before we require // the env before we require
import ReactDOMServer from 'next/dist/compiled/react-dom/server.browser' import ReactDOMServer from 'react-dom/server.browser'
import { ParsedUrlQuery } from 'querystring' import { ParsedUrlQuery } from 'querystring'
import { NextParsedUrlQuery } from './request-meta' import { NextParsedUrlQuery } from './request-meta'
......
...@@ -16,7 +16,7 @@ import { ...@@ -16,7 +16,7 @@ import {
type RuntimeConfig = any type RuntimeConfig = any
loadRequireHook() loadRequireHook()
if (process.env.HAS_APP_DIR) { if (process.env.NEXT_PREBUNDLED_REACT) {
overrideBuiltInReactPackages() overrideBuiltInReactPackages()
} }
......
...@@ -149,10 +149,11 @@ export class NextServer { ...@@ -149,10 +149,11 @@ export class NextServer {
} }
private async getServer() { private async getServer() {
setTimeout(getServerImpl, 10)
if (!this.serverPromise) { if (!this.serverPromise) {
this.serverPromise = this.loadConfig().then(async (conf) => { this.serverPromise = this.loadConfig().then(async (conf) => {
if (conf.experimental.appDir) { if (conf.experimental.appDir) {
process.env.HAS_APP_DIR = '1' process.env.NEXT_PREBUNDLED_REACT = '1'
overrideBuiltInReactPackages() overrideBuiltInReactPackages()
} }
......
...@@ -2067,7 +2067,7 @@ export async function ncc(task, opts) { ...@@ -2067,7 +2067,7 @@ export async function ncc(task, opts) {
'copy_regenerator_runtime', 'copy_regenerator_runtime',
'copy_babel_runtime', 'copy_babel_runtime',
'copy_constants_browserify', 'copy_constants_browserify',
'ncc_react', // 'ncc_react',
'ncc_react_server_dom_webpack', 'ncc_react_server_dom_webpack',
'copy_react_is', 'copy_react_is',
'ncc_sass_loader', 'ncc_sass_loader',
......
...@@ -3,7 +3,7 @@ declare module 'next/dist/compiled/babel/plugin-transform-modules-commonjs' ...@@ -3,7 +3,7 @@ declare module 'next/dist/compiled/babel/plugin-transform-modules-commonjs'
declare module 'next/dist/compiled/babel/plugin-syntax-jsx' declare module 'next/dist/compiled/babel/plugin-syntax-jsx'
declare module 'next/dist/compiled/react-server-dom-webpack/client' declare module 'next/dist/compiled/react-server-dom-webpack/client'
declare module 'next/dist/compiled/react-server-dom-webpack/server.browser' declare module 'next/dist/compiled/react-server-dom-webpack/server.browser'
declare module 'next/dist/compiled/react-dom/server.browser' // declare module 'next/dist/compiled/react-dom/server.browser'
declare module 'next/dist/compiled/browserslist' declare module 'next/dist/compiled/browserslist'
declare module 'react-dom/server.browser' declare module 'react-dom/server.browser'
...@@ -341,14 +341,14 @@ declare module 'next/dist/compiled/@segment/ajv-human-errors' { ...@@ -341,14 +341,14 @@ declare module 'next/dist/compiled/@segment/ajv-human-errors' {
export = m export = m
} }
declare module 'next/dist/compiled/react' { // declare module 'next/dist/compiled/react' {
import * as m from 'react' // import * as m from 'react'
export = m // export = m
} // }
declare module 'next/dist/compiled/react-dom' { // declare module 'next/dist/compiled/react-dom' {
import * as m from 'react-dom' // import * as m from 'react-dom'
export = m // export = m
} // }
declare module 'next/dist/compiled/stacktrace-parser' { declare module 'next/dist/compiled/stacktrace-parser' {
import * as m from 'stacktrace-parser' import * as m from 'stacktrace-parser'
......
...@@ -144,6 +144,9 @@ importers: ...@@ -144,6 +144,9 @@ importers:
react-17: npm:react@17.0.2 react-17: npm:react@17.0.2
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-exp: npm:react-dom@0.0.0-experimental-9cdf8a99e-20221018
react-exp: npm:react@0.0.0-experimental-9cdf8a99e-20221018
react-server-dom-webpack: 0.0.0-experimental-9cdf8a99e-20221018
react-ssr-prepass: 1.0.8 react-ssr-prepass: 1.0.8
react-virtualized: 9.22.3 react-virtualized: 9.22.3
relay-compiler: 13.0.2 relay-compiler: 13.0.2
...@@ -301,6 +304,9 @@ importers: ...@@ -301,6 +304,9 @@ importers:
react-17: /react/17.0.2 react-17: /react/17.0.2
react-dom: 18.2.0_react@18.2.0 react-dom: 18.2.0_react@18.2.0
react-dom-17: /react-dom/17.0.2_react@18.2.0 react-dom-17: /react-dom/17.0.2_react@18.2.0
react-dom-exp: /react-dom/0.0.0-experimental-9cdf8a99e-20221018_react@18.2.0
react-exp: /react/0.0.0-experimental-9cdf8a99e-20221018
react-server-dom-webpack: 0.0.0-experimental-9cdf8a99e-20221018_4ifzx734of5j5ymg4ksx54vtqi
react-ssr-prepass: 1.0.8_qncsgtzehe3fgiqp6tr7lwq6fm react-ssr-prepass: 1.0.8_qncsgtzehe3fgiqp6tr7lwq6fm
react-virtualized: 9.22.3_biqbaboplfbrettd7655fr4n2y react-virtualized: 9.22.3_biqbaboplfbrettd7655fr4n2y
relay-compiler: 13.0.2 relay-compiler: 13.0.2
...@@ -592,13 +598,8 @@ importers: ...@@ -592,13 +598,8 @@ importers:
punycode: 2.1.1 punycode: 2.1.1
querystring-es3: 0.2.1 querystring-es3: 0.2.1
raw-body: 2.4.1 raw-body: 2.4.1
react: 18.2.0
react-builtin: npm:react@0.0.0-experimental-9cdf8a99e-20221018
react-dom: 18.2.0
react-dom-builtin: npm:react-dom@0.0.0-experimental-9cdf8a99e-20221018
react-is: 17.0.2 react-is: 17.0.2
react-refresh: 0.12.0 react-refresh: 0.12.0
react-server-dom-webpack: 0.0.0-experimental-9cdf8a99e-20221018
regenerator-runtime: 0.13.4 regenerator-runtime: 0.13.4
sass-loader: 12.4.0 sass-loader: 12.4.0
schema-utils2: npm:schema-utils@2.7.1 schema-utils2: npm:schema-utils@2.7.1
...@@ -794,13 +795,8 @@ importers: ...@@ -794,13 +795,8 @@ importers:
punycode: 2.1.1 punycode: 2.1.1
querystring-es3: 0.2.1 querystring-es3: 0.2.1
raw-body: 2.4.1 raw-body: 2.4.1
react: 18.2.0
react-builtin: /react/0.0.0-experimental-9cdf8a99e-20221018
react-dom: 18.2.0_react@18.2.0
react-dom-builtin: /react-dom/0.0.0-experimental-9cdf8a99e-20221018_react@18.2.0
react-is: 17.0.2 react-is: 17.0.2
react-refresh: 0.12.0 react-refresh: 0.12.0
react-server-dom-webpack: 0.0.0-experimental-9cdf8a99e-20221018_4ifzx734of5j5ymg4ksx54vtqi
regenerator-runtime: 0.13.4 regenerator-runtime: 0.13.4
sass-loader: 12.4.0_webpack@5.74.0 sass-loader: 12.4.0_webpack@5.74.0
schema-utils2: /schema-utils/2.7.1 schema-utils2: /schema-utils/2.7.1
...@@ -8596,7 +8592,7 @@ packages: ...@@ -8596,7 +8592,7 @@ packages:
dependencies: dependencies:
acorn: 7.4.1 acorn: 7.4.1
/acorn-jsx/5.3.1_acorn@8.6.0: /acorn-jsx/5.3.1_acorn@8.8.0:
resolution: resolution:
{ {
integrity: sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==, integrity: sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==,
...@@ -8604,7 +8600,7 @@ packages: ...@@ -8604,7 +8600,7 @@ packages:
peerDependencies: peerDependencies:
acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 acorn: ^6.0.0 || ^7.0.0 || ^8.0.0
dependencies: dependencies:
acorn: 8.6.0 acorn: 8.8.0
dev: true dev: true
/acorn-walk/7.1.1: /acorn-walk/7.1.1:
...@@ -19377,7 +19373,7 @@ packages: ...@@ -19377,7 +19373,7 @@ packages:
optional: true optional: true
dependencies: dependencies:
abab: 2.0.5 abab: 2.0.5
acorn: 8.6.0 acorn: 8.8.0
acorn-globals: 6.0.0 acorn-globals: 6.0.0
cssom: 0.4.4 cssom: 0.4.4
cssstyle: 2.3.0 cssstyle: 2.3.0
...@@ -21080,8 +21076,8 @@ packages: ...@@ -21080,8 +21076,8 @@ packages:
integrity: sha512-NQuiYA0lw+eFDtSG4+c7ao3RG9dM4P0Kx/sn8OLyPhxtIc6k+9n14k5VfLxRKfAxYRTo8c5PLZPaRNmslGWxJw==, integrity: sha512-NQuiYA0lw+eFDtSG4+c7ao3RG9dM4P0Kx/sn8OLyPhxtIc6k+9n14k5VfLxRKfAxYRTo8c5PLZPaRNmslGWxJw==,
} }
dependencies: dependencies:
acorn: 8.6.0 acorn: 8.8.0
acorn-jsx: 5.3.1_acorn@8.6.0 acorn-jsx: 5.3.1_acorn@8.8.0
micromark: 2.11.4 micromark: 2.11.4
micromark-extension-mdx-expression: 0.3.2 micromark-extension-mdx-expression: 0.3.2
micromark-extension-mdx-jsx: 0.3.3 micromark-extension-mdx-jsx: 0.3.3
...@@ -25416,7 +25412,7 @@ packages: ...@@ -25416,7 +25412,7 @@ packages:
neo-async: 2.6.2 neo-async: 2.6.2
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0_react@18.2.0 react-dom: 18.2.0_react@18.2.0
webpack: 5.74.0 webpack: 5.74.0_@swc+core@1.2.203
dev: true dev: true
/react-ssr-prepass/1.0.8_qncsgtzehe3fgiqp6tr7lwq6fm: /react-ssr-prepass/1.0.8_qncsgtzehe3fgiqp6tr7lwq6fm:
......
...@@ -15,8 +15,8 @@ describe('app-dir alias handling', () => { ...@@ -15,8 +15,8 @@ describe('app-dir alias handling', () => {
next = await createNext({ next = await createNext({
files: new FileRef(path.join(__dirname, 'app-alias')), files: new FileRef(path.join(__dirname, 'app-alias')),
dependencies: { dependencies: {
react: 'latest', react: '0.0.0-experimental-9cdf8a99e-20221018',
'react-dom': 'latest', 'react-dom': '0.0.0-experimental-9cdf8a99e-20221018',
typescript: 'latest', typescript: 'latest',
'@types/react': 'latest', '@types/react': 'latest',
'@types/node': 'latest', '@types/node': 'latest',
......
...@@ -15,8 +15,8 @@ describe('app-dir edge SSR', () => { ...@@ -15,8 +15,8 @@ describe('app-dir edge SSR', () => {
next = await createNext({ next = await createNext({
files: new FileRef(path.join(__dirname, 'app-edge')), files: new FileRef(path.join(__dirname, 'app-edge')),
dependencies: { dependencies: {
react: 'latest', react: '0.0.0-experimental-9cdf8a99e-20221018',
'react-dom': 'latest', 'react-dom': '0.0.0-experimental-9cdf8a99e-20221018',
typescript: 'latest', typescript: 'latest',
'@types/react': 'latest', '@types/react': 'latest',
'@types/node': 'latest', '@types/node': 'latest',
......
...@@ -19,8 +19,8 @@ describe('app-dir with middleware', () => { ...@@ -19,8 +19,8 @@ describe('app-dir with middleware', () => {
next = await createNext({ next = await createNext({
files: new FileRef(path.join(__dirname, 'app-middleware')), files: new FileRef(path.join(__dirname, 'app-middleware')),
dependencies: { dependencies: {
react: 'experimental', react: '0.0.0-experimental-9cdf8a99e-20221018',
'react-dom': 'experimental', 'react-dom': '0.0.0-experimental-9cdf8a99e-20221018',
}, },
}) })
}) })
......
...@@ -21,8 +21,8 @@ describe('app-dir static/dynamic handling', () => { ...@@ -21,8 +21,8 @@ describe('app-dir static/dynamic handling', () => {
next = await createNext({ next = await createNext({
files: new FileRef(path.join(__dirname, 'app-static')), files: new FileRef(path.join(__dirname, 'app-static')),
dependencies: { dependencies: {
react: 'latest', react: '0.0.0-experimental-9cdf8a99e-20221018',
'react-dom': 'latest', 'react-dom': '0.0.0-experimental-9cdf8a99e-20221018',
}, },
}) })
}) })
......
...@@ -17,8 +17,8 @@ describe('app-dir assetPrefix handling', () => { ...@@ -17,8 +17,8 @@ describe('app-dir assetPrefix handling', () => {
next = await createNext({ next = await createNext({
files: new FileRef(path.join(__dirname, 'asset-prefix')), files: new FileRef(path.join(__dirname, 'asset-prefix')),
dependencies: { dependencies: {
react: 'experimental', react: '0.0.0-experimental-9cdf8a99e-20221018',
'react-dom': 'experimental', 'react-dom': '0.0.0-experimental-9cdf8a99e-20221018',
}, },
skipStart: true, skipStart: true,
}) })
......
...@@ -15,8 +15,8 @@ describe('app-dir back button download bug', () => { ...@@ -15,8 +15,8 @@ describe('app-dir back button download bug', () => {
next = await createNext({ next = await createNext({
files: new FileRef(path.join(__dirname, 'back-button-download-bug')), files: new FileRef(path.join(__dirname, 'back-button-download-bug')),
dependencies: { dependencies: {
react: 'experimental', react: '0.0.0-experimental-9cdf8a99e-20221018',
'react-dom': 'experimental', 'react-dom': '0.0.0-experimental-9cdf8a99e-20221018',
}, },
skipStart: true, skipStart: true,
}) })
......
...@@ -28,8 +28,8 @@ describe('app dir', () => { ...@@ -28,8 +28,8 @@ describe('app dir', () => {
next = await createNext({ next = await createNext({
files: new FileRef(path.join(__dirname, 'app')), files: new FileRef(path.join(__dirname, 'app')),
dependencies: { dependencies: {
react: 'experimental', react: '0.0.0-experimental-9cdf8a99e-20221018',
'react-dom': 'experimental', 'react-dom': '0.0.0-experimental-9cdf8a99e-20221018',
}, },
skipStart: true, skipStart: true,
}) })
......
...@@ -19,8 +19,8 @@ describe('app dir next-font', () => { ...@@ -19,8 +19,8 @@ describe('app dir next-font', () => {
files: new FileRef(path.join(__dirname, 'next-font')), files: new FileRef(path.join(__dirname, 'next-font')),
dependencies: { dependencies: {
'@next/font': 'canary', '@next/font': 'canary',
react: 'experimental', react: '0.0.0-experimental-9cdf8a99e-20221018',
'react-dom': 'experimental', 'react-dom': '0.0.0-experimental-9cdf8a99e-20221018',
}, },
skipStart: true, skipStart: true,
}) })
......
...@@ -17,8 +17,8 @@ describe('app dir next-image', () => { ...@@ -17,8 +17,8 @@ describe('app dir next-image', () => {
next = await createNext({ next = await createNext({
files: new FileRef(path.join(__dirname, 'next-image')), files: new FileRef(path.join(__dirname, 'next-image')),
dependencies: { dependencies: {
react: 'experimental', react: '0.0.0-experimental-9cdf8a99e-20221018',
'react-dom': 'experimental', 'react-dom': '0.0.0-experimental-9cdf8a99e-20221018',
}, },
skipStart: true, skipStart: true,
}) })
......
...@@ -17,8 +17,8 @@ describe('app dir prefetching', () => { ...@@ -17,8 +17,8 @@ describe('app dir prefetching', () => {
next = await createNext({ next = await createNext({
files: new FileRef(path.join(__dirname, 'app-prefetch')), files: new FileRef(path.join(__dirname, 'app-prefetch')),
dependencies: { dependencies: {
react: 'experimental', react: '0.0.0-experimental-9cdf8a99e-20221018',
'react-dom': 'experimental', 'react-dom': '0.0.0-experimental-9cdf8a99e-20221018',
}, },
skipStart: true, skipStart: true,
}) })
......
...@@ -17,8 +17,8 @@ describe('app dir rendering', () => { ...@@ -17,8 +17,8 @@ describe('app dir rendering', () => {
next = await createNext({ next = await createNext({
files: new FileRef(path.join(__dirname, 'app-rendering')), files: new FileRef(path.join(__dirname, 'app-rendering')),
dependencies: { dependencies: {
react: 'experimental', react: '0.0.0-experimental-9cdf8a99e-20221018',
'react-dom': 'experimental', 'react-dom': '0.0.0-experimental-9cdf8a99e-20221018',
}, },
}) })
}) })
......
...@@ -23,8 +23,8 @@ describe('app-dir root layout', () => { ...@@ -23,8 +23,8 @@ describe('app-dir root layout', () => {
), ),
}, },
dependencies: { dependencies: {
react: 'experimental', react: '0.0.0-experimental-9cdf8a99e-20221018',
'react-dom': 'experimental', 'react-dom': '0.0.0-experimental-9cdf8a99e-20221018',
}, },
}) })
}) })
......
...@@ -39,8 +39,8 @@ describe('app dir - rsc basics', () => { ...@@ -39,8 +39,8 @@ describe('app dir - rsc basics', () => {
files: new FileRef(path.join(__dirname, './rsc-basic')), files: new FileRef(path.join(__dirname, './rsc-basic')),
dependencies: { dependencies: {
'styled-components': '6.0.0-beta.2', 'styled-components': '6.0.0-beta.2',
react: 'latest', react: '0.0.0-experimental-9cdf8a99e-20221018',
'react-dom': 'latest', 'react-dom': '0.0.0-experimental-9cdf8a99e-20221018',
}, },
packageJson: { packageJson: {
scripts: { scripts: {
......
...@@ -21,8 +21,8 @@ describe('app dir - rsc basics', () => { ...@@ -21,8 +21,8 @@ describe('app dir - rsc basics', () => {
next = await createNext({ next = await createNext({
files: new FileRef(path.join(__dirname, './rsc-errors')), files: new FileRef(path.join(__dirname, './rsc-errors')),
dependencies: { dependencies: {
react: 'experimental', react: '0.0.0-experimental-9cdf8a99e-20221018',
'react-dom': 'experimental', 'react-dom': '0.0.0-experimental-9cdf8a99e-20221018',
}, },
}) })
}) })
......
...@@ -29,8 +29,8 @@ describe('app dir - rsc external dependency', () => { ...@@ -29,8 +29,8 @@ describe('app dir - rsc external dependency', () => {
next = await createNext({ next = await createNext({
files: new FileRef(path.join(__dirname, './rsc-external')), files: new FileRef(path.join(__dirname, './rsc-external')),
dependencies: { dependencies: {
react: 'latest', react: '0.0.0-experimental-9cdf8a99e-20221018',
'react-dom': 'latest', 'react-dom': '0.0.0-experimental-9cdf8a99e-20221018',
}, },
packageJson: { packageJson: {
scripts: { scripts: {
......
...@@ -17,8 +17,8 @@ describe('app-dir trailingSlash handling', () => { ...@@ -17,8 +17,8 @@ describe('app-dir trailingSlash handling', () => {
next = await createNext({ next = await createNext({
files: new FileRef(path.join(__dirname, 'trailingslash')), files: new FileRef(path.join(__dirname, 'trailingslash')),
dependencies: { dependencies: {
react: 'experimental', react: '0.0.0-experimental-9cdf8a99e-20221018',
'react-dom': 'experimental', 'react-dom': '0.0.0-experimental-9cdf8a99e-20221018',
}, },
skipStart: true, skipStart: true,
}) })
......
...@@ -19,8 +19,8 @@ describe('vercel analytics', () => { ...@@ -19,8 +19,8 @@ describe('vercel analytics', () => {
next = await createNext({ next = await createNext({
files: new FileRef(path.join(__dirname, 'app')), files: new FileRef(path.join(__dirname, 'app')),
dependencies: { dependencies: {
react: 'experimental', react: '0.0.0-experimental-9cdf8a99e-20221018',
'react-dom': 'experimental', 'react-dom': '0.0.0-experimental-9cdf8a99e-20221018',
}, },
skipStart: true, skipStart: true,
env: { env: {
......
...@@ -16,8 +16,8 @@ describe('with babel', () => { ...@@ -16,8 +16,8 @@ describe('with babel', () => {
next = await createNext({ next = await createNext({
files: new FileRef(path.join(__dirname, 'with-babel')), files: new FileRef(path.join(__dirname, 'with-babel')),
dependencies: { dependencies: {
react: 'experimental', react: '0.0.0-experimental-9cdf8a99e-20221018',
'react-dom': 'experimental', 'react-dom': '0.0.0-experimental-9cdf8a99e-20221018',
}, },
}) })
}) })
......
...@@ -52,8 +52,8 @@ describe('Switchable runtime', () => { ...@@ -52,8 +52,8 @@ describe('Switchable runtime', () => {
'next.config.js': new FileRef(join(__dirname, './next.config.js')), 'next.config.js': new FileRef(join(__dirname, './next.config.js')),
}, },
dependencies: { dependencies: {
react: 'experimental', react: '0.0.0-experimental-9cdf8a99e-20221018',
'react-dom': 'experimental', 'react-dom': '0.0.0-experimental-9cdf8a99e-20221018',
}, },
}) })
context = { context = {
......
const mod = require('module') const mod = require('module')
// The value will be '17' or 'exp' to alias the actual react channel // The value will be '17' or 'exp' to alias the actual react channel
const reactVersion = undefined const reactVersion = process.env.__NEXT_REACT_CHANNEL
console.log('reactVersion', reactVersion)
const reactDir = `react-${reactVersion}` const reactDir = `react-${reactVersion}`
const reactDomDir = `react-dom-${reactVersion}` const reactDomDir = `react-dom-${reactVersion}`
......
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