-
Notifications
You must be signed in to change notification settings - Fork 82
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
Webpack 4 ✨ #3323
Webpack 4 ✨ #3323
Conversation
TIL you can't reopen a PR after force pushing it (#3310) |
I'd like to hold merge this until we branch |
"process.env.version": JSON.stringify(packageInfo.version) | ||
}), | ||
new UglifyJsPlugin({ |
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.
Anything else to replace uglify?
@@ -15,6 +15,7 @@ delete dependencies["canvas-ui"]; | |||
delete dependencies["cnvs"]; | |||
|
|||
module.exports = merge(common, { | |||
mode: "production", |
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.
will this replace "process.env.NODE_ENV"
?
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.
Yes; webpack sets this and other behaviors like uglify automatically in this mode
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.
I didn't intend for this to be a surprise but left the background in the commit messages . I'll be sure to add these to the PR description in the future https://webpack.js.org/concepts/mode/
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.
Oh, my bad. Don't have a strong habit of reading commit messages during a review
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.
When you review my difficult PRs you will usually do better to review commit by commit. (Github makes this pretty easy with keyboard shortcuts BTW you can press 'n' and 'p' when looking at a pull/commit page). I usually take the time to groom my commits to make review easier to deal with.
@@ -65,6 +65,12 @@ module.exports = { | |||
], | |||
module: { | |||
rules: [ | |||
{ | |||
type: "javascript/auto", |
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.
Would that transpile all the modules? Do we need this or it's more like a nice to have?
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.
Not a long term solution, but a workaround owing the to the fact that webpack 4 prefers mjs files to js files and react-apollo fails to account for this. apollographql/react-apollo#1737
fd4d977
to
4620a89
Compare
Conflicts! |
Ill merge #3307 and then rebase on master |
ExtractTextPlugin was deprecated in Webpack 4 and replaced by this package
dffa888
to
d48e4d1
Compare
Background: https://webpack.js.org/concepts/mode/ Closes DCOS_OSS-2358
d48e4d1
to
89501bb
Compare
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.
I don't think I know enough about webpack to approve or disapprove, but I tested it and I think it looks good. I like that you made separate commits with additional information.
I'd say the longer we wait the closer to a release we will be merging this :) |
🎉 This PR is included in version 2.27.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
I had some time last night to upgrade to Webpack 4. It's slightly faster, but doesn't offer any big advantages that I know of right now. If we migrate to babel 7, we can drop ts-loader since babel 7 can transpile typescript now. That could potentially knock 20s off our build time
Testing
npm start
ornpm run build-assets
Trade-offs
I don't know of any risks.
Dependencies
This branch is based on #3307