Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of autodll #13669

Merged
merged 3 commits into from
Jun 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions packages/next/build/bundles/autodll-webpack-plugin.js

This file was deleted.

28 changes: 1 addition & 27 deletions packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,6 @@ export default async function getBaseWebpackConfig(
},
}

const devtool =
process.env.__NEXT_TEST_MODE && !process.env.__NEXT_TEST_WITH_DEVTOOL
? false
: dev
? 'cheap-module-source-map'
: false

const isModuleCSS = (module: { type: string }): boolean => {
return (
// mini-css-extract-plugin
Expand Down Expand Up @@ -897,27 +890,8 @@ export default async function getBaseWebpackConfig(
new NextJsRequireCacheHotReloader(),
]

// Webpack 5 has the ability to cache packages persistently, so we
// do not need this DLL plugin:
// Webpack 5 enables HMR automatically in the development mode
if (!isServer && !isWebpack5) {
const AutoDllPlugin = require('next/dist/compiled/autodll-webpack-plugin')(
distDir
)
devPlugins.push(
new AutoDllPlugin({
filename: '[name]_[hash].js',
path: './static/development/dll',
context: dir,
entry: {
dll: ['react', 'react-dom'],
},
config: {
devtool,
mode: webpackMode,
resolve: resolveConfig,
},
})
)
devPlugins.push(new webpack.HotModuleReplacementPlugin())
}

Expand Down
7 changes: 0 additions & 7 deletions packages/next/build/webpack/plugins/build-manifest-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,6 @@ export default class BuildManifestPlugin {
)
assetMap.devFiles.push(...(reactRefreshChunk?.files ?? []))

for (const filePath of Object.keys(compilation.assets)) {
const path = filePath.replace(/\\/g, '/')
if (/^static\/development\/dll\//.test(path)) {
assetMap.devFiles.push(path)
}
}

// compilation.entrypoints is a Map object, so iterating over it 0 is the key and 1 is the value
for (const [, entrypoint] of compilation.entrypoints.entries()) {
const result = ROUTE_NAME_REGEX.exec(entrypoint.name)
Expand Down
21 changes: 0 additions & 21 deletions packages/next/compiled/autodll-webpack-plugin/LICENSE

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion packages/next/compiled/autodll-webpack-plugin/package.json

This file was deleted.

1 change: 0 additions & 1 deletion packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@
"ast-types": "0.13.2",
"async-retry": "1.2.3",
"async-sema": "3.0.0",
"autodll-webpack-plugin": "0.4.2",
"babel-loader": "8.1.0",
"babel-plugin-dynamic-import-node": "2.3.3",
"cache-loader": "4.1.0",
Expand Down
13 changes: 2 additions & 11 deletions packages/next/taskfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const externals = {
'webpack/lib/cache/getLazyHashedEtag': 'webpack/lib/cache/getLazyHashedEtag',
'webpack/lib/RequestShortener': 'webpack/lib/RequestShortener',
chokidar: 'chokidar',
// dependents: babel-loader, async-retry, autodll-webpack-plugin, cache-loader, terser-webpack-plugin
// dependents: babel-loader, async-retry, cache-loader, terser-webpack-plugin
'find-cache-dir': 'find-cache-dir',
// dependents: thread-loader
'loader-runner': 'loader-runner',
Expand Down Expand Up @@ -104,15 +104,7 @@ export async function ncc_async_sema(task, opts) {
.ncc({ packageName: 'async-sema', externals })
.target('compiled/async-sema')
}
// eslint-disable-next-line camelcase
externals['autodll-webpack-plugin'] =
'next/dist/compiled/autodll-webpack-plugin'
export async function ncc_autodll_webpack_plugin(task, opts) {
await task
.source(opts.src || 'build/bundles/autodll-webpack-plugin.js')
.ncc({ packageName: 'autodll-webpack-plugin', externals })
.target('compiled/autodll-webpack-plugin')
}

// eslint-disable-next-line camelcase
externals['babel-loader'] = 'next/dist/compiled/babel-loader'
export async function ncc_babel_loader(task, opts) {
Expand Down Expand Up @@ -552,7 +544,6 @@ export async function ncc(task) {
'ncc_arg',
'ncc_async_retry',
'ncc_async_sema',
'ncc_autodll_webpack_plugin',
'ncc_babel_loader',
'ncc_cache_loader',
'ncc_chalk',
Expand Down
21 changes: 0 additions & 21 deletions packages/next/types/misc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,27 +226,6 @@ declare module 'next/dist/compiled/comment-json' {
export = m
}

declare module 'autodll-webpack-plugin' {
import webpack from 'webpack'
class AutoDllPlugin implements webpack.Plugin {
constructor(settings?: {
inject?: boolean
plugins?: webpack.Configuration['plugins']
context?: string
debug?: boolean
filename?: string
path?: string
inherit?: boolean
entry?: webpack.Entry
config?: webpack.Configuration
})
apply: webpack.Plugin['apply'];
[k: string]: any
}

export = AutoDllPlugin
}

declare module 'pnp-webpack-plugin' {
import webpack from 'webpack'

Expand Down
76 changes: 3 additions & 73 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3729,21 +3729,6 @@ atob@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"

[email protected]:
version "0.4.2"
resolved "https://registry.yarnpkg.com/autodll-webpack-plugin/-/autodll-webpack-plugin-0.4.2.tgz#36e98fbaf30c235d1d5d076330464ac80901415c"
dependencies:
bluebird "^3.5.0"
del "^3.0.0"
find-cache-dir "^1.0.0"
lodash "^4.17.4"
make-dir "^1.0.0"
memory-fs "^0.4.1"
read-pkg "^2.0.0"
tapable "^1.0.0"
webpack-merge "^4.1.0"
webpack-sources "^1.0.1"

autoprefixer@^6.3.1:
version "6.7.7"
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-6.7.7.tgz#1dbd1c835658e35ce3f9984099db00585c782014"
Expand Down Expand Up @@ -5900,17 +5885,6 @@ defined@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693"

del@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/del/-/del-3.0.0.tgz#53ecf699ffcbcb39637691ab13baf160819766e5"
dependencies:
globby "^6.1.0"
is-path-cwd "^1.0.0"
is-path-in-cwd "^1.0.0"
p-map "^1.1.1"
pify "^3.0.0"
rimraf "^2.2.8"

delayed-stream@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
Expand Down Expand Up @@ -7006,14 +6980,6 @@ [email protected], find-cache-dir@^3.0.0, find-cache-dir@^3.2.0:
make-dir "^3.0.2"
pkg-dir "^4.1.0"

find-cache-dir@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-1.0.0.tgz#9288e3e9e3cc3748717d39eade17cf71fc30ee6f"
dependencies:
commondir "^1.0.1"
make-dir "^1.0.0"
pkg-dir "^2.0.0"

find-cache-dir@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7"
Expand Down Expand Up @@ -7556,16 +7522,6 @@ globalyzer@^0.1.0:
version "0.1.4"
resolved "https://registry.yarnpkg.com/globalyzer/-/globalyzer-0.1.4.tgz#bc8e273afe1ac7c24eea8def5b802340c5cc534f"

globby@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c"
dependencies:
array-union "^1.0.1"
glob "^7.0.3"
object-assign "^4.0.1"
pify "^2.0.0"
pinkie-promise "^2.0.0"

globby@^8.0.1:
version "8.0.2"
resolved "https://registry.yarnpkg.com/globby/-/globby-8.0.2.tgz#5697619ccd95c5275dbb2d6faa42087c1a941d8d"
Expand Down Expand Up @@ -8477,22 +8433,6 @@ is-observable@^1.1.0:
dependencies:
symbol-observable "^1.1.0"

is-path-cwd@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d"

is-path-in-cwd@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52"
dependencies:
is-path-inside "^1.0.0"

is-path-inside@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036"
dependencies:
path-is-inside "^1.0.1"

is-plain-obj@^1.0.0, is-plain-obj@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e"
Expand Down Expand Up @@ -11432,7 +11372,7 @@ p-map-series@^1.0.0:
dependencies:
p-reduce "^1.0.0"

p-map@^1.1.1, p-map@^1.2.0:
p-map@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b"

Expand Down Expand Up @@ -11699,10 +11639,6 @@ path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"

path-is-inside@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53"

path-key@^2.0.0, path-key@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
Expand Down Expand Up @@ -13879,7 +13815,7 @@ rgba-regex@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/rgba-regex/-/rgba-regex-1.0.0.tgz#43374e2e2ca0968b0ef1523460b7d730ff22eeb3"

rimraf@2, rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.2, rimraf@^2.6.3, rimraf@^2.7.1:
rimraf@2, rimraf@^2.5.4, rimraf@^2.6.2, rimraf@^2.6.3, rimraf@^2.7.1:
version "2.7.1"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec"
dependencies:
Expand Down Expand Up @@ -16068,13 +16004,7 @@ webpack-log@^2.0.0:
ansi-colors "^3.0.0"
uuid "^3.3.2"

webpack-merge@^4.1.0:
version "4.2.2"
resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-4.2.2.tgz#a27c52ea783d1398afd2087f547d7b9d2f43634d"
dependencies:
lodash "^4.17.15"

[email protected], webpack-sources@^1.0.1, webpack-sources@^1.1.0, webpack-sources@^1.4.0, webpack-sources@^1.4.1, webpack-sources@^1.4.3:
[email protected], webpack-sources@^1.1.0, webpack-sources@^1.4.0, webpack-sources@^1.4.1, webpack-sources@^1.4.3:
version "1.4.3"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.3.tgz#eedd8ec0b928fbf1cbfe994e22d2d890f330a933"
dependencies:
Expand Down