shakapacker 6.5.1 → 6.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
- data/.github/ISSUE_TEMPLATE/feature-request.md +1 -1
- data/CHANGELOG.md +24 -3
- data/README.md +34 -12
- data/docs/v6_upgrade.md +5 -2
- data/lib/install/bin/webpacker +3 -5
- data/lib/install/bin/webpacker-dev-server +1 -6
- data/lib/install/config/webpacker.yml +6 -0
- data/lib/webpacker/runner.rb +1 -1
- data/lib/webpacker/version.rb +1 -1
- data/package/environments/__tests__/base.js +11 -0
- data/package/environments/base.js +5 -1
- data/package.json +1 -1
- data/test/test_app/config/webpacker_css_extract_ignore_order_warnings.yml +84 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d1161db88c6d6b16130fe5b25915e4c3b6d556209006c52a67933c1b95e500d
|
4
|
+
data.tar.gz: 7f3dc703cb44cdf59ceabf0a97e7bfcbdf99ecf42faa6eda2b60ed91b5b06f12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f04fdd02eb9e9c10d284a35f9d47acfab440ac21f0d21650cb9c2de520d748e13c46bbb4ec70ff66b86e0821c6828afbc5ba87b0726c3d241b9c7b52635802d6
|
7
|
+
data.tar.gz: 275dade1375413e6a47d88a155b0aa1a6a416713063aff2f8a1528a04a9b2c515350a65131bed4a338c622359ff66970da5535af549c81270de7bd753abf3c65
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
* For the changelog of versions prior to v6, see the [5.x stable branch of rails/webpacker](https://github.com/rails/webpacker/tree/5-x-stable).
|
2
2
|
* Please see the [v6 Upgrade Guide](./docs/v6_upgrade.md) to go from versions prior to v6.
|
3
|
-
* [ShakaCode](https://www.shakacode.com) offers support for upgrading from
|
3
|
+
* [ShakaCode](https://www.shakacode.com) offers support for upgrading from Webpacker or using Shakapacker. If interested, contact Justin Gordon, [justin@shakacode.com](mailto:justin@shakacode.com).
|
4
4
|
|
5
5
|
## Versions
|
6
6
|
## [Unreleased]
|
@@ -8,7 +8,26 @@ Changes since last non-beta release.
|
|
8
8
|
|
9
9
|
_Please add entries here for your pull requests that are not yet released._
|
10
10
|
|
11
|
-
## [v6.5.
|
11
|
+
## [v6.5.3] - November 1, 2022
|
12
|
+
|
13
|
+
### Improved
|
14
|
+
- Set RAILS_ENV and BUNDLE_GEMFILE env values before requiring `bundler/setup`, `webpacker`, and `webpacker/webpack_runner`. [PR 190](https://github.com/shakacode/shakapacker/pull/190) by [betmenslido](https://github.com/betmenslido).
|
15
|
+
- The `mini-css-extract-plugin` may cause various warnings indicating CSS order conflicts when using a [File-System-based automated bundle generation feature](https://www.shakacode.com/react-on-rails/docs/guides/file-system-based-automated-bundle-generation/).
|
16
|
+
CSS order warnings can be disabled in projects where CSS ordering has been mitigated by consistent use of scoping or naming conventions. Added `css_extract_ignore_order_warnings` flag to webpacker configuration to disable the order warnings by [pulkitkkr](https://github.com/shakacode/shakapacker/pull/185) in [PR 192](https://github.com/shakacode/shakapacker/pull/192).
|
17
|
+
|
18
|
+
## [v6.5.2] - September 8, 2022
|
19
|
+
|
20
|
+
### Upgrade
|
21
|
+
Remove the setting of the NODE_ENV in your `bin/webpacker` and `bin/webpacker-dev-server` files per [PR 185](https://github.com/shakacode/shakapacker/pull/185).
|
22
|
+
|
23
|
+
### Fixed
|
24
|
+
- Changed NODE_ENV defaults to the following and moved from binstubs to the runner. [PR 185](https://github.com/shakacode/shakapacker/pull/185) by [mage1711](https://github.com/mage1711).
|
25
|
+
|
26
|
+
```
|
27
|
+
ENV["NODE_ENV"] ||= (ENV["RAILS_ENV"] == "production") ? "production" : "development"
|
28
|
+
```
|
29
|
+
|
30
|
+
## [v6.5.1] - August 15, 2022
|
12
31
|
|
13
32
|
### Improved
|
14
33
|
- Resolve exact npm package version from lockfiles for constraint checking. [PR 170](https://github.com/shakacode/shakapacker/pull/170) by [G-Rath](https://github.com/G-Rath).
|
@@ -163,7 +182,9 @@ Note: [Rubygem is 6.3.0.pre.rc.1](https://rubygems.org/gems/shakapacker/versions
|
|
163
182
|
## v5.4.3 and prior changes from rails/webpacker
|
164
183
|
See [CHANGELOG.md in rails/webpacker (up to v5.4.3)](https://github.com/rails/webpacker/blob/master/CHANGELOG.md)
|
165
184
|
|
166
|
-
[Unreleased]: https://github.com/shakacode/shakapacker/compare/v6.5.
|
185
|
+
[Unreleased]: https://github.com/shakacode/shakapacker/compare/v6.5.3...master
|
186
|
+
[v6.5.3]: https://github.com/shakacode/shakapacker/compare/v6.5.2...v6.5.3
|
187
|
+
[v6.5.2]: https://github.com/shakacode/shakapacker/compare/v6.5.1...v6.5.2
|
167
188
|
[v6.5.1]: https://github.com/shakacode/shakapacker/compare/v6.5.0...v6.5.1
|
168
189
|
[v6.5.0]: https://github.com/shakacode/shakapacker/compare/v6.4.1...v6.5.0
|
169
190
|
[v6.4.1]: https://github.com/shakacode/shakapacker/compare/v6.4.0...v6.4.1
|
data/README.md
CHANGED
@@ -351,6 +351,8 @@ Note, if you are using server-side rendering of JavaScript with dynamic code-spl
|
|
351
351
|
|
352
352
|
Webpacker ships with two binstubs: `./bin/webpacker` and `./bin/webpacker-dev-server`. Both are thin wrappers around the standard `webpack.js` and `webpack-dev-server.js` executables to ensure that the right configuration files and environmental variables are loaded based on your environment.
|
353
353
|
|
354
|
+
_Note: older Shakapacker installations had set a missing NODE_ENV in the binstubs. Please remove this for versions 6.5.2 and newer._
|
355
|
+
|
354
356
|
#### Automatic Webpack Code Building
|
355
357
|
|
356
358
|
Shakapacker can be configured to automatically compile on demand when needed using the `webpacker.yml` `compile` option. This happens when you refer to any of the pack assets using the Shakapacker helper methods. This means that you don't have to run any separate processes. Compilation errors are logged to the standard Rails log. However, this auto-compilation happens when a web request is made that requires an updated webpack build, not when files change. Thus, that can be **painfully slow** for front-end development in this default way. Instead, you should either run the `bin/webpacker --watch` or run `./bin/webpacker-dev-server` during development.
|
@@ -434,7 +436,7 @@ const options = {
|
|
434
436
|
|
435
437
|
// Copy the object using merge b/c the baseClientWebpackConfig is a mutable global
|
436
438
|
// If you want to use this object for client and server rendering configurations,
|
437
|
-
//
|
439
|
+
// having a new object is essential.
|
438
440
|
module.exports = merge({}, baseWebpackConfig, options)
|
439
441
|
```
|
440
442
|
|
@@ -815,14 +817,34 @@ We encourage you to contribute to Shakapacker/Webpacker! See [CONTRIBUTING](CONT
|
|
815
817
|
|
816
818
|
Webpacker is released under the [MIT License](https://opensource.org/licenses/MIT).
|
817
819
|
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
820
|
+
## Supporters
|
821
|
+
|
822
|
+
<a href="https://www.jetbrains.com">
|
823
|
+
<img src="https://user-images.githubusercontent.com/4244251/184881139-42e4076b-024b-4b30-8c60-c3cd0e758c0a.png" alt="JetBrains" height="120px">
|
824
|
+
</a>
|
825
|
+
<a href="https://scoutapp.com">
|
826
|
+
<picture>
|
827
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/4244251/184881147-0d077438-3978-40da-ace9-4f650d2efe2e.png">
|
828
|
+
<source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/4244251/184881152-9f2d8fba-88ac-4ba6-873b-22387f8711c5.png">
|
829
|
+
<img alt="ScoutAPM" src="https://user-images.githubusercontent.com/4244251/184881152-9f2d8fba-88ac-4ba6-873b-22387f8711c5.png" height="120px">
|
830
|
+
</picture>
|
831
|
+
</a>
|
832
|
+
<br />
|
833
|
+
<a href="https://www.browserstack.com">
|
834
|
+
<picture>
|
835
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/4244251/184881122-407dcc29-df78-4b20-a9ad-f597b56f6cdb.png">
|
836
|
+
<source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/4244251/184881129-e1edf4b7-3ae1-4ea8-9e6d-3595cf01609e.png">
|
837
|
+
<img alt="BrowserStack" src="https://user-images.githubusercontent.com/4244251/184881129-e1edf4b7-3ae1-4ea8-9e6d-3595cf01609e.png" height="55px">
|
838
|
+
</picture>
|
839
|
+
</a>
|
840
|
+
<a href="https://railsautoscale.com">
|
841
|
+
<img src="https://user-images.githubusercontent.com/4244251/184881144-95c2c25c-9879-4069-864d-4e67d6ed39d2.png" alt="Rails Autoscale" height="55px">
|
842
|
+
</a>
|
843
|
+
<a href="https://www.honeybadger.io">
|
844
|
+
<img src="https://user-images.githubusercontent.com/4244251/184881133-79ee9c3c-8165-4852-958e-31687b9536f4.png" alt="Honeybadger" height="55px">
|
845
|
+
</a>
|
846
|
+
|
847
|
+
<br />
|
848
|
+
<br />
|
849
|
+
|
850
|
+
The following companies support our open source projects, and ShakaCode uses their products!
|
data/docs/v6_upgrade.md
CHANGED
@@ -15,6 +15,9 @@ While you have to configure integration with frameworks yourself, [`webpack-merg
|
|
15
15
|
## webpacker v6.0.0.rc.6 to shakapacker v6.0.0
|
16
16
|
See an example migration here: [PR 27](https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh/pull/27).
|
17
17
|
|
18
|
+
### Update to v6.5.2
|
19
|
+
1. Remove setting the NODE_ENV in your `bin/webpacker` and `bin/webpacker-dev-server` bin stubs as these are not set in the webpack runner file.
|
20
|
+
|
18
21
|
### Update Steps to v6.0.0 from v6.0.0.rc.6
|
19
22
|
_If you're on webpacker v5, follow below steps to get to v6.0.0.rc.6 first._
|
20
23
|
|
@@ -53,7 +56,7 @@ _If you're on webpacker v5, follow below steps to get to v6.0.0.rc.6 first._
|
|
53
56
|
|
54
57
|
1. Upgrade the Webpacker Ruby gem and the NPM package
|
55
58
|
|
56
|
-
Note: [Check the gem page to verify the latest version](https://rubygems.org/gems/shakapacker), and make sure to install identical version numbers of `shakapacker` gem and package
|
59
|
+
Note: [Check the gem page to verify the latest version](https://rubygems.org/gems/shakapacker), and make sure to install identical version numbers of `shakapacker` gem and package, and remove the old `webpacker` gem from the Gemfile (Gems use a hyphen and packages use a dot between the main version number and the beta version.)
|
57
60
|
|
58
61
|
Example going to a specific version:
|
59
62
|
|
@@ -92,7 +95,7 @@ _If you're on webpacker v5, follow below steps to get to v6.0.0.rc.6 first._
|
|
92
95
|
source_path: app/javascript
|
93
96
|
source_entry_path: /
|
94
97
|
```
|
95
|
-
If you prefer this
|
98
|
+
If you prefer this configuration, then you will move your `app/javascript/packs/*` (including `application.js`) to `app/javascript/` and update the configuration file.
|
96
99
|
|
97
100
|
Note, moving your files is optional, as you can stil keep your entries in a separate directory, called something like `packs`, or `entries`. This directory is defined with the `source_path`.
|
98
101
|
|
data/lib/install/bin/webpacker
CHANGED
@@ -1,14 +1,12 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
3
|
+
ENV["RAILS_ENV"] ||= "development"
|
4
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
|
5
|
+
|
4
6
|
require "bundler/setup"
|
5
7
|
require "webpacker"
|
6
8
|
require "webpacker/webpack_runner"
|
7
9
|
|
8
|
-
ENV["RAILS_ENV"] ||= "development"
|
9
|
-
ENV["NODE_ENV"] ||= ENV["RAILS_ENV"]
|
10
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", Pathname.new(__FILE__).realpath)
|
11
|
-
|
12
10
|
APP_ROOT = File.expand_path("..", __dir__)
|
13
11
|
Dir.chdir(APP_ROOT) do
|
14
12
|
Webpacker::WebpackRunner.run(ARGV)
|
@@ -1,14 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
ENV["RAILS_ENV"] ||= "development"
|
4
|
-
ENV["
|
5
|
-
|
6
|
-
require "pathname"
|
7
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
8
|
-
Pathname.new(__FILE__).realpath)
|
4
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
|
9
5
|
|
10
6
|
require "bundler/setup"
|
11
|
-
|
12
7
|
require "webpacker"
|
13
8
|
require "webpacker/dev_server_runner"
|
14
9
|
|
@@ -11,6 +11,12 @@ default: &default
|
|
11
11
|
# You cannot set this option to true if you set source_entry_path to '/'
|
12
12
|
nested_entries: false
|
13
13
|
|
14
|
+
# While using a File-System-based automated bundle generation feature, miscellaneous warnings suggesting css order
|
15
|
+
# conflicts may arise due to the mini-css-extract-plugin. For projects where css ordering has been mitigated through
|
16
|
+
# consistent use of scoping or naming conventions, the css order warnings can be disabled by setting
|
17
|
+
# css_extract_ignore_order_warnings to true
|
18
|
+
css_extract_ignore_order_warnings: false
|
19
|
+
|
14
20
|
public_root_path: public
|
15
21
|
public_output_path: packs
|
16
22
|
cache_path: tmp/webpacker
|
data/lib/webpacker/runner.rb
CHANGED
data/lib/webpacker/version.rb
CHANGED
@@ -24,6 +24,17 @@ describe('Base config', () => {
|
|
24
24
|
)
|
25
25
|
})
|
26
26
|
|
27
|
+
test('should return false for css_extract_ignore_order_warnings when using default config', () => {
|
28
|
+
expect(config.css_extract_ignore_order_warnings).toEqual(false)
|
29
|
+
})
|
30
|
+
|
31
|
+
test('should return true for css_extract_ignore_order_warnings when configured', () => {
|
32
|
+
process.env.WEBPACKER_CONFIG = 'config/webpacker_css_extract_ignore_order_warnings.yml'
|
33
|
+
const config = require("../../config");
|
34
|
+
|
35
|
+
expect(config.css_extract_ignore_order_warnings).toEqual(true)
|
36
|
+
})
|
37
|
+
|
27
38
|
test('should return only 2 entry points with config.nested_entries == false', () => {
|
28
39
|
expect(config.nested_entries).toEqual(false)
|
29
40
|
|
@@ -73,7 +73,11 @@ const getPlugins = () => {
|
|
73
73
|
plugins.push(
|
74
74
|
new MiniCssExtractPlugin({
|
75
75
|
filename: `css/[name]${hash}.css`,
|
76
|
-
chunkFilename: `css/[id]${hash}.css
|
76
|
+
chunkFilename: `css/[id]${hash}.css`.split(),
|
77
|
+
// For projects where css ordering has been mitigated through consistent use of scoping or naming conventions,
|
78
|
+
// the css order warnings can be disabled by setting the ignoreOrder flag.
|
79
|
+
// Read: https://stackoverflow.com/questions/51971857/mini-css-extract-plugin-warning-in-chunk-chunkname-mini-css-extract-plugin-con
|
80
|
+
ignoreOrder: config.css_extract_ignore_order_warnings
|
77
81
|
})
|
78
82
|
)
|
79
83
|
}
|
data/package.json
CHANGED
@@ -0,0 +1,84 @@
|
|
1
|
+
# Note: You must restart bin/webpacker-dev-server for changes to take effect
|
2
|
+
|
3
|
+
default: &default
|
4
|
+
source_path: app/packs
|
5
|
+
source_entry_path: entrypoints
|
6
|
+
nested_entries: true
|
7
|
+
public_root_path: public
|
8
|
+
public_output_path: packs
|
9
|
+
cache_path: tmp/webpacker
|
10
|
+
webpack_compile_output: false
|
11
|
+
webpack_loader: babel
|
12
|
+
css_extract_ignore_order_warnings: true
|
13
|
+
|
14
|
+
# Location for manifest.json, defaults to {public_output_path}/manifest.json if unset
|
15
|
+
# manifest_path: public/packs/manifest.json
|
16
|
+
|
17
|
+
# Additional paths webpack should look up modules
|
18
|
+
# ['app/assets', 'engine/foo/app/assets']
|
19
|
+
additional_paths:
|
20
|
+
- app/assets
|
21
|
+
- /etc/yarn
|
22
|
+
- some.config.js
|
23
|
+
- app/elm
|
24
|
+
|
25
|
+
# Reload manifest.json on all requests so we reload latest compiled packs
|
26
|
+
cache_manifest: false
|
27
|
+
|
28
|
+
static_assets_extensions:
|
29
|
+
- .jpg
|
30
|
+
- .jpeg
|
31
|
+
- .png
|
32
|
+
- .gif
|
33
|
+
- .tiff
|
34
|
+
- .ico
|
35
|
+
- .svg
|
36
|
+
|
37
|
+
extensions:
|
38
|
+
- .mjs
|
39
|
+
- .js
|
40
|
+
|
41
|
+
development:
|
42
|
+
<<: *default
|
43
|
+
compile: true
|
44
|
+
ensure_consistent_versioning: true
|
45
|
+
|
46
|
+
# Reference: https://webpack.js.org/configuration/dev-server/
|
47
|
+
dev_server:
|
48
|
+
https: false
|
49
|
+
host: localhost
|
50
|
+
port: 3035
|
51
|
+
public: localhost:3035
|
52
|
+
hmr: false
|
53
|
+
overlay: true
|
54
|
+
disable_host_check: true
|
55
|
+
use_local_ip: false
|
56
|
+
pretty: false
|
57
|
+
|
58
|
+
test:
|
59
|
+
<<: *default
|
60
|
+
compile: true
|
61
|
+
|
62
|
+
# Compile test packs to a separate directory
|
63
|
+
public_output_path: packs-test
|
64
|
+
|
65
|
+
production:
|
66
|
+
<<: *default
|
67
|
+
|
68
|
+
# Production depends on precompilation of packs prior to booting for performance.
|
69
|
+
compile: false
|
70
|
+
|
71
|
+
# Cache manifest.json for performance
|
72
|
+
cache_manifest: true
|
73
|
+
|
74
|
+
staging:
|
75
|
+
<<: *default
|
76
|
+
|
77
|
+
# Production depends on precompilation of packs prior to booting for performance.
|
78
|
+
compile: false
|
79
|
+
|
80
|
+
# Cache manifest.json for performance
|
81
|
+
cache_manifest: true
|
82
|
+
|
83
|
+
# Compile staging packs to a separate directory
|
84
|
+
public_output_path: packs-staging
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shakapacker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.5.
|
4
|
+
version: 6.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2022-
|
13
|
+
date: 2022-11-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -316,6 +316,7 @@ files:
|
|
316
316
|
- test/test_app/config/initializers/inspect_autoload_paths.rb
|
317
317
|
- test/test_app/config/webpack/webpack.config.js
|
318
318
|
- test/test_app/config/webpacker.yml
|
319
|
+
- test/test_app/config/webpacker_css_extract_ignore_order_warnings.yml
|
319
320
|
- test/test_app/config/webpacker_defaults_fallback.yml
|
320
321
|
- test/test_app/config/webpacker_manifest_path.yml
|
321
322
|
- test/test_app/config/webpacker_nested_entries.yml
|
@@ -336,7 +337,7 @@ homepage: https://github.com/shakacode/shakapacker
|
|
336
337
|
licenses:
|
337
338
|
- MIT
|
338
339
|
metadata:
|
339
|
-
source_code_uri: https://github.com/shakacode/shakapacker/tree/v6.5.
|
340
|
+
source_code_uri: https://github.com/shakacode/shakapacker/tree/v6.5.3
|
340
341
|
post_install_message:
|
341
342
|
rdoc_options: []
|
342
343
|
require_paths:
|
@@ -432,6 +433,7 @@ test_files:
|
|
432
433
|
- test/test_app/config/initializers/inspect_autoload_paths.rb
|
433
434
|
- test/test_app/config/webpack/webpack.config.js
|
434
435
|
- test/test_app/config/webpacker.yml
|
436
|
+
- test/test_app/config/webpacker_css_extract_ignore_order_warnings.yml
|
435
437
|
- test/test_app/config/webpacker_defaults_fallback.yml
|
436
438
|
- test/test_app/config/webpacker_manifest_path.yml
|
437
439
|
- test/test_app/config/webpacker_nested_entries.yml
|