-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Convert to all peer dependencies #3234
Convert to all peer dependencies #3234
Conversation
2fd3d43
to
ba94112
Compare
lib/install/template.rb
Outdated
# results << run("yarn add --dev webpack-dev-server @webpack-cli/serve") | ||
|
||
say "Installing peer dependencies of @rails/webpacker" | ||
peer_install = "yarn add @babel/core @babel/plugin-transform-runtime @babel/preset-env @babel/runtime babel-loader "\ |
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 line here needs updates to lock the major versions per the peerDependencies.
I'm waiting for approval on this from @dhh and @guillaumebriday before doing that work.
results << run("yarn add webpack@#{webpack_version} webpack-cli@#{webpack_cli_version}") | ||
|
||
say "Installing dev server for live reloading" | ||
results << run("yarn add --dev webpack-dev-server @webpack-cli/serve") |
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.
@webpack-cli/serve
should not be directly installed per docs.
ba94112
to
0c05884
Compare
@@ -26,17 +26,25 @@ | |||
"webpack": "^5.53.0", |
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 think we can leave these as regular dependencies.
- glob
- js-yaml
- path-complete-extname
For sure, anything with the name webpack or babel in it should be a peer.
README.md
Outdated
@@ -114,6 +114,14 @@ When `package.json` and/or `yarn.lock` changes, such as when pulling down change | |||
yarn install | |||
``` | |||
|
|||
Note, in v6, all JS packages are peer dependencies. Thus, the installer will add the packages: |
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.
Maybe we should add a note on why packages are now peer dependencies to prevent questions and issues. What do you think?
@guillaumebriday and @dhh, I updated the installer so that it reads the package.json for the list of peers to install. I also put 3 small packages back to regular "dependencies." Shall we merge this? |
for peer deps change
Co-authored-by: Guillaume Briday <[email protected]>
This dries up the list of peers to package.json
4942e0e
to
2dca6fb
Compare
What's the status on this? This PR simplifies a lot of deduplication dependency issues raising when having complex webpack setups in quite large apps |
@dhh @guillaumebriday Any feedback on this one? |
Why? This allows easy updating of the dependencies. Let's lock at the major versions, and loosen as requested. See a working version of this: shakacode/react_on_rails_demo_ssr_hmr#23 See original PR: rails/webpacker#3234
@guillaumebriday, @apuntovanini, this is now merged to my fork: I'll be creating a 6.0 release soon. |
Why? This allows easy updating of the dependencies.
Let's lock at the major versions, and loosen as requested.
See a working version of this:
shakacode/react_on_rails_demo_ssr_hmr#23