Skip to content

Commit

Permalink
yarn dev regression fix, ncc revert (vercel#18861)
Browse files Browse the repository at this point in the history
This fixes the current regression with an ncc revert for now.

I will continue to follow up with the ncc upgrade in vercel#18860.
  • Loading branch information
guybedford authored Nov 6, 2020
1 parent 8799bd2 commit 4dbb65d
Show file tree
Hide file tree
Showing 62 changed files with 1,031 additions and 2,969 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
},
"pre-commit": "lint-staged",
"devDependencies": {
"@babel/plugin-proposal-object-rest-spread": "7.12.1",
"@babel/plugin-proposal-object-rest-spread": "7.11.0",
"@babel/preset-flow": "7.10.4",
"@babel/preset-react": "7.12.5",
"@babel/preset-react": "7.10.4",
"@fullhuman/postcss-purgecss": "1.3.0",
"@mdx-js/loader": "0.18.0",
"@types/cheerio": "0.22.16",
Expand Down Expand Up @@ -119,7 +119,7 @@
"selenium-webdriver": "4.0.0-alpha.7",
"shell-quote": "1.7.2",
"styled-components": "5.1.0",
"styled-jsx-plugin-postcss": "3.0.2",
"styled-jsx-plugin-postcss": "2.0.1",
"tailwindcss": "1.1.3",
"taskr": "1.1.0",
"tree-kill": "1.2.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@types/rimraf": "3.0.0",
"@types/tar": "4.0.3",
"@types/validate-npm-package-name": "3.0.0",
"@vercel/ncc": "^0.24.1",
"@zeit/ncc": "0.22.0",
"async-retry": "1.3.1",
"chalk": "2.4.2",
"commander": "2.20.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/next/build/babel/plugins/amp-attributes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NodePath, PluginObj, types } from 'next/dist/compiled/babel/core'
import { NodePath, PluginObj, types } from '@babel/core'

export default function AmpAttributePatcher(): PluginObj {
return {
Expand Down
4 changes: 2 additions & 2 deletions packages/next/build/babel/plugins/commonjs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NodePath, PluginObj, types } from 'next/dist/compiled/babel/core'
import commonjsPlugin from 'next/dist/compiled/babel/plugin-transform-modules-commonjs'
import { NodePath, PluginObj, types } from '@babel/core'
import commonjsPlugin from '@babel/plugin-transform-modules-commonjs'

// Rewrite imports using next/<something> to next-server/<something>
export default function NextToNextServer(...args: any): PluginObj {
Expand Down
8 changes: 2 additions & 6 deletions packages/next/build/babel/plugins/jsx-pragma.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import {
NodePath,
PluginObj,
types as BabelTypes,
} from 'next/dist/compiled/babel/core'
import jsx from 'next/dist/compiled/babel/plugin-syntax-jsx'
import { NodePath, PluginObj, types as BabelTypes } from '@babel/core'
import jsx from '@babel/plugin-syntax-jsx'

export default function ({
types: t,
Expand Down
6 changes: 1 addition & 5 deletions packages/next/build/babel/plugins/next-data.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
NodePath,
PluginObj,
types as BabelTypes,
} from 'next/dist/compiled/babel/core'
import { NodePath, PluginObj, types as BabelTypes } from '@babel/core'

export default function ({
types: t,
Expand Down
17 changes: 5 additions & 12 deletions packages/next/build/babel/plugins/next-page-config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
NodePath,
PluginObj,
types as BabelTypes,
} from 'next/dist/compiled/babel/core'
import { NodePath, PluginObj, types as BabelTypes } from '@babel/core'
import { PageConfig } from 'next/types'
import { STRING_LITERAL_DROP_BUNDLE } from '../../../next-server/lib/constants'

Expand Down Expand Up @@ -81,12 +77,9 @@ export default function nextPageConfig({
}

const config: PageConfig = {}
const declarations: BabelTypes.VariableDeclarator[] = [
...((exportPath.node
.declaration as BabelTypes.VariableDeclaration)
?.declarations || []),
exportPath.scope.getBinding(CONFIG_KEY)?.path
.node as BabelTypes.VariableDeclarator,
const declarations = [
...(exportPath.node.declaration?.declarations || []),
exportPath.scope.getBinding(CONFIG_KEY)?.path.node,
].filter(Boolean)

for (const specifier of exportPath.node.specifiers) {
Expand Down Expand Up @@ -154,7 +147,7 @@ export default function nextPageConfig({
)
)
}
const { name } = prop.key as BabelTypes.Identifier
const { name } = prop.key
if (BabelTypes.isIdentifier(prop.key, { name: 'amp' })) {
if (!BabelTypes.isObjectProperty(prop)) {
throw new Error(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NodePath, PluginObj, types } from 'next/dist/compiled/babel/core'
import { NodePath, PluginObj, types } from '@babel/core'

export default function NextPageDisallowReExportAllExports(): PluginObj<any> {
return {
Expand Down
6 changes: 1 addition & 5 deletions packages/next/build/babel/plugins/next-ssg-transform.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
NodePath,
PluginObj,
types as BabelTypes,
} from 'next/dist/compiled/babel/core'
import { NodePath, PluginObj, types as BabelTypes } from '@babel/core'
import { SERVER_PROPS_SSG_CONFLICT } from '../../../lib/constants'
import {
SERVER_PROPS_ID,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PluginObj, types as BabelTypes } from 'next/dist/compiled/babel/core'
import { PluginObj, types as BabelTypes } from '@babel/core'
import chalk from 'next/dist/compiled/chalk'

export default function NoAnonymousDefaultExport({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
NodePath,
PluginObj,
types as BabelTypes,
} from 'next/dist/compiled/babel/core'
import { NodePath, PluginObj, types as BabelTypes } from '@babel/core'

// matches any hook-like (the default)
const isHook = /^use[A-Z]/
Expand Down
6 changes: 1 addition & 5 deletions packages/next/build/babel/plugins/react-loadable-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWAR
// Modified to put `webpack` and `modules` under `loadableGenerated` to be backwards compatible with next/dynamic which has a `modules` key
// Modified to support `dynamic(import('something'))` and `dynamic(import('something'), options)

import {
NodePath,
PluginObj,
types as BabelTypes,
} from 'next/dist/compiled/babel/core'
import { NodePath, PluginObj, types as BabelTypes } from '@babel/core'

export default function ({
types: t,
Expand Down
22 changes: 11 additions & 11 deletions packages/next/build/babel/preset.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PluginItem } from 'next/dist/compiled/babel/core'
import { PluginItem } from '@babel/core'
const env = process.env.NODE_ENV
const isProduction = env === 'production'
const isDevelopment = env === 'development'
Expand Down Expand Up @@ -111,11 +111,11 @@ module.exports = (
sourceType: 'unambiguous',
presets: [
customModernPreset || [
require('next/dist/compiled/babel/preset-env'),
require('@babel/preset-env').default,
presetEnvConfig,
],
[
require('next/dist/compiled/babel/preset-react'),
require('@babel/preset-react'),
{
// This adds @babel/plugin-transform-react-jsx-source and
// @babel/plugin-transform-react-jsx-self automatically in development
Expand All @@ -125,7 +125,7 @@ module.exports = (
},
],
[
require('next/dist/compiled/babel/preset-typescript'),
require('@babel/preset-typescript'),
{ allowNamespaces: true, ...options['preset-typescript'] },
],
],
Expand All @@ -149,20 +149,20 @@ module.exports = (
lib: true,
},
],
require('next/dist/compiled/babel/plugin-syntax-dynamic-import'),
require('@babel/plugin-syntax-dynamic-import'),
require('./plugins/react-loadable-plugin'),
[
require('next/dist/compiled/babel/plugin-proposal-class-properties'),
require('@babel/plugin-proposal-class-properties'),
options['class-properties'] || {},
],
[
require('next/dist/compiled/babel/plugin-proposal-object-rest-spread'),
require('@babel/plugin-proposal-object-rest-spread'),
{
useBuiltIns: true,
},
],
!isServer && [
require('next/dist/compiled/babel/plugin-transform-runtime'),
require('@babel/plugin-transform-runtime'),
{
corejs: false,
helpers: true,
Expand All @@ -185,11 +185,11 @@ module.exports = (
removeImport: true,
},
],
isServer && require('next/dist/compiled/babel/plugin-syntax-bigint'),
isServer && require('@babel/plugin-syntax-bigint'),
// Always compile numeric separator because the resulting number is
// smaller.
require('next/dist/compiled/babel/plugin-proposal-numeric-separator'),
require('next/dist/compiled/babel/plugin-proposal-export-namespace-from'),
require('@babel/plugin-proposal-numeric-separator'),
require('@babel/plugin-proposal-export-namespace-from'),
].filter(Boolean),
}
}
2 changes: 1 addition & 1 deletion packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { codeFrameColumns } from 'next/dist/compiled/babel/code-frame'
import { codeFrameColumns } from '@babel/code-frame'
import ReactRefreshWebpackPlugin from '@next/react-refresh-utils/ReactRefreshWebpackPlugin'
import crypto from 'crypto'
import { readFileSync, realpathSync } from 'fs'
Expand Down
2 changes: 1 addition & 1 deletion packages/next/build/webpack/loaders/next-babel-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = babelLoader.custom((babel) => {
{ type: 'plugin' }
)
const commonJsItem = babel.createConfigItem(
require('next/dist/compiled/babel/plugin-transform-modules-commonjs'),
require('@babel/plugin-transform-modules-commonjs'),
{ type: 'plugin' }
)

Expand Down
2 changes: 1 addition & 1 deletion packages/next/build/webpack/plugins/next-esm-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export class NextEsmPlugin implements Plugin {

if (IS_PRESET_ENV.test(name)) {
presets.push([
require('next/dist/compiled/babel/preset-env'),
require.resolve('@babel/preset-env'),
{
bugfixes: true,
loose: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { codeFrameColumns } from 'next/dist/compiled/babel/code-frame'
import { codeFrameColumns } from '@babel/code-frame'
import Chalk from 'next/dist/compiled/chalk'
import { SimpleWebpackError } from './simpleWebpackError'

Expand Down
74 changes: 0 additions & 74 deletions packages/next/bundles/babel/bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/next/bundles/babel/packages/code-frame.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/next/bundles/babel/packages/core.js

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion packages/next/bundles/babel/packages/plugin-syntax-jsx.js

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion packages/next/bundles/babel/packages/preset-env.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/next/bundles/babel/packages/preset-react.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/next/bundles/babel/packages/preset-typescript.js

This file was deleted.

Loading

0 comments on commit 4dbb65d

Please sign in to comment.