-
Notifications
You must be signed in to change notification settings - Fork 2.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
Update js dependencies, prepare for webpack 5 #4146
Conversation
Okay, I just discovered that there is already a PR for updating to webpack 5 here with a lot of discussion. I didn't see that before making this. Let me know if I should close this PR again, that is 👍 However this PR is different in remaining on webpack 4 to prepare for webpack 5 and to hopefully make the webpack 5 upgrade step smaller. So perhaps this could be useful if the webpack 5 upgrade will not happen for a while. |
Also, I think we also need to update the |
(Not a maintainer, just another contributor.) The "Node.js" naming consistency fixes seems like a fairly separate fix that could perhaps be merged independent of that other PR (and this one) – could it make sense to make that into a separate PR? |
Good suggestion! Done in #4150 |
- Major version 6 is the last one to support webpack 4 - Minimum supported Node.js version is 10.13 - Changelog: https://github.com/webpack-contrib/copy-webpack-plugin/blob/v6.4.1/CHANGELOG.md
- Minimum Node.js version is v10.13 - Changelog: https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md
The node-sass module is deprecated and sass-loader recommends using dart-sass instead, https://github.com/webpack-contrib/sass-loader
- It makes asset compilation crash when used with latest mini-css-extract-plugin - HardSourceWebpackPlugin is no longer needed with Webpack 5: mzgoddard/hard-source-webpack-plugin#514 (comment)
I just force-pushed on top of the current
|
This is strange: My diff on GitHub is confusing for this commit: 08dd8b4 .. It shows changes to
and
But my local git commit shows no changes. 🤔 |
If you choose to go with #4054, just let me know, I will close this PR. Also if I should move change from |
Is there interest in going forward with this PR? If so, please let me know, and I'll bump the dependencies to their newest versions. I'll close the PR in a week if there's no activity on it. |
I have a large backlog of other items. Hang tight. Thanks! :) |
@chrismccord Thanks, and thank you for your work! Please let me know if there are things that will make review and merge of the PR easier at your end. I'm happy to help ☀️ |
We have tacked webpack v5 support in #4337 . Thank you for the leg work on this! ❤️❤️❤️🐥🔥 |
This PR updates all javascript dependencies to their newest versions, but also removes and changes some of them to prepare for upgrading to webpack 5.
Dependency changes:
package.json
are updated to reflect the latest current version, with^
for minor version upgradesThe(update: this was done in Allow webpack > 4.41 but < 5 #4198 in the meantime)webpack
version is now also prefixed with^
for minor version updates. It was locked to a single version beforemini-css-extract-plugin
. Also it should not be necessary in webpack 5, so it is removed in 2ada2fenode-sass
plugin has been deprecated and thesass-loader
recommends usingdart-sass
instead. I have replacednode-sass
withsass
in bc43102Other changes:
installation.md
Node.js is spelled differently across Phoenix as e.g. "node", "NodeJS", "Node.JS", etc, but the correct spelling is Node.js. This is corrected across the project(Update: This has been done in Use consistent naming of Node.js in docs #4150)I have created a new
phx_new
package locally and verified that I can install a new phoenix project with these updated packages, and that theiex -S mix phx.server
runs.I haven't verified that it works with releases yet.
Notes on warnings:
Currently we get a lot of warnings during
npm install
:As I understand it, these errors will be fixed in webpack 5, and we can't do anything about them before upgrading to webpack 5.
chokidar@2.1.8
,resolve-url@0.2.1
,urix@0.1.0
,fsevents@1.2.13
are all dependencies ofwebpack@4.45.0
.The path ahead
This PR paves the way for upgrading to webpack 5, by removing some plugins and updating others to versions compatible with webpack 5. Also, updating to webpack 5 should fix the above deprecations.
Should we wait until Phoenix 1.6 with an upgrade to webpack 5, or would it be ok to include it in Phoenix 1.5?