shakapacker 6.2.0 → 6.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6e31a49e348719f7663178aee3ec877d3a53f6bd9e264fd8e82278ac17070e7
4
- data.tar.gz: c2d9294063be7bab761baf8f10eeb82c350dfcc0bfc322cac52fa06fdb4cbef5
3
+ metadata.gz: bd1ab6b39f1ae6a30d35edb3ce88f505aa982751ce798cbc02a7ff1e6d1b1fd4
4
+ data.tar.gz: 389b31b8cd3e24b9cbe39e7fef24257037ec3195229d2fae9d35146f82f6c594
5
5
  SHA512:
6
- metadata.gz: 6cb3b71113fd1c7aad90098a4b0927830347feafe9cb9ef245aa6551950d67b9488be5d9aa411fcb6f775260856189d9cbfc5899732113fffbd7549aee84b7ef
7
- data.tar.gz: 1729dccb33de9f34a2c3ca26268c79255e813a71fae548acd5066d7faaef30e4a58123955a32e7b48c19bb988cd078f407cbdcebae6bcf817522451914fbac7e
6
+ metadata.gz: 44e0784025695f8d6686c9c4fecd551da50f4c47c48939abe0c93b55e6e6f9407b68fba15e88c7dfe2169e981248e31c93e240fa1be342f58ffa368a1a6dc4ac
7
+ data.tar.gz: 8b51a5b4c2870bea948801afe3db35f24bf79bdfb543f098e63bbdc62dd3be1a23241dc8ebccefceb0a92d0c51e50bc0d75553e1eb9c93f0c362ae7a91ea3b47
data/CHANGELOG.md CHANGED
@@ -7,6 +7,10 @@ Changes since last non-beta release.
7
7
 
8
8
  *Please add entries here for your pull requests that are not yet released.*
9
9
 
10
+ ## [v6.2.1] - April 15, 2022
11
+ ### Fixed
12
+ - Put back config.public_manifest_path, removed in 6.2.0 in PR 78. [PR 104](https://github.com/shakacode/shakapacker/pull/104) by [justin808](https://github.com/justin808).
13
+
10
14
  ## [v6.2.0] - March 22, 2022
11
15
 
12
16
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shakapacker (6.1.1)
4
+ shakapacker (6.2.0)
5
5
  activesupport (>= 5.2)
6
6
  rack-proxy (>= 0.6.1)
7
7
  railties (>= 5.2)
data/README.md CHANGED
@@ -17,13 +17,16 @@ Webpacker makes it easy to use the JavaScript pre-processor and bundler [Webpack
17
17
  to manage application-like JavaScript in Rails. It can coexist with the asset pipeline,
18
18
  leaving Webpack responsible solely for app-like JavaScript, or it can be used exclusively, making it also responsible for images, fonts, and CSS.
19
19
 
20
- Check out 6.1.1 for [SWC](https://swc.rs/) and [esbuild-loader](https://github.com/privatenumber/esbuild-loader) support! They are faster than Babel!
20
+ Check out 6.1.1+ for [SWC](https://swc.rs/) and [esbuild-loader](https://github.com/privatenumber/esbuild-loader) support! They are faster than Babel!
21
21
 
22
22
  See a comparison of [webpacker with jsbundling-rails](https://github.com/rails/jsbundling-rails/blob/main/docs/comparison_with_webpacker.md).
23
23
 
24
24
  Discussion forum and Slack to discuss debugging and troubleshooting tips. Please open issues for bugs and feature requests:
25
25
  1. [Discussions tab](https://github.com/shakacode/shakapacker/discussions)
26
26
  2. [Slack discussion channel](https://reactrails.slack.com/join/shared_invite/enQtNjY3NTczMjczNzYxLTlmYjdiZmY3MTVlMzU2YWE0OWM0MzNiZDI0MzdkZGFiZTFkYTFkOGVjODBmOWEyYWQ3MzA2NGE1YWJjNmVlMGE)
27
+ 3. [Tweets with tag `#shakapacker`](https://twitter.com/hashtag/shakapacker?src=hashtag_click)
28
+
29
+ [ShakaCode](https://www.shakacode.com) offers suppport for upgrading from webpacker or using Shakapacker. If interested, contact [justin@shakacode.com](mailto:justin@shakacode.com). ShakaCode is [hiring passionate engineers](https://jobs.lever.co/shakacode/3bdbfdb3-4495-4611-a279-01dddb351abe) that love open source.
27
30
 
28
31
  ---
29
32
 
@@ -307,7 +310,7 @@ end
307
310
 
308
311
  ### Webpack Configuration
309
312
 
310
- First, you don't _need_ to use Shakapacker's webpack configuration. However, the `shakapacker` NPM package provides convenient access to configuration code that reads the `config/webpacker.yml` file which the view helpers also use. If you have your own customized webpack configuration, at the mininmum, you must ensure:
313
+ First, you don't _need_ to use Shakapacker's webpack configuration. However, the `shakapacker` NPM package provides convenient access to configuration code that reads the `config/webpacker.yml` file which the view helpers also use. If you have your own customized webpack configuration, at the minimum, you must ensure:
311
314
 
312
315
  1. Your output files go the right directory
313
316
  2. You provide a manifest, via package [`webpack-assets-manifest`](https://github.com/webdeveric/webpack-assets-manifest) that maps output names (your 'packs') to the fingerprinted versions, including bundle-splitting dependencies. That's the main secret sauce of webpacker!
data/docs/deployment.md CHANGED
@@ -93,10 +93,10 @@ you don't need to do anything extra for Webpacker, it just works.
93
93
 
94
94
  ### Assets compiling on every deployment even if JavaScript and CSS files are not changed
95
95
 
96
- Make sure you have `public/packs` and `node_modules` in `:linked_dirs`
96
+ Make sure you have your public outputh path (default `public/packs`), the webpacker cache path (default `tmp/webpacker`) and `node_modules` in `:linked_dirs`
97
97
 
98
98
  ```ruby
99
- append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "public/packs", ".bundle", "node_modules"
99
+ append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "tmp/webpacker", "public/packs", ".bundle", "node_modules"
100
100
  ```
101
101
 
102
102
  If you have `node_modules` added to `:linked_dirs` you'll need to run yarn install before `deploy:assets:precompile`, so you can add this code snippet at the bottom deploy.rb
@@ -17,6 +17,24 @@
17
17
 
18
18
  4. You can also pass additional options to the command to run the webpack-dev-server and start the webpack-dev-server with the option `--debug-webpacker`
19
19
 
20
+ ## Incorrect peer dependencies
21
+ The latest version of Shakapacker uses peer dependencies to make upgrading easier. However, there's a catch.
22
+
23
+ If you fail to update peer dependencies, you'll see an easy-to-overlook warning from `yarn install`.
24
+
25
+ ```
26
+ warning " > shakapacker@6.1.1" has incorrect peer dependency "compression-webpack-plugin@^9.0.0".
27
+ ```
28
+
29
+ This omission resulted in an error in the browser:
30
+ ```
31
+ Failed to load resource: net::ERR_CONTENT_DECODING_FAILED
32
+ ```
33
+
34
+ The error was caused by an old version of the peer dependency webpack-compression-plugin.
35
+
36
+ So, be sure to investigate warnings from `yarn install`!
37
+
20
38
  ## ENOENT: no such file or directory - node-sass
21
39
 
22
40
  If you get the error `ENOENT: no such file or directory - node-sass` on deploy with
data/docs/v6_upgrade.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  There are several substantial changes in Shakapacker v6 that you need to manually account for when coming from Webpacker 5. This guide will help you through it.
4
4
 
5
+ [ShakaCode](https://www.shakacode.com) offers suppport for upgrading from webpacker or using Shakapacker. If interested, contact [justin@shakacode.com](mailto:justin@shakacode.com).
6
+
5
7
  ## Webpacker/Shakapacker has become a slimmer wrapper around Webpack
6
8
 
7
9
  By default, Webpacker 6 is focused on compiling and bundling JavaScript. This pairs with the existing asset pipeline in Rails that's setup to transpile CSS and static images using [Sprockets](https://github.com/rails/sprockets). For most developers, that's the recommended combination. But if you'd like to use Webpacker for CSS and static assets as well, please see [integrations](https://github.com/shakacode/shakapacker#integrations) for more information.
@@ -17,7 +19,7 @@ See an example migration here: [PR 27](https://github.com/shakacode/react_on_rai
17
19
  _If you're on webpacker v5, follow below steps to get to v6.0.0.rc.6 first._
18
20
 
19
21
  1. Change the gem name from `webpacker` to `shakapacker` and the NPM package from `@rails/webpacker` to `shakapacker`.
20
- 1. Install the peer dependencies. Run `yarn add @babel/core @babel/plugin-transform-runtime @babel/preset-env @babel/runtime babel-loader compression-webpack-plugin terser-webpack-plugin webpack webpack-assets-manifest webpack-cli webpack-merge webpack-sources webpack-dev-server`
22
+ 1. Install the peer dependencies. Run `yarn add @babel/core @babel/plugin-transform-runtime @babel/preset-env @babel/runtime babel-loader compression-webpack-plugin terser-webpack-plugin webpack webpack-assets-manifest webpack-cli webpack-merge webpack-sources webpack-dev-server`. You may have old versions of libraries. Run `yarn install` and check for warnings like `warning " > shakapacker@6.1.1" has incorrect peer dependency "compression-webpack-plugin@^9.0.0"` and `file-loader@1.1.11" has incorrect peer dependency "webpack@^2.0.0 || ^3.0.0 || ^4.0.0"`. In other words, warnings like these are **serious** and will cause considerable confusion if not respected.
21
23
  1. Update any scripts that called `bin/webpack` or `bin/webpack-dev-server` to `bin/webpacker` or `bin/webpacker-dev-server`
22
24
  1. Update your webpack config for a single config file, `config/webpack/webpack.config.js`. If you want to use the prior style of having a separate file for each NODE_ENV, you can use this shim for `config/webpack/webpack.config.js`. WARNING, previously, if you did not set `NODE_ENV`, `NODE_ENV` defaulted to `development`. Thus, you might expect `config/webpack/development.js` to run, but you'll instead be using the `config/webpack/RAILS_ENV.js`
23
25
  ```js
@@ -109,7 +109,7 @@ class Webpacker::Compiler
109
109
 
110
110
  def default_watched_paths
111
111
  [
112
- *config.additional_paths,
112
+ *config.additional_paths.map { |path| "#{path}/**/*" },
113
113
  "#{config.source_path}/**/*",
114
114
  "yarn.lock", "package.json",
115
115
  "config/webpack/**/*"
@@ -47,6 +47,10 @@ class Webpacker::Configuration
47
47
  end
48
48
  end
49
49
 
50
+ def public_manifest_path
51
+ manifest_path
52
+ end
53
+
50
54
  def public_path
51
55
  root_path.join(fetch(:public_root_path))
52
56
  end
@@ -1,4 +1,4 @@
1
1
  module Webpacker
2
2
  # Change the version in package.json too, please!
3
- VERSION = "6.2.0".freeze
3
+ VERSION = "6.2.1".freeze
4
4
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shakapacker",
3
- "version": "6.2.0",
3
+ "version": "6.2.1",
4
4
  "description": "Use webpack to manage app-like JavaScript modules in Rails",
5
5
  "main": "package/index.js",
6
6
  "files": [
@@ -38,6 +38,11 @@ class ConfigurationTest < Webpacker::Test
38
38
  assert_equal @config.public_output_path.to_s, public_output_path
39
39
  end
40
40
 
41
+ def test_public_manifest_path
42
+ public_manifest_path = File.expand_path File.join(File.dirname(__FILE__), "test_app/public/packs", "manifest.json").to_s
43
+ assert_equal @config.public_manifest_path.to_s, public_manifest_path
44
+ end
45
+
41
46
  def test_manifest_path
42
47
  manifest_path = File.expand_path File.join(File.dirname(__FILE__), "test_app/public/packs", "manifest.json").to_s
43
48
  assert_equal @config.manifest_path.to_s, manifest_path
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.2.0
4
+ version: 6.2.1
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-03-22 00:00:00.000000000 Z
13
+ date: 2022-04-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -291,7 +291,7 @@ homepage: https://github.com/shakacode/shakapacker
291
291
  licenses:
292
292
  - MIT
293
293
  metadata:
294
- source_code_uri: https://github.com/shakacode/shakapacker/tree/v6.2.0
294
+ source_code_uri: https://github.com/shakacode/shakapacker/tree/v6.2.1
295
295
  post_install_message:
296
296
  rdoc_options: []
297
297
  require_paths: