-
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
Closed
justin808
wants to merge
6
commits into
rails:master
from
shakacode:justin808-switch-peer-dependencies
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
babdd6d
Convert to all peer dependencies
justin808 f0a9c29
Update install and upgrade instructions
justin808 75b6bcc
Use the ^ syntax
justin808 27c5851
Update README.md
justin808 2dca6fb
Dynamically list the peer packages to add
justin808 ddc99fa
README update
justin808 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,20 +44,28 @@ Example going to a specific version: | |
|
||
```ruby | ||
# Gemfile | ||
gem 'webpacker', '6.0.0.rc.5' | ||
gem 'webpacker', '6.0.0.rc.6' | ||
``` | ||
|
||
```bash | ||
bundle install | ||
``` | ||
|
||
```bash | ||
yarn add @rails/[email protected].5 --exact | ||
yarn add @rails/[email protected].6 --exact | ||
``` | ||
|
||
```bash | ||
bundle exec rails webpacker:install | ||
``` | ||
|
||
Overwrite all files and check what changed. | ||
|
||
|
||
Note, the webpacker:install will install the peer dependencies: | ||
```bash | ||
yarn add @babel/core @babel/plugin-transform-runtime @babel/preset-env @babel/runtime babel-loader compression-webpack-plugin pnp-webpack-plugin terser-webpack-plugin webpack webpack-assets-manifest webpack-cli webpack-merge webpack-sources webpack-dev-server | ||
``` | ||
|
||
7. Update API usage of the view helpers by changing `javascript_packs_with_chunks_tag` and `stylesheet_packs_with_chunks_tag` to `javascript_pack_tag` and `stylesheet_pack_tag`. Ensure that your layouts and views will only have **at most one call** to `javascript_pack_tag` and **at most one call** to `stylesheet_pack_tag`. You can now pass multiple bundles to these view helper methods. If you fail to changes this, you may experience performance issues, and other bugs related to multiple copies of React, like [issue 2932](https://github.com/rails/webpacker/issues/2932). If you expose jquery globally with `expose-loader,` by using `import $ from "expose-loader?exposes=$,jQuery!jquery"` in your `app/javascript/application.js`, pass the option `defer: false` to your `javascript_pack_tag`. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,32 +11,39 @@ | |
"node": ">= 12.13.0 || >=14", | ||
"yarn": ">=1 <4" | ||
}, | ||
"dependencies": { | ||
"peerDependencies": { | ||
"@babel/core": "^7.15.5", | ||
"@babel/plugin-transform-runtime": "^7.15.0", | ||
"@babel/preset-env": "^7.15.6", | ||
"@babel/runtime": "^7.15.4", | ||
"babel-loader": "^8.2.2", | ||
"compression-webpack-plugin": "^9.0.0", | ||
"glob": "^7.2.0", | ||
"js-yaml": "^4.1.0", | ||
"path-complete-extname": "^1.0.0", | ||
"pnp-webpack-plugin": "^1.7.0", | ||
"terser-webpack-plugin": "^5.2.4", | ||
"webpack": "^5.53.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can leave these as regular dependencies.
For sure, anything with the name webpack or babel in it should be a peer. |
||
"webpack-assets-manifest": "^5.0.6", | ||
"webpack-cli": "^4.8.0", | ||
"webpack-merge": "^5.8.0", | ||
"webpack-sources": "^3.2.1" | ||
"webpack-merge": "^5.8.0" | ||
}, | ||
"dependencies": { | ||
"glob": "^7.2.0", | ||
"js-yaml": "^4.1.0", | ||
"path-complete-extname": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"babel-loader": "^8.2.2", | ||
"compression-webpack-plugin": "^9.0.0", | ||
"eslint": "^7.32.0", | ||
"eslint-config-airbnb": "^18.2.1", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-import": "^2.24.2", | ||
"eslint-plugin-jsx-a11y": "^6.4.1", | ||
"eslint-plugin-react": "^7.26.0", | ||
"jest": "^27.2.1" | ||
"jest": "^27.2.1", | ||
"pnp-webpack-plugin": "^1.7.0", | ||
"webpack": "^5.53.0", | ||
"webpack-assets-manifest": "^5.0.6", | ||
"webpack-merge": "^5.8.0" | ||
}, | ||
"jest": { | ||
"testRegex": "(/__tests__/.*|(\\.|/))\\.jsx?$", | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.