Unverified Commit 25d064f8 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Pre-compile more dependencies (#32742)

This ncc's some remaining dependencies bringing us under 20 install time dependencies (including nested dependencies), this also reduces install size by another `2.75 MB`. A follow-up PR will investigate a custom install script for our swc packages to allow us to remove the `optionalDependencies` which is slowing down install time as well. 

x-ref: https://github.com/vercel/next.js/pull/32679
x-ref: https://github.com/vercel/next.js/pull/32627
x-ref: https://github.com/vercel/next.js/issues/31887
x-ref: https://github.com/vercel/styled-jsx/pull/770
parent 38943204
...@@ -77,7 +77,10 @@ function getPlugins( ...@@ -77,7 +77,10 @@ function getPlugins(
: null : null
const reactRefreshItem = hasReactRefresh const reactRefreshItem = hasReactRefresh
? createConfigItem( ? createConfigItem(
[require('react-refresh/babel'), { skipEnvCheck: true }], [
require('next/dist/compiled/react-refresh/babel'),
{ skipEnvCheck: true },
],
{ type: 'plugin' } { type: 'plugin' }
) )
: null : null
......
...@@ -4,7 +4,7 @@ import getGzipSize from 'next/dist/compiled/gzip-size' ...@@ -4,7 +4,7 @@ import getGzipSize from 'next/dist/compiled/gzip-size'
import textTable from 'next/dist/compiled/text-table' import textTable from 'next/dist/compiled/text-table'
import path from 'path' import path from 'path'
import { promises as fs } from 'fs' import { promises as fs } from 'fs'
import { isValidElementType } from 'react-is' import { isValidElementType } from 'next/dist/compiled/react-is'
import stripAnsi from 'next/dist/compiled/strip-ansi' import stripAnsi from 'next/dist/compiled/strip-ansi'
import { import {
Redirect, Redirect,
......
import ReactRefreshWebpackPlugin from '@next/react-refresh-utils/ReactRefreshWebpackPlugin' import ReactRefreshWebpackPlugin from 'next/dist/compiled/@next/react-refresh-utils/ReactRefreshWebpackPlugin'
import chalk from 'next/dist/compiled/chalk' import chalk from 'next/dist/compiled/chalk'
import crypto from 'crypto' import crypto from 'crypto'
import { stringify } from 'querystring' import { stringify } from 'querystring'
...@@ -132,7 +132,8 @@ export function attachReactRefresh( ...@@ -132,7 +132,8 @@ export function attachReactRefresh(
targetLoader: webpack.RuleSetUseItem targetLoader: webpack.RuleSetUseItem
) { ) {
let injections = 0 let injections = 0
const reactRefreshLoaderName = '@next/react-refresh-utils/loader' const reactRefreshLoaderName =
'next/dist/compiled/@next/react-refresh-utils/loader'
const reactRefreshLoader = require.resolve(reactRefreshLoaderName) const reactRefreshLoader = require.resolve(reactRefreshLoaderName)
webpackConfig.module?.rules.forEach((rule) => { webpackConfig.module?.rules.forEach((rule) => {
const curr = rule.use const curr = rule.use
...@@ -496,7 +497,7 @@ export default async function getBaseWebpackConfig( ...@@ -496,7 +497,7 @@ export default async function getBaseWebpackConfig(
...(dev ...(dev
? { ? {
[CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH]: require.resolve( [CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH]: require.resolve(
`@next/react-refresh-utils/runtime` `next/dist/compiled/@next/react-refresh-utils/runtime`
), ),
[CLIENT_STATIC_FILES_RUNTIME_AMP]: [CLIENT_STATIC_FILES_RUNTIME_AMP]:
`./` + `./` +
...@@ -638,8 +639,7 @@ export default async function getBaseWebpackConfig( ...@@ -638,8 +639,7 @@ export default async function getBaseWebpackConfig(
process: require.resolve('./polyfills/process'), process: require.resolve('./polyfills/process'),
// Handled in separate alias // Handled in separate alias
querystring: require.resolve('next/dist/compiled/querystring-es3'), querystring: require.resolve('next/dist/compiled/querystring-es3'),
// TODO: investigate ncc'ing stream-browserify stream: require.resolve('next/dist/compiled/stream-browserify'),
stream: require.resolve('stream-browserify'),
string_decoder: require.resolve( string_decoder: require.resolve(
'next/dist/compiled/string_decoder' 'next/dist/compiled/string_decoder'
), ),
...@@ -912,7 +912,8 @@ export default async function getBaseWebpackConfig( ...@@ -912,7 +912,8 @@ export default async function getBaseWebpackConfig(
const externalType = isEsm ? 'module' : 'commonjs' const externalType = isEsm ? 'module' : 'commonjs'
if ( if (
res.match(/next[/\\]dist[/\\]shared[/\\](?!lib[/\\]router[/\\]router)/) res.match(/next[/\\]dist[/\\]shared[/\\](?!lib[/\\]router[/\\]router)/) ||
res.match(/next[/\\]dist[/\\]compiled[/\\].*\.[mc]?js$/)
) { ) {
return `${externalType} ${request}` return `${externalType} ${request}`
} }
...@@ -1245,7 +1246,9 @@ export default async function getBaseWebpackConfig( ...@@ -1245,7 +1246,9 @@ export default async function getBaseWebpackConfig(
...codeCondition, ...codeCondition,
use: hasReactRefresh use: hasReactRefresh
? [ ? [
require.resolve('@next/react-refresh-utils/loader'), require.resolve(
'next/dist/compiled/@next/react-refresh-utils/loader'
),
defaultLoaders.babel, defaultLoaders.babel,
] ]
: defaultLoaders.babel, : defaultLoaders.babel,
......
...@@ -6,7 +6,7 @@ import { ...@@ -6,7 +6,7 @@ import {
sources, sources,
} from 'next/dist/compiled/webpack/webpack' } from 'next/dist/compiled/webpack/webpack'
import pLimit from 'next/dist/compiled/p-limit' import pLimit from 'next/dist/compiled/p-limit'
import { Worker } from 'jest-worker' import { Worker } from 'next/dist/compiled/jest-worker'
import { spans } from '../../profiling-plugin' import { spans } from '../../profiling-plugin'
function getEcmaVersion(environment) { function getEcmaVersion(environment) {
......
...@@ -125,6 +125,7 @@ const hookPropertyMap = new Map( ...@@ -125,6 +125,7 @@ const hookPropertyMap = new Map(
'@babel/runtime/package.json', '@babel/runtime/package.json',
'next/dist/compiled/@babel/runtime/package.json', 'next/dist/compiled/@babel/runtime/package.json',
], ],
['node-fetch', 'next/dist/compiled/node-fetch'],
].map(([request, replacement]) => [request, require.resolve(replacement)]) ].map(([request, replacement]) => [request, require.resolve(replacement)])
) )
......
...@@ -330,7 +330,7 @@ export async function initNext(opts: { webpackHMR?: any } = {}) { ...@@ -330,7 +330,7 @@ export async function initNext(opts: { webpackHMR?: any } = {}) {
CachedComponent = pageEntrypoint.component CachedComponent = pageEntrypoint.component
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {
const { isValidElementType } = require('react-is') const { isValidElementType } = require('next/dist/compiled/react-is')
if (!isValidElementType(CachedComponent)) { if (!isValidElementType(CachedComponent)) {
throw new Error( throw new Error(
`The default export is not a React Component in page: "${page}"` `The default export is not a React Component in page: "${page}"`
......
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// Shared between webpack 4 and 5:
function injectRefreshFunctions(compilation, Template) {
const hookVars = compilation.mainTemplate.hooks.localVars;
hookVars.tap('ReactFreshWebpackPlugin', (source) => Template.asString([
source,
'',
'// noop fns to prevent runtime errors during initialization',
'if (typeof self !== "undefined") {',
Template.indent('self.$RefreshReg$ = function () {};'),
Template.indent('self.$RefreshSig$ = function () {'),
Template.indent(Template.indent('return function (type) {')),
Template.indent(Template.indent(Template.indent('return type;'))),
Template.indent(Template.indent('};')),
Template.indent('};'),
'}',
]));
}
function webpack4(compiler) {
const { Template } = this;
// Webpack 4 does not have a method to handle interception of module
// execution.
// The closest thing we have to emulating this is mimicking the behavior of
// `strictModuleExceptionHandling` in `MainTemplate`:
// https://github.com/webpack/webpack/blob/4c644bf1f7cb067c748a52614500e0e2182b2700/lib/MainTemplate.js#L200
compiler.hooks.compilation.tap('ReactFreshWebpackPlugin', (compilation) => {
injectRefreshFunctions(compilation, Template);
const hookRequire = compilation.mainTemplate.hooks.require;
// @ts-ignore webpack 5 types compat
hookRequire.tap('ReactFreshWebpackPlugin', (source) => {
// Webpack 4 evaluates module code on the following line:
// ```
// modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
// ```
// https://github.com/webpack/webpack/blob/4c644bf1f7cb067c748a52614500e0e2182b2700/lib/MainTemplate.js#L200
const lines = source.split('\n');
// @ts-ignore webpack 5 types compat
const evalIndex = lines.findIndex((l) => l.includes('modules[moduleId].call('));
// Unable to find the module execution, that's OK:
if (evalIndex === -1) {
return source;
}
// Legacy CSS implementations will `eval` browser code in a Node.js
// context to extract CSS. For backwards compatibility, we need to check
// we're in a browser context before continuing.
return Template.asString([
...lines.slice(0, evalIndex),
`
var hasRefresh = typeof self !== "undefined" && !!self.$RefreshInterceptModuleExecution$;
var cleanup = hasRefresh
? self.$RefreshInterceptModuleExecution$(moduleId)
: function() {};
try {
`,
lines[evalIndex],
`
} finally {
cleanup();
}
`,
...lines.slice(evalIndex + 1),
]);
});
});
}
function webpack5(compiler) {
const { RuntimeGlobals, RuntimeModule, Template } = this;
class ReactRefreshRuntimeModule extends RuntimeModule {
constructor() {
super('react refresh', 5);
}
generate() {
const { runtimeTemplate } = this.compilation;
return Template.asString([
`if (${RuntimeGlobals.interceptModuleExecution}) {`,
`${RuntimeGlobals.interceptModuleExecution}.push(${runtimeTemplate.basicFunction('options', [
`${runtimeTemplate.supportsConst() ? 'const' : 'var'} originalFactory = options.factory;`,
`options.factory = ${runtimeTemplate.basicFunction('moduleObject, moduleExports, webpackRequire', [
// Legacy CSS implementations will `eval` browser code in a Node.js
// context to extract CSS. For backwards compatibility, we need to check
// we're in a browser context before continuing.
`${runtimeTemplate.supportsConst() ? 'const' : 'var'} hasRefresh = typeof self !== "undefined" && !!self.$RefreshInterceptModuleExecution$;`,
`${runtimeTemplate.supportsConst() ? 'const' : 'var'} cleanup = hasRefresh ? self.$RefreshInterceptModuleExecution$(moduleObject.id) : ${runtimeTemplate.supportsArrowFunction()
? '() => {}'
: 'function() {}'};`,
'try {',
Template.indent('originalFactory.call(this, moduleObject, moduleExports, webpackRequire);'),
'} finally {',
Template.indent(`cleanup();`),
'}',
])}`,
])})`,
'}',
]);
}
}
// @ts-ignore webpack 5 types compat
compiler.hooks.compilation.tap('ReactFreshWebpackPlugin', (compilation) => {
injectRefreshFunctions(compilation, Template);
// @ts-ignore Exists in webpack 5
compilation.hooks.additionalTreeRuntimeRequirements.tap('ReactFreshWebpackPlugin', (chunk) => {
// @ts-ignore Exists in webpack 5
compilation.addRuntimeModule(chunk, new ReactRefreshRuntimeModule());
});
});
}
class ReactFreshWebpackPlugin {
constructor({ version, RuntimeGlobals, RuntimeModule, Template } = require('webpack')) {
this.webpackMajorVersion = parseInt(version !== null && version !== void 0 ? version : '', 10);
this.RuntimeGlobals = RuntimeGlobals;
this.RuntimeModule = RuntimeModule;
this.Template = Template;
}
apply(compiler) {
switch (this.webpackMajorVersion) {
case 4: {
webpack4.call(this, compiler);
break;
}
case 5: {
webpack5.call(this, compiler);
break;
}
default: {
throw new Error(`ReactFreshWebpackPlugin does not support webpack v${this.webpackMajorVersion}.`);
}
}
}
}
exports.default = ReactFreshWebpackPlugin;
//# sourceMappingURL=ReactRefreshWebpackPlugin.js.map
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// This function gets unwrapped into global scope, which is why we don't invert
// if-blocks. Also, you cannot use `return`.
function default_1() {
var _a, _b;
// Legacy CSS implementations will `eval` browser code in a Node.js context
// to extract CSS. For backwards compatibility, we need to check we're in a
// browser context before continuing.
if (typeof self !== 'undefined' &&
// AMP / No-JS mode does not inject these helpers:
'$RefreshHelpers$' in self) {
var currentExports = module.__proto__.exports;
var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
// This cannot happen in MainTemplate because the exports mismatch between
// templating and execution.
self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
// A module can be accepted automatically based on its exports, e.g. when
// it is a Refresh Boundary.
if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
// Save the previous exports on update so we can compare the boundary
// signatures.
module.hot.dispose(function (data) {
data.prevExports = currentExports;
});
// Unconditionally accept an update to this module, we'll check if it's
// still a Refresh Boundary later.
module.hot.accept();
// This field is set when the previous version of this module was a
// Refresh Boundary, letting us know we need to check for invalidation or
// enqueue an update.
if (prevExports !== null) {
// A boundary can become ineligible if its exports are incompatible
// with the previous exports.
//
// For example, if you add/remove/change exports, we'll want to
// re-execute the importing modules, and force those components to
// re-render. Similarly, if you convert a class component to a
// function, we want to invalidate the boundary.
if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
module.hot.invalidate();
}
else {
self.$RefreshHelpers$.scheduleUpdate();
}
}
}
else {
// Since we just executed the code for the module, it's possible that the
// new exports made it ineligible for being a boundary.
// We only care about the case when we were _previously_ a boundary,
// because we already accepted this update (accidental side effect).
var isNoLongerABoundary = prevExports !== null;
if (isNoLongerABoundary) {
module.hot.invalidate();
}
}
}
}
exports.default = default_1;
//# sourceMappingURL=ReactRefreshModule.runtime.js.map
\ No newline at end of file
"use strict";
/**
* MIT License
*
* Copyright (c) Facebook, Inc. and its 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.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
// This file is copied from the Metro JavaScript bundler, with minor tweaks for
// webpack 4 compatibility.
//
// https://github.com/facebook/metro/blob/d6b9685c730d0d63577db40f41369157f28dfa3a/packages/metro/src/lib/polyfills/require.js
const runtime_1 = __importDefault(require("next/dist/compiled/react-refresh/runtime"));
function isSafeExport(key) {
return (key === '__esModule' ||
key === '__N_SSG' ||
key === '__N_SSP' ||
key === '__N_RSC' ||
// TODO: remove this key from page config instead of allow listing it
key === 'config');
}
function registerExportsForReactRefresh(moduleExports, moduleID) {
runtime_1.default.register(moduleExports, moduleID + ' %exports%');
if (moduleExports == null || typeof moduleExports !== 'object') {
// Exit if we can't iterate over exports.
// (This is important for legacy environments.)
return;
}
for (var key in moduleExports) {
if (isSafeExport(key)) {
continue;
}
var exportValue = moduleExports[key];
var typeID = moduleID + ' %exports% ' + key;
runtime_1.default.register(exportValue, typeID);
}
}
function isReactRefreshBoundary(moduleExports) {
if (runtime_1.default.isLikelyComponentType(moduleExports)) {
return true;
}
if (moduleExports == null || typeof moduleExports !== 'object') {
// Exit if we can't iterate over exports.
return false;
}
var hasExports = false;
var areAllExportsComponents = true;
for (var key in moduleExports) {
hasExports = true;
if (isSafeExport(key)) {
continue;
}
var exportValue = moduleExports[key];
if (!runtime_1.default.isLikelyComponentType(exportValue)) {
areAllExportsComponents = false;
}
}
return hasExports && areAllExportsComponents;
}
function shouldInvalidateReactRefreshBoundary(prevExports, nextExports) {
var prevSignature = getRefreshBoundarySignature(prevExports);
var nextSignature = getRefreshBoundarySignature(nextExports);
if (prevSignature.length !== nextSignature.length) {
return true;
}
for (var i = 0; i < nextSignature.length; i++) {
if (prevSignature[i] !== nextSignature[i]) {
return true;
}
}
return false;
}
function getRefreshBoundarySignature(moduleExports) {
var signature = [];
signature.push(runtime_1.default.getFamilyByType(moduleExports));
if (moduleExports == null || typeof moduleExports !== 'object') {
// Exit if we can't iterate over exports.
// (This is important for legacy environments.)
return signature;
}
for (var key in moduleExports) {
if (isSafeExport(key)) {
continue;
}
var exportValue = moduleExports[key];
signature.push(key);
signature.push(runtime_1.default.getFamilyByType(exportValue));
}
return signature;
}
var isUpdateScheduled = false;
function scheduleUpdate() {
if (isUpdateScheduled) {
return;
}
function canApplyUpdate() {
return module.hot.status() === 'idle';
}
isUpdateScheduled = true;
setTimeout(function () {
isUpdateScheduled = false;
// Only trigger refresh if the webpack HMR state is idle
if (canApplyUpdate()) {
try {
runtime_1.default.performReactRefresh();
}
catch (err) {
console.warn('Warning: Failed to re-render. We will retry on the next Fast Refresh event.\n' +
err);
}
return;
}
return scheduleUpdate();
}, 30);
}
// Needs to be compatible with IE11
exports.default = {
registerExportsForReactRefresh: registerExportsForReactRefresh,
isReactRefreshBoundary: isReactRefreshBoundary,
shouldInvalidateReactRefreshBoundary: shouldInvalidateReactRefreshBoundary,
getRefreshBoundarySignature: getRefreshBoundarySignature,
scheduleUpdate: scheduleUpdate,
};
//# sourceMappingURL=helpers.js.map
\ No newline at end of file
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const ReactRefreshModule_runtime_1 = __importDefault(require("./internal/ReactRefreshModule.runtime"));
let refreshModuleRuntime = ReactRefreshModule_runtime_1.default.toString();
refreshModuleRuntime = refreshModuleRuntime.slice(refreshModuleRuntime.indexOf('{') + 1, refreshModuleRuntime.lastIndexOf('}'));
const ReactRefreshLoader = function ReactRefreshLoader(source, inputSourceMap) {
this.callback(null, `${source}\n\n;${refreshModuleRuntime}`, inputSourceMap);
};
exports.default = ReactRefreshLoader;
//# sourceMappingURL=loader.js.map
\ No newline at end of file
{
"name": "@next/react-refresh-utils",
"version": "12.0.9-canary.0",
"description": "An experimental package providing utilities for React Refresh.",
"repository": {
"url": "vercel/next.js",
"directory": "packages/react-refresh-utils"
},
"files": [
"internal/*.d.ts",
"internal/*.js",
"*.d.ts",
"*.js"
],
"author": "Joe Haddad <timer@vercel.com>",
"license": "MIT",
"scripts": {
"prepublish": "tsc -d -p tsconfig.json",
"dev": "tsc -d -w -p tsconfig.json"
},
"peerDependencies": {
"react-refresh": "0.8.3",
"webpack": "^4 || ^5"
},
"peerDependenciesMeta": {
"webpack": {
"optional": true
}
},
"devDependencies": {
"react-refresh": "0.8.3"
}
}
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const runtime_1 = __importDefault(require("next/dist/compiled/react-refresh/runtime"));
const helpers_1 = __importDefault(require("./internal/helpers"));
// Hook into ReactDOM initialization
runtime_1.default.injectIntoGlobalHook(self);
// Register global helpers
self.$RefreshHelpers$ = helpers_1.default;
// Register a helper for module execution interception
self.$RefreshInterceptModuleExecution$ = function (webpackModuleId) {
var prevRefreshReg = self.$RefreshReg$;
var prevRefreshSig = self.$RefreshSig$;
self.$RefreshReg$ = function (type, id) {
runtime_1.default.register(type, webpackModuleId + ' ' + id);
};
self.$RefreshSig$ = runtime_1.default.createSignatureFunctionForTransform;
// Modeled after `useEffect` cleanup pattern:
// https://reactjs.org/docs/hooks-effect.html#effects-with-cleanup
return function () {
self.$RefreshReg$ = prevRefreshReg;
self.$RefreshSig$ = prevRefreshSig;
};
};
//# sourceMappingURL=runtime.js.map
\ No newline at end of file
MIT License
Copyright (c) Facebook, Inc. and its 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":"jest-worker","main":"threadChild.js.tmp.js","license":"MIT"}
(()=>{"use strict";var __webpack_modules__={66:(e,r)=>{Object.defineProperty(r,"__esModule",{value:true});r.PARENT_MESSAGE_CUSTOM=r.PARENT_MESSAGE_SETUP_ERROR=r.PARENT_MESSAGE_CLIENT_ERROR=r.PARENT_MESSAGE_OK=r.CHILD_MESSAGE_END=r.CHILD_MESSAGE_CALL=r.CHILD_MESSAGE_INITIALIZE=void 0;const t=0;r.CHILD_MESSAGE_INITIALIZE=t;const _=1;r.CHILD_MESSAGE_CALL=_;const n=2;r.CHILD_MESSAGE_END=n;const o=0;r.PARENT_MESSAGE_OK=o;const s=1;r.PARENT_MESSAGE_CLIENT_ERROR=s;const c=2;r.PARENT_MESSAGE_SETUP_ERROR=c;const i=3;r.PARENT_MESSAGE_CUSTOM=i}};var __webpack_module_cache__={};function __nccwpck_require__(e){var r=__webpack_module_cache__[e];if(r!==undefined){return r.exports}var t=__webpack_module_cache__[e]={exports:{}};var _=true;try{__webpack_modules__[e](t,t.exports,__nccwpck_require__);_=false}finally{if(_)delete __webpack_module_cache__[e]}return t.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__={};(()=>{function _types(){const e=__nccwpck_require__(66);_types=function(){return e};return e}let file=null;let setupArgs=[];let initialized=false;const messageListener=e=>{switch(e[0]){case _types().CHILD_MESSAGE_INITIALIZE:const r=e;file=r[2];setupArgs=e[3];break;case _types().CHILD_MESSAGE_CALL:const t=e;execMethod(t[2],t[3]);break;case _types().CHILD_MESSAGE_END:end();break;default:throw new TypeError("Unexpected request from parent process: "+e[0])}};process.on("message",messageListener);function reportSuccess(e){if(!process||!process.send){throw new Error("Child can only be used on a forked process")}process.send([_types().PARENT_MESSAGE_OK,e])}function reportClientError(e){return reportError(e,_types().PARENT_MESSAGE_CLIENT_ERROR)}function reportInitializeError(e){return reportError(e,_types().PARENT_MESSAGE_SETUP_ERROR)}function reportError(e,r){if(!process||!process.send){throw new Error("Child can only be used on a forked process")}if(e==null){e=new Error('"null" or "undefined" thrown')}process.send([r,e.constructor&&e.constructor.name,e.message,e.stack,typeof e==="object"?{...e}:e])}function end(){const main=eval("require")(file);if(!main.teardown){exitProcess();return}execFunction(main.teardown,main,[],exitProcess,exitProcess)}function exitProcess(){process.removeListener("message",messageListener)}function execMethod(method,args){const main=eval("require")(file);let fn;if(method==="default"){fn=main.__esModule?main["default"]:main}else{fn=main[method]}function execHelper(){execFunction(fn,main,args,reportSuccess,reportClientError)}if(initialized||!main.setup){execHelper();return}initialized=true;execFunction(main.setup,main,setupArgs,execHelper,reportInitializeError)}const isPromise=e=>!!e&&(typeof e==="object"||typeof e==="function")&&typeof e.then==="function";function execFunction(e,r,t,_,n){let o;try{o=e.apply(r,t)}catch(e){n(e);return}if(isPromise(o)){o.then(_,n)}else{_(o)}}})();module.exports=__webpack_exports__})();
\ No newline at end of file
(()=>{"use strict";var __webpack_modules__={66:(e,r)=>{Object.defineProperty(r,"__esModule",{value:true});r.PARENT_MESSAGE_CUSTOM=r.PARENT_MESSAGE_SETUP_ERROR=r.PARENT_MESSAGE_CLIENT_ERROR=r.PARENT_MESSAGE_OK=r.CHILD_MESSAGE_END=r.CHILD_MESSAGE_CALL=r.CHILD_MESSAGE_INITIALIZE=void 0;const t=0;r.CHILD_MESSAGE_INITIALIZE=t;const _=1;r.CHILD_MESSAGE_CALL=_;const n=2;r.CHILD_MESSAGE_END=n;const o=0;r.PARENT_MESSAGE_OK=o;const s=1;r.PARENT_MESSAGE_CLIENT_ERROR=s;const i=2;r.PARENT_MESSAGE_SETUP_ERROR=i;const a=3;r.PARENT_MESSAGE_CUSTOM=a},267:e=>{e.exports=require("worker_threads")}};var __webpack_module_cache__={};function __nccwpck_require__(e){var r=__webpack_module_cache__[e];if(r!==undefined){return r.exports}var t=__webpack_module_cache__[e]={exports:{}};var _=true;try{__webpack_modules__[e](t,t.exports,__nccwpck_require__);_=false}finally{if(_)delete __webpack_module_cache__[e]}return t.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__={};(()=>{function _worker_threads(){const e=__nccwpck_require__(267);_worker_threads=function(){return e};return e}function _types(){const e=__nccwpck_require__(66);_types=function(){return e};return e}let file=null;let setupArgs=[];let initialized=false;const messageListener=e=>{switch(e[0]){case _types().CHILD_MESSAGE_INITIALIZE:const r=e;file=r[2];setupArgs=e[3];break;case _types().CHILD_MESSAGE_CALL:const t=e;execMethod(t[2],t[3]);break;case _types().CHILD_MESSAGE_END:end();break;default:throw new TypeError("Unexpected request from parent process: "+e[0])}};_worker_threads().parentPort.on("message",messageListener);function reportSuccess(e){if(_worker_threads().isMainThread){throw new Error("Child can only be used on a forked process")}_worker_threads().parentPort.postMessage([_types().PARENT_MESSAGE_OK,e])}function reportClientError(e){return reportError(e,_types().PARENT_MESSAGE_CLIENT_ERROR)}function reportInitializeError(e){return reportError(e,_types().PARENT_MESSAGE_SETUP_ERROR)}function reportError(e,r){if(_worker_threads().isMainThread){throw new Error("Child can only be used on a forked process")}if(e==null){e=new Error('"null" or "undefined" thrown')}_worker_threads().parentPort.postMessage([r,e.constructor&&e.constructor.name,e.message,e.stack,typeof e==="object"?{...e}:e])}function end(){const main=eval("require")(file);if(!main.teardown){exitProcess();return}execFunction(main.teardown,main,[],exitProcess,exitProcess)}function exitProcess(){_worker_threads().parentPort.removeListener("message",messageListener)}function execMethod(method,args){const main=eval("require")(file);let fn;if(method==="default"){fn=main.__esModule?main["default"]:main}else{fn=main[method]}function execHelper(){execFunction(fn,main,args,reportSuccess,reportClientError)}if(initialized||!main.setup){execHelper();return}initialized=true;execFunction(main.setup,main,setupArgs,execHelper,reportInitializeError)}const isPromise=e=>!!e&&(typeof e==="object"||typeof e==="function")&&typeof e.then==="function";function execFunction(e,r,t,_,n){let o;try{o=e.apply(r,t)}catch(e){n(e);return}if(isPromise(o)){o.then(_,n)}else{_(o)}}})();module.exports=__webpack_exports__})();
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{"name":"node-fetch","main":"index.js","author":"David Frank","license":"MIT"}
MIT License
Copyright (c) Facebook, Inc. and its 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.
# `react-is`
This package allows you to test arbitrary values and see if they're a particular React element type.
## Installation
```sh
# Yarn
yarn add react-is
# NPM
npm install react-is
```
## Usage
### Determining if a Component is Valid
```js
import React from "react";
import * as ReactIs from "react-is";
class ClassComponent extends React.Component {
render() {
return React.createElement("div");
}
}
const FunctionComponent = () => React.createElement("div");
const ForwardRefComponent = React.forwardRef((props, ref) =>
React.createElement(Component, { forwardedRef: ref, ...props })
);
const Context = React.createContext(false);
ReactIs.isValidElementType("div"); // true
ReactIs.isValidElementType(ClassComponent); // true
ReactIs.isValidElementType(FunctionComponent); // true
ReactIs.isValidElementType(ForwardRefComponent); // true
ReactIs.isValidElementType(Context.Provider); // true
ReactIs.isValidElementType(Context.Consumer); // true
ReactIs.isValidElementType(React.createFactory("div")); // true
```
### Determining an Element's Type
#### Context
```js
import React from "react";
import * as ReactIs from 'react-is';
const ThemeContext = React.createContext("blue");
ReactIs.isContextConsumer(<ThemeContext.Consumer />); // true
ReactIs.isContextProvider(<ThemeContext.Provider />); // true
ReactIs.typeOf(<ThemeContext.Provider />) === ReactIs.ContextProvider; // true
ReactIs.typeOf(<ThemeContext.Consumer />) === ReactIs.ContextConsumer; // true
```
#### Element
```js
import React from "react";
import * as ReactIs from 'react-is';
ReactIs.isElement(<div />); // true
ReactIs.typeOf(<div />) === ReactIs.Element; // true
```
#### Fragment
```js
import React from "react";
import * as ReactIs from 'react-is';
ReactIs.isFragment(<></>); // true
ReactIs.typeOf(<></>) === ReactIs.Fragment; // true
```
#### Portal
```js
import React from "react";
import ReactDOM from "react-dom";
import * as ReactIs from 'react-is';
const div = document.createElement("div");
const portal = ReactDOM.createPortal(<div />, div);
ReactIs.isPortal(portal); // true
ReactIs.typeOf(portal) === ReactIs.Portal; // true
```
#### StrictMode
```js
import React from "react";
import * as ReactIs from 'react-is';
ReactIs.isStrictMode(<React.StrictMode />); // true
ReactIs.typeOf(<React.StrictMode />) === ReactIs.StrictMode; // true
```
{
"branch": "pull/21051",
"buildNumber": "287151",
"checksum": "94f5c65",
"commit": "12adaffef",
"environment": "ci",
"reactVersion": "17.0.0-12adaffef"
}
/** @license React v17.0.2
* react-is.development.js
*
* Copyright (c) Facebook, Inc. and its 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';
// ATTENTION
// When adding new symbols to this file,
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var REACT_ELEMENT_TYPE = 0xeac7;
var REACT_PORTAL_TYPE = 0xeaca;
var REACT_FRAGMENT_TYPE = 0xeacb;
var REACT_STRICT_MODE_TYPE = 0xeacc;
var REACT_PROFILER_TYPE = 0xead2;
var REACT_PROVIDER_TYPE = 0xeacd;
var REACT_CONTEXT_TYPE = 0xeace;
var REACT_FORWARD_REF_TYPE = 0xead0;
var REACT_SUSPENSE_TYPE = 0xead1;
var REACT_SUSPENSE_LIST_TYPE = 0xead8;
var REACT_MEMO_TYPE = 0xead3;
var REACT_LAZY_TYPE = 0xead4;
var REACT_BLOCK_TYPE = 0xead9;
var REACT_SERVER_BLOCK_TYPE = 0xeada;
var REACT_FUNDAMENTAL_TYPE = 0xead5;
var REACT_SCOPE_TYPE = 0xead7;
var REACT_OPAQUE_ID_TYPE = 0xeae0;
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
var REACT_OFFSCREEN_TYPE = 0xeae2;
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
if (typeof Symbol === 'function' && Symbol.for) {
var symbolFor = Symbol.for;
REACT_ELEMENT_TYPE = symbolFor('react.element');
REACT_PORTAL_TYPE = symbolFor('react.portal');
REACT_FRAGMENT_TYPE = symbolFor('react.fragment');
REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
REACT_PROFILER_TYPE = symbolFor('react.profiler');
REACT_PROVIDER_TYPE = symbolFor('react.provider');
REACT_CONTEXT_TYPE = symbolFor('react.context');
REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
REACT_MEMO_TYPE = symbolFor('react.memo');
REACT_LAZY_TYPE = symbolFor('react.lazy');
REACT_BLOCK_TYPE = symbolFor('react.block');
REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
REACT_SCOPE_TYPE = symbolFor('react.scope');
REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
}
// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
var enableScopeAPI = false; // Experimental Create Event Handle API.
function isValidElementType(type) {
if (typeof type === 'string' || typeof type === 'function') {
return true;
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
return true;
}
if (typeof type === 'object' && type !== null) {
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
return true;
}
}
return false;
}
function typeOf(object) {
if (typeof object === 'object' && object !== null) {
var $$typeof = object.$$typeof;
switch ($$typeof) {
case REACT_ELEMENT_TYPE:
var type = object.type;
switch (type) {
case REACT_FRAGMENT_TYPE:
case REACT_PROFILER_TYPE:
case REACT_STRICT_MODE_TYPE:
case REACT_SUSPENSE_TYPE:
case REACT_SUSPENSE_LIST_TYPE:
return type;
default:
var $$typeofType = type && type.$$typeof;
switch ($$typeofType) {
case REACT_CONTEXT_TYPE:
case REACT_FORWARD_REF_TYPE:
case REACT_LAZY_TYPE:
case REACT_MEMO_TYPE:
case REACT_PROVIDER_TYPE:
return $$typeofType;
default:
return $$typeof;
}
}
case REACT_PORTAL_TYPE:
return $$typeof;
}
}
return undefined;
}
var ContextConsumer = REACT_CONTEXT_TYPE;
var ContextProvider = REACT_PROVIDER_TYPE;
var Element = REACT_ELEMENT_TYPE;
var ForwardRef = REACT_FORWARD_REF_TYPE;
var Fragment = REACT_FRAGMENT_TYPE;
var Lazy = REACT_LAZY_TYPE;
var Memo = REACT_MEMO_TYPE;
var Portal = REACT_PORTAL_TYPE;
var Profiler = REACT_PROFILER_TYPE;
var StrictMode = REACT_STRICT_MODE_TYPE;
var Suspense = REACT_SUSPENSE_TYPE;
var hasWarnedAboutDeprecatedIsAsyncMode = false;
var hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated
function isAsyncMode(object) {
{
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
}
}
return false;
}
function isConcurrentMode(object) {
{
if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint
console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
}
}
return false;
}
function isContextConsumer(object) {
return typeOf(object) === REACT_CONTEXT_TYPE;
}
function isContextProvider(object) {
return typeOf(object) === REACT_PROVIDER_TYPE;
}
function isElement(object) {
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
}
function isForwardRef(object) {
return typeOf(object) === REACT_FORWARD_REF_TYPE;
}
function isFragment(object) {
return typeOf(object) === REACT_FRAGMENT_TYPE;
}
function isLazy(object) {
return typeOf(object) === REACT_LAZY_TYPE;
}
function isMemo(object) {
return typeOf(object) === REACT_MEMO_TYPE;
}
function isPortal(object) {
return typeOf(object) === REACT_PORTAL_TYPE;
}
function isProfiler(object) {
return typeOf(object) === REACT_PROFILER_TYPE;
}
function isStrictMode(object) {
return typeOf(object) === REACT_STRICT_MODE_TYPE;
}
function isSuspense(object) {
return typeOf(object) === REACT_SUSPENSE_TYPE;
}
exports.ContextConsumer = ContextConsumer;
exports.ContextProvider = ContextProvider;
exports.Element = Element;
exports.ForwardRef = ForwardRef;
exports.Fragment = Fragment;
exports.Lazy = Lazy;
exports.Memo = Memo;
exports.Portal = Portal;
exports.Profiler = Profiler;
exports.StrictMode = StrictMode;
exports.Suspense = Suspense;
exports.isAsyncMode = isAsyncMode;
exports.isConcurrentMode = isConcurrentMode;
exports.isContextConsumer = isContextConsumer;
exports.isContextProvider = isContextProvider;
exports.isElement = isElement;
exports.isForwardRef = isForwardRef;
exports.isFragment = isFragment;
exports.isLazy = isLazy;
exports.isMemo = isMemo;
exports.isPortal = isPortal;
exports.isProfiler = isProfiler;
exports.isStrictMode = isStrictMode;
exports.isSuspense = isSuspense;
exports.isValidElementType = isValidElementType;
exports.typeOf = typeOf;
})();
}
/** @license React v17.0.2
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its 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=60103,c=60106,d=60107,e=60108,f=60114,g=60109,h=60110,k=60112,l=60113,m=60120,n=60115,p=60116,q=60121,r=60122,u=60117,v=60129,w=60131;
if("function"===typeof Symbol&&Symbol.for){var x=Symbol.for;b=x("react.element");c=x("react.portal");d=x("react.fragment");e=x("react.strict_mode");f=x("react.profiler");g=x("react.provider");h=x("react.context");k=x("react.forward_ref");l=x("react.suspense");m=x("react.suspense_list");n=x("react.memo");p=x("react.lazy");q=x("react.block");r=x("react.server.block");u=x("react.fundamental");v=x("react.debug_trace_mode");w=x("react.legacy_hidden")}
function y(a){if("object"===typeof a&&null!==a){var t=a.$$typeof;switch(t){case b:switch(a=a.type,a){case d:case f:case e:case l:case m:return a;default:switch(a=a&&a.$$typeof,a){case h:case k:case p:case n:case g:return a;default:return t}}case c:return t}}}var z=g,A=b,B=k,C=d,D=p,E=n,F=c,G=f,H=e,I=l;exports.ContextConsumer=h;exports.ContextProvider=z;exports.Element=A;exports.ForwardRef=B;exports.Fragment=C;exports.Lazy=D;exports.Memo=E;exports.Portal=F;exports.Profiler=G;exports.StrictMode=H;
exports.Suspense=I;exports.isAsyncMode=function(){return!1};exports.isConcurrentMode=function(){return!1};exports.isContextConsumer=function(a){return y(a)===h};exports.isContextProvider=function(a){return y(a)===g};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===b};exports.isForwardRef=function(a){return y(a)===k};exports.isFragment=function(a){return y(a)===d};exports.isLazy=function(a){return y(a)===p};exports.isMemo=function(a){return y(a)===n};
exports.isPortal=function(a){return y(a)===c};exports.isProfiler=function(a){return y(a)===f};exports.isStrictMode=function(a){return y(a)===e};exports.isSuspense=function(a){return y(a)===l};exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===d||a===f||a===v||a===e||a===l||a===m||a===w||"object"===typeof a&&null!==a&&(a.$$typeof===p||a.$$typeof===n||a.$$typeof===g||a.$$typeof===h||a.$$typeof===k||a.$$typeof===u||a.$$typeof===q||a[0]===r)?!0:!1};
exports.typeOf=y;
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-is.production.min.js');
} else {
module.exports = require('./cjs/react-is.development.js');
}
{
"name": "react-is",
"version": "17.0.2",
"description": "Brand checking of React Elements.",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/facebook/react.git",
"directory": "packages/react-is"
},
"keywords": [
"react"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/facebook/react/issues"
},
"homepage": "https://reactjs.org/",
"files": [
"LICENSE",
"README.md",
"build-info.json",
"index.js",
"cjs/",
"umd/"
]
}
/** @license React v17.0.2
* react-is.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = global || self, factory(global.ReactIs = {}));
}(this, (function (exports) { 'use strict';
// ATTENTION
// When adding new symbols to this file,
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var REACT_ELEMENT_TYPE = 0xeac7;
var REACT_PORTAL_TYPE = 0xeaca;
var REACT_FRAGMENT_TYPE = 0xeacb;
var REACT_STRICT_MODE_TYPE = 0xeacc;
var REACT_PROFILER_TYPE = 0xead2;
var REACT_PROVIDER_TYPE = 0xeacd;
var REACT_CONTEXT_TYPE = 0xeace;
var REACT_FORWARD_REF_TYPE = 0xead0;
var REACT_SUSPENSE_TYPE = 0xead1;
var REACT_SUSPENSE_LIST_TYPE = 0xead8;
var REACT_MEMO_TYPE = 0xead3;
var REACT_LAZY_TYPE = 0xead4;
var REACT_BLOCK_TYPE = 0xead9;
var REACT_SERVER_BLOCK_TYPE = 0xeada;
var REACT_FUNDAMENTAL_TYPE = 0xead5;
var REACT_SCOPE_TYPE = 0xead7;
var REACT_OPAQUE_ID_TYPE = 0xeae0;
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
var REACT_OFFSCREEN_TYPE = 0xeae2;
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
if (typeof Symbol === 'function' && Symbol.for) {
var symbolFor = Symbol.for;
REACT_ELEMENT_TYPE = symbolFor('react.element');
REACT_PORTAL_TYPE = symbolFor('react.portal');
REACT_FRAGMENT_TYPE = symbolFor('react.fragment');
REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
REACT_PROFILER_TYPE = symbolFor('react.profiler');
REACT_PROVIDER_TYPE = symbolFor('react.provider');
REACT_CONTEXT_TYPE = symbolFor('react.context');
REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
REACT_MEMO_TYPE = symbolFor('react.memo');
REACT_LAZY_TYPE = symbolFor('react.lazy');
REACT_BLOCK_TYPE = symbolFor('react.block');
REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
REACT_SCOPE_TYPE = symbolFor('react.scope');
REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
}
// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
var enableScopeAPI = false; // Experimental Create Event Handle API.
function isValidElementType(type) {
if (typeof type === 'string' || typeof type === 'function') {
return true;
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
return true;
}
if (typeof type === 'object' && type !== null) {
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
return true;
}
}
return false;
}
function typeOf(object) {
if (typeof object === 'object' && object !== null) {
var $$typeof = object.$$typeof;
switch ($$typeof) {
case REACT_ELEMENT_TYPE:
var type = object.type;
switch (type) {
case REACT_FRAGMENT_TYPE:
case REACT_PROFILER_TYPE:
case REACT_STRICT_MODE_TYPE:
case REACT_SUSPENSE_TYPE:
case REACT_SUSPENSE_LIST_TYPE:
return type;
default:
var $$typeofType = type && type.$$typeof;
switch ($$typeofType) {
case REACT_CONTEXT_TYPE:
case REACT_FORWARD_REF_TYPE:
case REACT_LAZY_TYPE:
case REACT_MEMO_TYPE:
case REACT_PROVIDER_TYPE:
return $$typeofType;
default:
return $$typeof;
}
}
case REACT_PORTAL_TYPE:
return $$typeof;
}
}
return undefined;
}
var ContextConsumer = REACT_CONTEXT_TYPE;
var ContextProvider = REACT_PROVIDER_TYPE;
var Element = REACT_ELEMENT_TYPE;
var ForwardRef = REACT_FORWARD_REF_TYPE;
var Fragment = REACT_FRAGMENT_TYPE;
var Lazy = REACT_LAZY_TYPE;
var Memo = REACT_MEMO_TYPE;
var Portal = REACT_PORTAL_TYPE;
var Profiler = REACT_PROFILER_TYPE;
var StrictMode = REACT_STRICT_MODE_TYPE;
var Suspense = REACT_SUSPENSE_TYPE;
var hasWarnedAboutDeprecatedIsAsyncMode = false;
var hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated
function isAsyncMode(object) {
{
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
}
}
return false;
}
function isConcurrentMode(object) {
{
if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint
console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
}
}
return false;
}
function isContextConsumer(object) {
return typeOf(object) === REACT_CONTEXT_TYPE;
}
function isContextProvider(object) {
return typeOf(object) === REACT_PROVIDER_TYPE;
}
function isElement(object) {
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
}
function isForwardRef(object) {
return typeOf(object) === REACT_FORWARD_REF_TYPE;
}
function isFragment(object) {
return typeOf(object) === REACT_FRAGMENT_TYPE;
}
function isLazy(object) {
return typeOf(object) === REACT_LAZY_TYPE;
}
function isMemo(object) {
return typeOf(object) === REACT_MEMO_TYPE;
}
function isPortal(object) {
return typeOf(object) === REACT_PORTAL_TYPE;
}
function isProfiler(object) {
return typeOf(object) === REACT_PROFILER_TYPE;
}
function isStrictMode(object) {
return typeOf(object) === REACT_STRICT_MODE_TYPE;
}
function isSuspense(object) {
return typeOf(object) === REACT_SUSPENSE_TYPE;
}
exports.ContextConsumer = ContextConsumer;
exports.ContextProvider = ContextProvider;
exports.Element = Element;
exports.ForwardRef = ForwardRef;
exports.Fragment = Fragment;
exports.Lazy = Lazy;
exports.Memo = Memo;
exports.Portal = Portal;
exports.Profiler = Profiler;
exports.StrictMode = StrictMode;
exports.Suspense = Suspense;
exports.isAsyncMode = isAsyncMode;
exports.isConcurrentMode = isConcurrentMode;
exports.isContextConsumer = isContextConsumer;
exports.isContextProvider = isContextProvider;
exports.isElement = isElement;
exports.isForwardRef = isForwardRef;
exports.isFragment = isFragment;
exports.isLazy = isLazy;
exports.isMemo = isMemo;
exports.isPortal = isPortal;
exports.isProfiler = isProfiler;
exports.isStrictMode = isStrictMode;
exports.isSuspense = isSuspense;
exports.isValidElementType = isValidElementType;
exports.typeOf = typeOf;
})));
/** @license React v17.0.2
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
(function(){'use strict';(function(b,d){"object"===typeof exports&&"undefined"!==typeof module?d(exports):"function"===typeof define&&define.amd?define(["exports"],d):(b=b||self,d(b.ReactIs={}))})(this,function(b){function d(a){if("object"===typeof a&&null!==a){var b=a.$$typeof;switch(b){case q:switch(a=a.type,a){case e:case f:case g:case h:case t:return a;default:switch(a=a&&a.$$typeof,a){case k:case l:case m:case n:case p:return a;default:return b}}case r:return b}}}var q=60103,r=60106,e=60107,g=60108,f=60114,
p=60109,k=60110,l=60112,h=60113,t=60120,n=60115,m=60116,u=60121,v=60122,w=60117,x=60129,y=60131;if("function"===typeof Symbol&&Symbol.for){var c=Symbol.for;q=c("react.element");r=c("react.portal");e=c("react.fragment");g=c("react.strict_mode");f=c("react.profiler");p=c("react.provider");k=c("react.context");l=c("react.forward_ref");h=c("react.suspense");t=c("react.suspense_list");n=c("react.memo");m=c("react.lazy");u=c("react.block");v=c("react.server.block");w=c("react.fundamental");x=c("react.debug_trace_mode");
y=c("react.legacy_hidden")}b.ContextConsumer=k;b.ContextProvider=p;b.Element=q;b.ForwardRef=l;b.Fragment=e;b.Lazy=m;b.Memo=n;b.Portal=r;b.Profiler=f;b.StrictMode=g;b.Suspense=h;b.isAsyncMode=function(a){return!1};b.isConcurrentMode=function(a){return!1};b.isContextConsumer=function(a){return d(a)===k};b.isContextProvider=function(a){return d(a)===p};b.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===q};b.isForwardRef=function(a){return d(a)===l};b.isFragment=function(a){return d(a)===
e};b.isLazy=function(a){return d(a)===m};b.isMemo=function(a){return d(a)===n};b.isPortal=function(a){return d(a)===r};b.isProfiler=function(a){return d(a)===f};b.isStrictMode=function(a){return d(a)===g};b.isSuspense=function(a){return d(a)===h};b.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===f||a===x||a===g||a===h||a===t||a===y||"object"===typeof a&&null!==a&&(a.$$typeof===m||a.$$typeof===n||a.$$typeof===p||a.$$typeof===k||a.$$typeof===l||a.$$typeof===
w||a.$$typeof===u||a[0]===v)?!0:!1};b.typeOf=d});
})();
MIT License
Copyright (c) Facebook, Inc. and its 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.
# react-refresh
This package implements the wiring necessary to integrate Fast Refresh into bundlers. Fast Refresh is a feature that lets you edit React components in a running application without losing their state. It is similar to an old feature known as "hot reloading", but Fast Refresh is more reliable and officially supported by React.
This package is primarily aimed at developers of bundler plugins. If you’re working on one, here is a [rough guide](https://github.com/facebook/react/issues/16604#issuecomment-528663101) for Fast Refresh integration using this package.
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-refresh-babel.production.min.js');
} else {
module.exports = require('./cjs/react-refresh-babel.development.js');
}
/** @license React vundefined
* react-refresh-babel.production.min.js
*
* Copyright (c) Facebook, Inc. and its 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';module.exports=function(r){function t(a,b){var d=a.scope.generateUidIdentifier("c");l.has(a)||l.set(a,[]);l.get(a).push({handle:d,persistentID:b});return d}function u(a){return"string"===typeof a&&"A"<=a[0]&&"Z">=a[0]}function m(a,b,d){var c=b.node;switch(c.type){case "Identifier":if(!u(c.name))break;d(a,c,null);return!0;case "FunctionDeclaration":return d(a,c.id,null),!0;case "ArrowFunctionExpression":if("ArrowFunctionExpression"===c.body.type)break;d(a,c,b);return!0;case "FunctionExpression":return d(a,
c,b),!0;case "CallExpression":var f=b.get("arguments");if(void 0===f||0===f.length)break;var g=b.get("callee");switch(g.node.type){case "MemberExpression":case "Identifier":g=g.getSource();if(!m(a+"$"+g,f[0],d))return!1;d(a,c,b);return!0;default:return!1}case "VariableDeclarator":if(f=c.init,null!==f&&(g=c.id.name,u(g))){switch(f.type){case "ArrowFunctionExpression":case "FunctionExpression":break;case "CallExpression":c=f.callee;var e=c.type;if("Import"===e)return!1;if("Identifier"===e){if(0===c.name.indexOf("require")||
0===c.name.indexOf("import"))return!1}else if("MemberExpression"!==e)return!1;break;case "TaggedTemplateExpression":break;default:return!1}c=b.get("init");if(m(a,c,d))return!0;g=b.scope.getBinding(g);if(void 0===g)return;b=!1;g=g.referencePaths;for(e=0;e<g.length;e++){var h=g[e];if(!h.node||"JSXIdentifier"===h.node.type||"Identifier"===h.node.type){h=h.parent;if("JSXOpeningElement"===h.type)b=!0;else if("CallExpression"===h.type){h=h.callee;var k=void 0;switch(h.type){case "Identifier":k=h.name;break;
case "MemberExpression":k=h.property.name}switch(k){case "createElement":case "jsx":case "jsxDEV":case "jsxs":b=!0}}if(b)return d(a,f,c),!0}}}}return!1}function w(a){a=n.get(a);return void 0===a?null:{key:a.map(function(a){return a.name+"{"+a.key+"}"}).join("\n"),customHooks:a.filter(function(a){a:switch(a.name){case "useState":case "React.useState":case "useReducer":case "React.useReducer":case "useEffect":case "React.useEffect":case "useLayoutEffect":case "React.useLayoutEffect":case "useMemo":case "React.useMemo":case "useCallback":case "React.useCallback":case "useRef":case "React.useRef":case "useContext":case "React.useContext":case "useImperativeMethods":case "React.useImperativeMethods":case "useDebugValue":case "React.useDebugValue":a=
!0;break a;default:a=!1}return!a}).map(function(a){return e.cloneDeep(a.callee)})}}function B(a){a=a.hub.file;var b=x.get(a);if(void 0!==b)return b;b=!1;for(var d=a.ast.comments,c=0;c<d.length;c++)if(-1!==d[c].value.indexOf("@refresh reset")){b=!0;break}x.set(a,b);return b}function v(a,b,d){var c=b.key;b=b.customHooks;var f=B(d.path),g=[];b.forEach(function(a){switch(a.type){case "MemberExpression":if("Identifier"===a.object.type)var b=a.object.name;break;case "Identifier":b=a.name}d.hasBinding(b)?
g.push(a):f=!0});b=c;"function"!==typeof require||p.emitFullSignatures||(b=require("crypto").createHash("sha1").update(c).digest("base64"));a=[a,e.stringLiteral(b)];(f||0<g.length)&&a.push(e.booleanLiteral(f));0<g.length&&a.push(e.functionExpression(null,[],e.blockStatement([e.returnStatement(e.arrayExpression(g))])));return a}var p=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if("function"===typeof r.getEnv){var y=r.getEnv();if("development"!==y&&!p.skipEnvCheck)throw Error('React Refresh Babel transform should only be enabled in development environment. Instead, the environment is: "'+
y+'". If you want to override this check, pass {skipEnvCheck: true} as plugin options.');}var e=r.types,C=e.identifier(p.refreshReg||"$RefreshReg$"),z=e.identifier(p.refreshSig||"$RefreshSig$"),l=new Map,x=new WeakMap,k=new WeakSet,q=new WeakSet,A=new WeakSet,n=new WeakMap,D={CallExpression:function(a){var b=a.node.callee,d=null;switch(b.type){case "Identifier":d=b.name;break;case "MemberExpression":d=b.property.name}if(null!==d&&/^use[A-Z]/.test(d)&&(b=a.scope.getFunctionParent(),null!==b)){b=b.block;
n.has(b)||n.set(b,[]);b=n.get(b);var c="";"VariableDeclarator"===a.parent.type&&(c=a.parentPath.get("id").getSource());var f=a.get("arguments");"useState"===d&&0<f.length?c+="("+f[0].getSource()+")":"useReducer"===d&&1<f.length&&(c+="("+f[1].getSource()+")");b.push({callee:a.node.callee,name:d,key:c})}}};return{visitor:{ExportDefaultDeclaration:function(a){var b=a.node,d=b.declaration,c=a.get("declaration");if("CallExpression"===d.type&&!k.has(b)){k.add(b);var f=a.parentPath;m("%default%",c,function(a,
b,c){null!==c&&(a=t(f,a),c.replaceWith(e.assignmentExpression("=",a,b)))})}},FunctionDeclaration:{enter:function(a){var b=a.node;switch(a.parent.type){case "Program":var d=a;var c=a.parentPath;break;case "ExportNamedDeclaration":d=a.parentPath;c=d.parentPath;break;case "ExportDefaultDeclaration":d=a.parentPath;c=d.parentPath;break;default:return}var f=b.id;null!==f&&(f=f.name,u(f)&&!k.has(b)&&(k.add(b),m(f,a,function(a,b){a=t(c,a);d.insertAfter(e.expressionStatement(e.assignmentExpression("=",a,b)))})))},
exit:function(a){var b=a.node,d=b.id;if(null!==d){var c=w(b);if(null!==c&&!q.has(b)){q.add(b);b=a.scope.generateUidIdentifier("_s");a.scope.parent.push({id:b,init:e.callExpression(z,[])});a.get("body").unshiftContainer("body",e.expressionStatement(e.callExpression(b,[])));var f=null;a.find(function(a){if(a.parentPath.isBlock())return f=a,!0});null!==f&&f.insertAfter(e.expressionStatement(e.callExpression(b,v(d,c,f.scope))))}}}},"ArrowFunctionExpression|FunctionExpression":{exit:function(a){var b=
a.node,d=w(b);if(null!==d&&!q.has(b)){q.add(b);var c=a.scope.generateUidIdentifier("_s");a.scope.parent.push({id:c,init:e.callExpression(z,[])});"BlockStatement"!==a.node.body.type&&(a.node.body=e.blockStatement([e.returnStatement(a.node.body)]));a.get("body").unshiftContainer("body",e.expressionStatement(e.callExpression(c,[])));if("VariableDeclarator"===a.parent.type){var f=null;a.find(function(a){if(a.parentPath.isBlock())return f=a,!0});null!==f&&f.insertAfter(e.expressionStatement(e.callExpression(c,
v(a.parent.id,d,f.scope))))}else a.replaceWith(e.callExpression(c,v(b,d,a.scope)))}}},VariableDeclaration:function(a){var b=a.node;switch(a.parent.type){case "Program":var d=a;var c=a.parentPath;break;case "ExportNamedDeclaration":d=a.parentPath;c=d.parentPath;break;case "ExportDefaultDeclaration":d=a.parentPath;c=d.parentPath;break;default:return}if(!k.has(b)&&(k.add(b),a=a.get("declarations"),1===a.length)){var f=a[0];m(f.node.id.name,f,function(a,b,h){null!==h&&(a=t(c,a),"VariableDeclarator"===
h.parent.type?d.insertAfter(e.expressionStatement(e.assignmentExpression("=",a,f.node.id))):h.replaceWith(e.assignmentExpression("=",a,b)))})}},Program:{enter:function(a){a.traverse(D)},exit:function(a){var b=l.get(a);if(void 0!==b){var d=a.node;if(!A.has(d)){A.add(d);l.delete(a);var c=[];a.pushContainer("body",e.variableDeclaration("var",c));b.forEach(function(b){var d=b.handle;a.pushContainer("body",e.expressionStatement(e.callExpression(C,[d,e.stringLiteral(b.persistentID)])));c.push(e.variableDeclarator(d))})}}}}}}};
/** @license React vundefined
* react-refresh-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its 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';throw Error("React Refresh runtime should not be included in the production bundle.");
{
"name": "react-refresh",
"description": "React is a JavaScript library for building user interfaces.",
"keywords": [
"react"
],
"version": "0.8.3",
"homepage": "https://reactjs.org/",
"bugs": "https://github.com/facebook/react/issues",
"license": "MIT",
"files": [
"LICENSE",
"README.md",
"babel.js",
"runtime.js",
"build-info.json",
"cjs/",
"umd/"
],
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/facebook/react.git",
"directory": "packages/react"
},
"engines": {
"node": ">=0.10.0"
}
}
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-refresh-runtime.production.min.js');
} else {
module.exports = require('./cjs/react-refresh-runtime.development.js');
}
MIT License
Copyright (c) James Halliday
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":"stream-browserify","main":"index.js","author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT"}
import chalk from 'next/dist/compiled/chalk' import chalk from 'next/dist/compiled/chalk'
import { Worker } from 'jest-worker' import { Worker } from 'next/dist/compiled/jest-worker'
import { existsSync } from 'fs' import { existsSync } from 'fs'
import { join } from 'path' import { join } from 'path'
import { ESLINT_DEFAULT_DIRS } from './constants' import { ESLINT_DEFAULT_DIRS } from './constants'
......
import { Worker as JestWorker } from 'jest-worker' import { Worker as JestWorker } from 'next/dist/compiled/jest-worker'
type FarmOptions = ConstructorParameters<typeof JestWorker>[1] type FarmOptions = ConstructorParameters<typeof JestWorker>[1]
......
...@@ -72,15 +72,9 @@ ...@@ -72,15 +72,9 @@
}, },
"dependencies": { "dependencies": {
"@next/env": "12.0.9-canary.0", "@next/env": "12.0.9-canary.0",
"@next/react-refresh-utils": "12.0.9-canary.0",
"caniuse-lite": "^1.0.30001283", "caniuse-lite": "^1.0.30001283",
"jest-worker": "27.0.0-next.5",
"node-fetch": "2.6.1",
"postcss": "8.4.5", "postcss": "8.4.5",
"react-is": "17.0.2", "styled-jsx": "5.0.0-beta.7",
"react-refresh": "0.8.3",
"stream-browserify": "3.0.0",
"styled-jsx": "5.0.0-beta.6",
"use-subscription": "1.5.1" "use-subscription": "1.5.1"
}, },
"peerDependencies": { "peerDependencies": {
...@@ -128,6 +122,7 @@ ...@@ -128,6 +122,7 @@
"@next/polyfill-module": "12.0.9-canary.0", "@next/polyfill-module": "12.0.9-canary.0",
"@next/polyfill-nomodule": "12.0.9-canary.0", "@next/polyfill-nomodule": "12.0.9-canary.0",
"@next/react-dev-overlay": "12.0.9-canary.0", "@next/react-dev-overlay": "12.0.9-canary.0",
"@next/react-refresh-utils": "12.0.9-canary.0",
"@next/swc": "12.0.9-canary.0", "@next/swc": "12.0.9-canary.0",
"@peculiar/webcrypto": "1.1.7", "@peculiar/webcrypto": "1.1.7",
"@taskr/clear": "1.1.0", "@taskr/clear": "1.1.0",
...@@ -210,6 +205,7 @@ ...@@ -210,6 +205,7 @@
"image-size": "1.0.0", "image-size": "1.0.0",
"is-docker": "2.0.0", "is-docker": "2.0.0",
"is-wsl": "2.2.0", "is-wsl": "2.2.0",
"jest-worker": "27.0.0-next.5",
"json5": "2.2.0", "json5": "2.2.0",
"jsonwebtoken": "8.5.1", "jsonwebtoken": "8.5.1",
"loader-utils2": "npm:loader-utils@2.0.0", "loader-utils2": "npm:loader-utils@2.0.0",
...@@ -221,6 +217,7 @@ ...@@ -221,6 +217,7 @@
"nanoid": "3.1.30", "nanoid": "3.1.30",
"native-url": "0.3.4", "native-url": "0.3.4",
"neo-async": "2.6.1", "neo-async": "2.6.1",
"node-fetch": "2.6.1",
"node-html-parser": "1.4.9", "node-html-parser": "1.4.9",
"ora": "4.0.4", "ora": "4.0.4",
"os-browserify": "0.3.0", "os-browserify": "0.3.0",
...@@ -240,6 +237,8 @@ ...@@ -240,6 +237,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-is": "17.0.2",
"react-refresh": "0.8.3",
"react-server-dom-webpack": "0.0.0-experimental-13455d26d-20211104", "react-server-dom-webpack": "0.0.0-experimental-13455d26d-20211104",
"regenerator-runtime": "0.13.4", "regenerator-runtime": "0.13.4",
"sass-loader": "10.2.0", "sass-loader": "10.2.0",
...@@ -249,6 +248,7 @@ ...@@ -249,6 +248,7 @@
"send": "0.17.1", "send": "0.17.1",
"setimmediate": "1.0.5", "setimmediate": "1.0.5",
"source-map": "0.6.1", "source-map": "0.6.1",
"stream-browserify": "3.0.0",
"stream-http": "3.1.1", "stream-http": "3.1.1",
"string-hash": "1.1.3", "string-hash": "1.1.3",
"string_decoder": "1.3.0", "string_decoder": "1.3.0",
......
...@@ -13,7 +13,7 @@ import type { UrlWithParsedQuery } from 'url' ...@@ -13,7 +13,7 @@ import type { UrlWithParsedQuery } from 'url'
import crypto from 'crypto' import crypto from 'crypto'
import fs from 'fs' import fs from 'fs'
import chalk from 'next/dist/compiled/chalk' import chalk from 'next/dist/compiled/chalk'
import { Worker } from 'jest-worker' import { Worker } from 'next/dist/compiled/jest-worker'
import AmpHtmlValidator from 'next/dist/compiled/amphtml-validator' import AmpHtmlValidator from 'next/dist/compiled/amphtml-validator'
import findUp from 'next/dist/compiled/find-up' import findUp from 'next/dist/compiled/find-up'
import { join as pathJoin, relative, resolve as pathResolve, sep } from 'path' import { join as pathJoin, relative, resolve as pathResolve, sep } from 'path'
...@@ -95,11 +95,11 @@ export default class DevServer extends Server { ...@@ -95,11 +95,11 @@ export default class DevServer extends Server {
protected sortedRoutes?: string[] protected sortedRoutes?: string[]
private addedUpgradeListener = false private addedUpgradeListener = false
protected staticPathsWorker?: import('jest-worker').Worker & { protected staticPathsWorker?: { [key: string]: any } & {
loadStaticPaths: typeof import('./static-paths-worker').loadStaticPaths loadStaticPaths: typeof import('./static-paths-worker').loadStaticPaths
} }
private getStaticPathsWorker(): import('jest-worker').Worker & { private getStaticPathsWorker(): { [key: string]: any } & {
loadStaticPaths: typeof import('./static-paths-worker').loadStaticPaths loadStaticPaths: typeof import('./static-paths-worker').loadStaticPaths
} { } {
if (this.staticPathsWorker) { if (this.staticPathsWorker) {
......
import { Worker } from 'jest-worker' import { Worker } from 'next/dist/compiled/jest-worker'
import * as path from 'path' import * as path from 'path'
import { execOnce } from '../../../shared/lib/utils' import { execOnce } from '../../../shared/lib/utils'
import { cpus } from 'os' import { cpus } from 'os'
......
import fetch, { Headers, Request, Response } from 'node-fetch' import fetch, {
Headers,
Request,
Response,
} from 'next/dist/compiled/node-fetch'
// Polyfill fetch() in the Node.js environment // Polyfill fetch() in the Node.js environment
if (!global.fetch) { if (!global.fetch) {
......
...@@ -564,7 +564,7 @@ export async function renderToHTML( ...@@ -564,7 +564,7 @@ export async function renderToHTML(
let asPath: string = renderOpts.resolvedAsPath || (req.url as string) let asPath: string = renderOpts.resolvedAsPath || (req.url as string)
if (dev) { if (dev) {
const { isValidElementType } = require('react-is') const { isValidElementType } = require('next/dist/compiled/react-is')
if (!isValidElementType(Component)) { if (!isValidElementType(Component)) {
throw new Error( throw new Error(
`The default export is not a React Component in page: "${pathname}"` `The default export is not a React Component in page: "${pathname}"`
......
...@@ -1501,7 +1501,7 @@ export default class Router implements BaseRouter { ...@@ -1501,7 +1501,7 @@ export default class Router implements BaseRouter {
const { Component, __N_SSG, __N_SSP, __N_RSC } = routeInfo const { Component, __N_SSG, __N_SSP, __N_RSC } = routeInfo
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {
const { isValidElementType } = require('react-is') const { isValidElementType } = require('next/dist/compiled/react-is')
if (!isValidElementType(Component)) { if (!isValidElementType(Component)) {
throw new Error( throw new Error(
`The default export is not a React Component in page: "${pathname}"` `The default export is not a React Component in page: "${pathname}"`
......
...@@ -4,7 +4,8 @@ const notifier = require('node-notifier') ...@@ -4,7 +4,8 @@ const notifier = require('node-notifier')
const { relative, basename, resolve, join, dirname } = require('path') const { relative, basename, resolve, join, dirname } = require('path')
// eslint-disable-next-line import/no-extraneous-dependencies // eslint-disable-next-line import/no-extraneous-dependencies
const glob = require('glob') const glob = require('glob')
const fs = require('fs') // eslint-disable-next-line import/no-extraneous-dependencies
const fs = require('fs-extra')
export async function next__polyfill_nomodule(task, opts) { export async function next__polyfill_nomodule(task, opts) {
await task await task
...@@ -125,6 +126,15 @@ export async function copy_babel_runtime(task, opts) { ...@@ -125,6 +126,15 @@ export async function copy_babel_runtime(task, opts) {
} }
} }
// eslint-disable-next-line camelcase
externals['node-fetch'] = 'next/dist/compiled/node-fetch'
export async function ncc_node_fetch(task, opts) {
await task
.source(opts.src || relative(__dirname, require.resolve('node-fetch')))
.ncc({ packageName: 'node-fetch', externals })
.target('compiled/node-fetch')
}
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
externals['acorn'] = 'next/dist/compiled/acorn' externals['acorn'] = 'next/dist/compiled/acorn'
export async function ncc_acorn(task, opts) { export async function ncc_acorn(task, opts) {
...@@ -199,6 +209,95 @@ export async function ncc_watchpack(task, opts) { ...@@ -199,6 +209,95 @@ export async function ncc_watchpack(task, opts) {
.target('compiled/watchpack') .target('compiled/watchpack')
} }
// eslint-disable-next-line camelcase
externals['jest-worker'] = 'next/dist/compiled/jest-worker'
export async function ncc_jest_worker(task, opts) {
await fs.remove(join(__dirname, 'compiled/jest-worker'))
await fs.ensureDir(join(__dirname, 'compiled/jest-worker/workers'))
const workers = ['processChild.js', 'threadChild.js']
await task
.source(opts.src || relative(__dirname, require.resolve('jest-worker')))
.ncc({ packageName: 'jest-worker', externals })
.target('compiled/jest-worker')
for (const worker of workers) {
const content = await fs.readFile(
join(
dirname(require.resolve('jest-worker/package.json')),
'build/workers',
worker
),
'utf8'
)
await fs.writeFile(
join(
dirname(require.resolve('jest-worker/package.json')),
'build/workers',
worker + '.tmp.js'
),
content.replace(/require\(file\)/g, '__non_webpack_require__(file)')
)
await task
.source(
opts.src ||
relative(
__dirname,
join(
dirname(require.resolve('jest-worker/package.json')),
'build/workers',
worker + '.tmp.js'
)
)
)
.ncc({ packageName: 'jest-worker', externals })
.target('compiled/jest-worker/out')
await fs.move(
join(__dirname, 'compiled/jest-worker/out', worker + '.tmp.js'),
join(__dirname, 'compiled/jest-worker', worker),
{ overwrite: true }
)
}
await fs.remove(join(__dirname, 'compiled/jest-worker/workers'))
await fs.remove(join(__dirname, 'compiled/jest-worker/out'))
}
// eslint-disable-next-line camelcase
export async function ncc_react_refresh_utils(task, opts) {
await fs.remove(join(__dirname, 'compiled/react-refresh'))
await fs.copy(
dirname(require.resolve('react-refresh/package.json')),
join(__dirname, 'compiled/react-refresh')
)
const srcDir = dirname(
require.resolve('@next/react-refresh-utils/package.json')
)
const destDir = join(__dirname, 'compiled/@next/react-refresh-utils')
await fs.remove(destDir)
await fs.ensureDir(destDir)
const files = glob.sync('**/*.{js,json}', { cwd: srcDir })
for (const file of files) {
if (file === 'tsconfig.json') continue
const content = await fs.readFile(join(srcDir, file), 'utf8')
const outputFile = join(destDir, file)
await fs.ensureDir(dirname(outputFile))
await fs.writeFile(
outputFile,
content.replace(
/react-refresh\/runtime/g,
'next/dist/compiled/react-refresh/runtime'
)
)
}
}
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
externals['chalk'] = 'next/dist/compiled/chalk' externals['chalk'] = 'next/dist/compiled/chalk'
export async function ncc_chalk(task, opts) { export async function ncc_chalk(task, opts) {
...@@ -343,12 +442,19 @@ export async function ncc_buffer(task, opts) { ...@@ -343,12 +442,19 @@ export async function ncc_buffer(task, opts) {
.target('compiled/buffer') .target('compiled/buffer')
} }
// eslint-disable-next-line camelcase
export async function copy_react_is(task, opts) {
await task
.source(join(dirname(require.resolve('react-is/package.json')), '**/*'))
.target('compiled/react-is')
}
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
export async function copy_constants_browserify(task, opts) { export async function copy_constants_browserify(task, opts) {
await fs.promises.mkdir(join(__dirname, 'compiled/constants-browserify'), { await fs.mkdir(join(__dirname, 'compiled/constants-browserify'), {
recursive: true, recursive: true,
}) })
await fs.promises.writeFile( await fs.writeFile(
join(__dirname, 'compiled/constants-browserify/package.json'), join(__dirname, 'compiled/constants-browserify/package.json'),
JSON.stringify({ name: 'constants-browserify', main: './constants.json' }) JSON.stringify({ name: 'constants-browserify', main: './constants.json' })
) )
...@@ -398,6 +504,33 @@ export async function ncc_events(task, opts) { ...@@ -398,6 +504,33 @@ export async function ncc_events(task, opts) {
.target('compiled/events') .target('compiled/events')
} }
// eslint-disable-next-line camelcase
export async function ncc_stream_browserify(task, opts) {
await task
.source(
opts.src || relative(__dirname, require.resolve('stream-browserify/'))
)
.ncc({
packageName: 'stream-browserify',
mainFields: ['browser', 'main'],
target: 'es5',
})
.target('compiled/stream-browserify')
// while ncc'ing readable-stream the browser mapping does not replace the
// require('stream') with require('events').EventEmitter correctly so we
// patch this manually as leaving require('stream') causes a circular
// reference breaking the browser polyfill
const outputFile = join(__dirname, 'compiled/stream-browserify/index.js')
fs.writeFileSync(
outputFile,
fs
.readFileSync(outputFile, 'utf8')
.replace(`require("stream")`, `require("events").EventEmitter`)
)
}
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
export async function ncc_stream_http(task, opts) { export async function ncc_stream_http(task, opts) {
await task await task
...@@ -671,7 +804,7 @@ export async function ncc_babel_bundle_packages(task, opts) { ...@@ -671,7 +804,7 @@ export async function ncc_babel_bundle_packages(task, opts) {
}) })
.target(`compiled/babel-packages`) .target(`compiled/babel-packages`)
await fs.promises.writeFile( await fs.writeFile(
join(__dirname, 'compiled/babel-packages/package.json'), join(__dirname, 'compiled/babel-packages/package.json'),
JSON.stringify({ name: 'babel-packages', main: './packages-bundle.js' }) JSON.stringify({ name: 'babel-packages', main: './packages-bundle.js' })
) )
...@@ -1078,11 +1211,10 @@ export async function ncc_icss_utils(task, opts) { ...@@ -1078,11 +1211,10 @@ export async function ncc_icss_utils(task, opts) {
} }
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
export async function copy_react_server_dom_webpack(task, opts) { export async function copy_react_server_dom_webpack(task, opts) {
await fs.promises.mkdir( await fs.mkdir(join(__dirname, 'compiled/react-server-dom-webpack'), {
join(__dirname, 'compiled/react-server-dom-webpack'), recursive: true,
{ recursive: true } })
) await fs.writeFile(
await fs.promises.writeFile(
join(__dirname, 'compiled/react-server-dom-webpack/package.json'), join(__dirname, 'compiled/react-server-dom-webpack/package.json'),
JSON.stringify({ name: 'react-server-dom-webpack', main: './index.js' }) JSON.stringify({ name: 'react-server-dom-webpack', main: './index.js' })
) )
...@@ -1454,6 +1586,7 @@ export async function ncc(task, opts) { ...@@ -1454,6 +1586,7 @@ export async function ncc(task, opts) {
'ncc_image_size', 'ncc_image_size',
'ncc_get_orientation', 'ncc_get_orientation',
'ncc_hapi_accept', 'ncc_hapi_accept',
'ncc_node_fetch',
'ncc_acorn', 'ncc_acorn',
'ncc_amphtml_validator', 'ncc_amphtml_validator',
'ncc_arg', 'ncc_arg',
...@@ -1465,6 +1598,7 @@ export async function ncc(task, opts) { ...@@ -1465,6 +1598,7 @@ export async function ncc(task, opts) {
'ncc_crypto_browserify', 'ncc_crypto_browserify',
'ncc_domain_browser', 'ncc_domain_browser',
'ncc_events', 'ncc_events',
'ncc_stream_browserify',
'ncc_stream_http', 'ncc_stream_http',
'ncc_https_browserify', 'ncc_https_browserify',
'ncc_os_browserify', 'ncc_os_browserify',
...@@ -1553,10 +1687,13 @@ export async function ncc(task, opts) { ...@@ -1553,10 +1687,13 @@ export async function ncc(task, opts) {
await task.serial( await task.serial(
[ [
'ncc_next__react_dev_overlay', 'ncc_next__react_dev_overlay',
'ncc_react_refresh_utils',
'copy_regenerator_runtime', 'copy_regenerator_runtime',
'copy_babel_runtime', 'copy_babel_runtime',
'copy_constants_browserify', 'copy_constants_browserify',
'copy_react_server_dom_webpack', 'copy_react_server_dom_webpack',
'copy_react_is',
'ncc_jest_worker',
], ],
opts opts
) )
......
import retry from 'next/dist/compiled/async-retry' import retry from 'next/dist/compiled/async-retry'
import fetch from 'node-fetch' import fetch from 'next/dist/compiled/node-fetch'
export function _postPayload(endpoint: string, body: object) { export function _postPayload(endpoint: string, body: object) {
return ( return (
......
...@@ -13,10 +13,29 @@ declare module 'next/dist/compiled/@next/react-dev-overlay/middleware' { ...@@ -13,10 +13,29 @@ declare module 'next/dist/compiled/@next/react-dev-overlay/middleware' {
export * from '@next/react-dev-overlay/lib/middleware' export * from '@next/react-dev-overlay/lib/middleware'
} }
declare module 'next/dist/compiled/@next/react-refresh-utils/ReactRefreshWebpackPlugin' {
import m from '@next/react-refresh-utils/ReactRefreshWebpackPlugin'
export = m
}
declare module 'next/dist/compiled/node-html-parser' { declare module 'next/dist/compiled/node-html-parser' {
export * from 'node-html-parser' export * from 'node-html-parser'
} }
declare module 'next/dist/compiled/node-fetch' {
import m from 'node-fetch'
export default m
export * from 'node-fetch'
}
declare module 'next/dist/compiled/jest-worker' {
export * from 'jest-worker'
}
declare module 'next/dist/compiled/react-is' {
export * from 'react-is'
}
declare module 'next/dist/compiled/chalk' { declare module 'next/dist/compiled/chalk' {
import m from 'chalk' import m from 'chalk'
export = m export = m
......
...@@ -19,6 +19,7 @@ describe('should set-up next', () => { ...@@ -19,6 +19,7 @@ describe('should set-up next', () => {
}, },
dependencies: { dependencies: {
typescript: 'latest', typescript: 'latest',
'@types/node': 'latest',
'@types/react': 'latest', '@types/react': 'latest',
'@types/react-dom': 'latest', '@types/react-dom': 'latest',
}, },
......
import { useRouter } from 'next/router'
import Link from 'next/link'
export default function Page() {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const router = useRouter()
return (
<>
<p>hello world</p>
<Link href="/another">
<a>to /another</a>
</Link>
</>
)
}
import css from 'styled-jsx/css'
const divStyles = css`
div {
color: orange;
}
`
export default function Page(props) {
return (
<>
<div>styled-jsx support (should be orange)</div>
<p>styled p tag (should be pink)</p>
<style jsx>{divStyles}</style>
<style jsx>{`
p {
color: pink;
}
`}</style>
<style jsx global>{`
body {
background: #000;
}
`}</style>
</>
)
}
import { createNext } from 'e2e-utils' import path from 'path'
import { createNext, FileRef } from 'e2e-utils'
import { renderViaHTTP } from 'next-test-utils' import { renderViaHTTP } from 'next-test-utils'
import { NextInstance } from 'test/lib/next-modes/base' import { NextInstance } from 'test/lib/next-modes/base'
...@@ -8,22 +9,7 @@ describe('TypeScript basic', () => { ...@@ -8,22 +9,7 @@ describe('TypeScript basic', () => {
beforeAll(async () => { beforeAll(async () => {
next = await createNext({ next = await createNext({
files: { files: {
'pages/index.tsx': ` pages: new FileRef(path.join(__dirname, 'app/pages')),
import { useRouter } from 'next/router'
import Link from 'next/link'
export default function Page() {
const router = useRouter()
return (
<>
<p>hello world</p>
<Link href='/another'>
<a>to /another</a>
</Link>
</>
)
}
`,
'server.ts': ` 'server.ts': `
import next from 'next'; import next from 'next';
const app = next({ const app = next({
...@@ -39,7 +25,9 @@ describe('TypeScript basic', () => { ...@@ -39,7 +25,9 @@ describe('TypeScript basic', () => {
}, },
dependencies: { dependencies: {
typescript: '4.4.3', typescript: '4.4.3',
'@types/react': '16.9.17', '@types/node': 'latest',
'@types/react': 'latest',
'@types/react-dom': 'latest',
}, },
}) })
}) })
......
...@@ -26,12 +26,20 @@ describe('webpack-config attachReactRefresh', () => { ...@@ -26,12 +26,20 @@ describe('webpack-config attachReactRefresh', () => {
it('should skip adding when existing (shorthand)', () => { it('should skip adding when existing (shorthand)', () => {
const input = { const input = {
module: { module: {
rules: [{ use: ['@next/react-refresh-utils/loader', 'rr'] }], rules: [
{
use: ['next/dist/compiled/@next/react-refresh-utils/loader', 'rr'],
},
],
}, },
} }
const expected = { const expected = {
module: { module: {
rules: [{ use: ['@next/react-refresh-utils/loader', 'rr'] }], rules: [
{
use: ['next/dist/compiled/@next/react-refresh-utils/loader', 'rr'],
},
],
}, },
} }
...@@ -43,14 +51,28 @@ describe('webpack-config attachReactRefresh', () => { ...@@ -43,14 +51,28 @@ describe('webpack-config attachReactRefresh', () => {
const input = { const input = {
module: { module: {
rules: [ rules: [
{ use: [require.resolve('@next/react-refresh-utils/loader'), 'rr'] }, {
use: [
require.resolve(
'next/dist/compiled/@next/react-refresh-utils/loader'
),
'rr',
],
},
], ],
}, },
} }
const expected = { const expected = {
module: { module: {
rules: [ rules: [
{ use: [require.resolve('@next/react-refresh-utils/loader'), 'rr'] }, {
use: [
require.resolve(
'next/dist/compiled/@next/react-refresh-utils/loader'
),
'rr',
],
},
], ],
}, },
} }
...@@ -184,7 +206,7 @@ describe('webpack-config attachReactRefresh', () => { ...@@ -184,7 +206,7 @@ describe('webpack-config attachReactRefresh', () => {
use: [ use: [
'hehe', 'hehe',
'haha', 'haha',
'@next/react-refresh-utils/loader', 'next/dist/compiled/@next/react-refresh-utils/loader',
'rr', 'rr',
'lol', 'lol',
'bla', 'bla',
...@@ -202,7 +224,7 @@ describe('webpack-config attachReactRefresh', () => { ...@@ -202,7 +224,7 @@ describe('webpack-config attachReactRefresh', () => {
use: [ use: [
'hehe', 'hehe',
'haha', 'haha',
'@next/react-refresh-utils/loader', 'next/dist/compiled/@next/react-refresh-utils/loader',
'rr', 'rr',
'lol', 'lol',
'bla', 'bla',
...@@ -223,7 +245,7 @@ describe('webpack-config attachReactRefresh', () => { ...@@ -223,7 +245,7 @@ describe('webpack-config attachReactRefresh', () => {
'haha', 'haha',
'rr', 'rr',
'lol', 'lol',
'@next/react-refresh-utils/loader', 'next/dist/compiled/@next/react-refresh-utils/loader',
'bla', 'bla',
], ],
}, },
...@@ -241,7 +263,7 @@ describe('webpack-config attachReactRefresh', () => { ...@@ -241,7 +263,7 @@ describe('webpack-config attachReactRefresh', () => {
'haha', 'haha',
'rr', 'rr',
'lol', 'lol',
'@next/react-refresh-utils/loader', 'next/dist/compiled/@next/react-refresh-utils/loader',
'bla', 'bla',
], ],
}, },
......
...@@ -7643,7 +7643,7 @@ conventional-recommended-bump@^6.1.0: ...@@ -7643,7 +7643,7 @@ conventional-recommended-bump@^6.1.0:
meow "^8.0.0" meow "^8.0.0"
q "^1.5.1" q "^1.5.1"
convert-source-map@1.7.0, convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0:
version "1.7.0" version "1.7.0"
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442"
dependencies: dependencies:
...@@ -8762,10 +8762,6 @@ emoji-regex@^9.2.2: ...@@ -8762,10 +8762,6 @@ emoji-regex@^9.2.2:
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72"
integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==
emojis-list@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389"
emojis-list@^3.0.0: emojis-list@^3.0.0:
version "3.0.0" version "3.0.0"
resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78"
...@@ -13140,14 +13136,6 @@ loader-runner@^4.2.0: ...@@ -13140,14 +13136,6 @@ loader-runner@^4.2.0:
dependencies: dependencies:
big.js "^6.1.1" big.js "^6.1.1"
loader-utils@1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7"
dependencies:
big.js "^5.2.2"
emojis-list "^2.0.0"
json5 "^1.0.1"
loader-utils@^1.1.0, loader-utils@^1.2.3: loader-utils@^1.1.0, loader-utils@^1.2.3:
version "1.4.0" version "1.4.0"
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613" resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613"
...@@ -18379,10 +18367,6 @@ source-map@0.6.1, source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: ...@@ -18379,10 +18367,6 @@ source-map@0.6.1, source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1:
version "0.6.1" version "0.6.1"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
source-map@0.7.3, source-map@^0.7.3, source-map@~0.7.2:
version "0.7.3"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383"
source-map@0.8.0-beta.0: source-map@0.8.0-beta.0:
version "0.8.0-beta.0" version "0.8.0-beta.0"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.8.0-beta.0.tgz#d4c1bb42c3f7ee925f005927ba10709e0d1d1f11" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.8.0-beta.0.tgz#d4c1bb42c3f7ee925f005927ba10709e0d1d1f11"
...@@ -18399,6 +18383,10 @@ source-map@^0.5.0, source-map@^0.5.6: ...@@ -18399,6 +18383,10 @@ source-map@^0.5.0, source-map@^0.5.6:
version "0.5.7" version "0.5.7"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
source-map@^0.7.3, source-map@~0.7.2:
version "0.7.3"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383"
sourcemap-codec@^1.4.4: sourcemap-codec@^1.4.4:
version "1.4.8" version "1.4.8"
resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4"
...@@ -18911,19 +18899,10 @@ styled-jsx-plugin-postcss@3.0.2: ...@@ -18911,19 +18899,10 @@ styled-jsx-plugin-postcss@3.0.2:
postcss "^7.0.2" postcss "^7.0.2"
postcss-load-plugins "^2.3.0" postcss-load-plugins "^2.3.0"
styled-jsx@5.0.0-beta.6: styled-jsx@5.0.0-beta.7:
version "5.0.0-beta.6" version "5.0.0-beta.7"
resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.0.0-beta.6.tgz#666552f8831a06f80c9084a47afc4b32b0c9f461" resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.0.0-beta.7.tgz#d952f888576b1390897b2b2a026eb43eeef7ee85"
integrity sha512-b1cM7Xyp2r1lsNpvoZ6wmTI8qxD0557vH2feHakNU8LMkzfJDgTQMul6O7sSYY0GxQ73pKEN69hCDp71w6Q0nA== integrity sha512-fCrifrkBKt+SM6aNDNnRWiV0YP7JJ6HRLCofyfbseo0RFhbxD2pka5zG5yH5Ym8KOChUrEFbibkjWeSB7n6IwQ==
dependencies:
"@babel/plugin-syntax-jsx" "7.14.5"
"@babel/types" "7.15.0"
convert-source-map "1.7.0"
loader-utils "1.2.3"
source-map "0.7.3"
string-hash "1.1.3"
stylis "3.5.4"
stylis-rule-sheet "0.0.10"
stylehacks@^4.0.0: stylehacks@^4.0.0:
version "4.0.3" version "4.0.3"
...@@ -18933,14 +18912,6 @@ stylehacks@^4.0.0: ...@@ -18933,14 +18912,6 @@ stylehacks@^4.0.0:
postcss "^7.0.0" postcss "^7.0.0"
postcss-selector-parser "^3.0.0" postcss-selector-parser "^3.0.0"
stylis-rule-sheet@0.0.10:
version "0.0.10"
resolved "https://registry.yarnpkg.com/stylis-rule-sheet/-/stylis-rule-sheet-0.0.10.tgz#44e64a2b076643f4b52e5ff71efc04d8c3c4a430"
stylis@3.5.4:
version "3.5.4"
resolved "https://registry.yarnpkg.com/stylis/-/stylis-3.5.4.tgz#f665f25f5e299cf3d64654ab949a57c768b73fbe"
superagent@^3.8.1: superagent@^3.8.1:
version "3.8.3" version "3.8.3"
resolved "https://registry.yarnpkg.com/superagent/-/superagent-3.8.3.tgz#460ea0dbdb7d5b11bc4f78deba565f86a178e128" resolved "https://registry.yarnpkg.com/superagent/-/superagent-3.8.3.tgz#460ea0dbdb7d5b11bc4f78deba565f86a178e128"
......
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