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

Convert to all peer dependencies #3234

Closed

Conversation

justin808
Copy link
Contributor

@justin808 justin808 commented Nov 23, 2021

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

@justin808 justin808 force-pushed the justin808-switch-peer-dependencies branch from 2fd3d43 to ba94112 Compare November 23, 2021 01:07
# 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 "\
Copy link
Contributor Author

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")
Copy link
Contributor Author

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.

@@ -26,17 +26,25 @@
"webpack": "^5.53.0",
Copy link
Contributor Author

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.

  1. glob
  2. js-yaml
  3. 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:
Copy link
Member

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?

README.md Outdated Show resolved Hide resolved
@justin808
Copy link
Contributor Author

@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?

@apuntovanini
Copy link

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

@justin808
Copy link
Contributor Author

@dhh @guillaumebriday Any feedback on this one?

justin808 added a commit to shakacode/shakapacker that referenced this pull request Jan 17, 2022
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
@justin808
Copy link
Contributor Author

@guillaumebriday, @apuntovanini, this is now merged to my fork:

shakacode/shakapacker@e99432b

I'll be creating a 6.0 release soon.

@dhh dhh closed this Jan 19, 2022
@justin808 justin808 deleted the justin808-switch-peer-dependencies branch April 6, 2022 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants