-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Remove webpack 4 support #26915
Remove webpack 4 support #26915
Conversation
# Conflicts: # packages/next/build/webpack-config.ts
This potentially solves vercel#26297 as I found that compilation.chunkGraph.getChunkModulesIterable was ran against `chunk` instead of `dynamicChunk`
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Stats from current PRDefault Build (Increase detected
|
vercel/next.js canary | timneutkens/next.js add/remove-webpack4 | Change | |
---|---|---|---|
buildDuration | 14.6s | 14.3s | -223ms |
buildDurationCached | 3.5s | 3.1s | -371ms |
nodeModulesSize | 49.3 MB | 43.7 MB | -5.58 MB |
Page Load Tests Overall increase ✓
vercel/next.js canary | timneutkens/next.js add/remove-webpack4 | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.634 | 2.7 | |
/ avg req/sec | 949.08 | 926.08 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.681 | 1.64 | -0.04 |
/error-in-render avg req/sec | 1487.47 | 1523.95 | +36.48 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | timneutkens/next.js add/remove-webpack4 | Change | |
---|---|---|---|
359.HASH.js gzip | 3.09 kB | 3.09 kB | ✓ |
framework-HASH.js gzip | 42 kB | 42 kB | ✓ |
main-HASH.js gzip | 20.6 kB | 20.6 kB | ✓ |
webpack-HASH.js gzip | 1.49 kB | 1.49 kB | ✓ |
Overall change | 67.2 kB | 67.2 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | timneutkens/next.js add/remove-webpack4 | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 31.1 kB | 31.1 kB | ✓ |
Overall change | 31.1 kB | 31.1 kB | ✓ |
Client Pages
vercel/next.js canary | timneutkens/next.js add/remove-webpack4 | Change | |
---|---|---|---|
_app-HASH.js gzip | 803 B | 803 B | ✓ |
_error-HASH.js gzip | 3.18 kB | 3.18 kB | ✓ |
amp-HASH.js gzip | 526 B | 526 B | ✓ |
css-HASH.js gzip | 329 B | 329 B | ✓ |
hooks-HASH.js gzip | 903 B | 903 B | ✓ |
index-HASH.js gzip | 263 B | 263 B | ✓ |
link-HASH.js gzip | 1.65 kB | 1.65 kB | ✓ |
routerDirect..HASH.js gzip | 322 B | 322 B | ✓ |
withRouter-HASH.js gzip | 320 B | 320 B | ✓ |
bb14e60e810b..30f.css gzip | 125 B | 125 B | ✓ |
Overall change | 8.42 kB | 8.42 kB | ✓ |
Client Build Manifests
vercel/next.js canary | timneutkens/next.js add/remove-webpack4 | Change | |
---|---|---|---|
_buildManifest.js gzip | 390 B | 390 B | ✓ |
Overall change | 390 B | 390 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | timneutkens/next.js add/remove-webpack4 | Change | |
---|---|---|---|
index.html gzip | 523 B | 523 B | ✓ |
link.html gzip | 537 B | 537 B | ✓ |
withRouter.html gzip | 515 B | 515 B | ✓ |
Overall change | 1.57 kB | 1.57 kB | ✓ |
// If the user decides to `.eslintignore` all of the files in the lint directory it should not throw an error during `next build` or `next lint` | ||
if (err?.messageTemplate === 'all-files-ignored') { | ||
return null | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed in place of disabling the errorOnUnmatchedPattern
property (done here: #27119)
This was superseded by the conformance system published in Next.js 11. Follow-up to vercel#26448 Separated out change from vercel#26915
This has landed in #29660 |
@timneutkens can we land 134a363 which is a blocker for webpack5 upgrade for those using serverless? |
That's already landed @chirag04 🤔 |
@timneutkens maybe i'm looking at it in the wrong place but i don't see the change in master: https://github.com/vercel/next.js/blob/master/packages/next/build/webpack/plugins/serverless-plugin.ts#L26-L36 I will try upgrading to webpack 5 to see if we still need this. |
The master branch is never used, we only work on the canary branch. |
ah! apologies. I didn't realize. will try to upgrade and see how it goes. Thanks for the help @timneutkens . |
PR for the next major version to remove webpack 4 support.
Notable changes:
isWebpack5
as there's no difference between versionsast-types
andrecast
depschokidar
dep as it was only needed by webpack 4next-babel-loader
which was the legacy babel loader that was superseded by the new optimized Babel loader introduced in Next.js 11. This loader was used only when using webpack 4.cacache
dependencyemit-file-loader
, we've kept this loader around for quite some time even though it's not used in Next.js.
chunk-names-plugin
as webpack 5 support correctly naming filesssr-module-cache-plugin
as webpack 5 correctly caches module instances between filesisWebpack5
in testseslint
support.eslintignore
fortest/integration/async-modules
.eslintignore
(previously caused an unhelpful error)TODO:
webpack.d.ts
to leverage built-in webpack 5 types. (not needed to land this PR)Closes #26448
Bug
fixes #number
contributing.md
Feature
fixes #number
contributing.md
Documentation / Examples