shakapacker 8.0.0.rc.2 → 8.0.0.rc.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78b70cacbde999707fcbdf1d0f45a192e21c7e5eef5e9f5709835b9dcadd3824
4
- data.tar.gz: 1110ce2c14512b80243f70d6273565e01983cac159c002e044c9fc732c425c9d
3
+ metadata.gz: b80f21f0131e58e60f67a6f091e573f22b3d7c72b3699b4b7aee547635292189
4
+ data.tar.gz: 45d54a9d54a72207ba2e83f9bc04a0214d6c0af98974710a42eee99faf4c74e1
5
5
  SHA512:
6
- metadata.gz: 266bd0b3cd20a82d6b1d910e9b2a442c498c2a3dc259bc487604c80993e55fbbff81c0733b66edb8abc7215cc8b5252e60fa6b08c5c0608e3d7cf4f07c07e112
7
- data.tar.gz: 2855f15d2c926a7a0bc3f6075dd46e75ab68368edbe98e19d3360a02bcbb271c0fa06a563b1c1ac5c89635862ef005e88680ef28df2c249cd3b9dfe3c6864faf
6
+ metadata.gz: 256858b1e4735261071074a563fe1aa6638181ed0e7716076ba9381776044aaa4e86bf94f9bfad6e8d49d9621ab7044817d27a3ca4480049ffd56bf0a817ce6e
7
+ data.tar.gz: 0dceb48507cf9b28ff44d980cda954d117a152021f2f8751984b32a650b0be894bbfb43fff9025e26c2a4bc1f43cd718e86dfc818d4915da0f779126697a9067
data/CHANGELOG.md CHANGED
@@ -10,6 +10,23 @@ _next_ branch is for v8 changes
10
10
  ## [Unreleased]
11
11
  Changes since the last non-beta release.
12
12
 
13
+ ### Breaking changes
14
+ - Removes CDN url from the manifest.json paths. [PR 473](https://github.com/shakacode/shakapacker/pull/473) by [tomdracz](https://github.com/tomdracz).
15
+
16
+ This returns to the Webpacker behaviour prior to the aborted Webpacker v6.
17
+
18
+ ### Fixed
19
+
20
+ - Fixes incorrect removal of files in the assets:clean task [PR 474](https://github.com/shakacode/shakapacker/pull/474) by [tomdracz](https://github.com/tomdracz).
21
+
22
+ ## [v8.0.0.rc.3] - May 9, 2024
23
+
24
+ ### Fixed
25
+
26
+ - Support v9 PNPM lockfiles [PR 472](https://github.com/shakacode/shakapacker/pull/472) by [G-Rath](https://github.com/g-rath).
27
+
28
+ ## [v8.0.0.rc.2] - May 7, 2024
29
+
13
30
  ### Breaking changes
14
31
  - Remove `relative_url_root` [PR 413](https://github.com/shakacode/shakapacker/pull/413) by [G-Rath](https://github.com/g-rath).
15
32
 
@@ -353,7 +370,9 @@ Note: [Rubygem is 6.3.0.pre.rc.1](https://rubygems.org/gems/shakapacker/versions
353
370
  ## v5.4.3 and prior changes from rails/webpacker
354
371
  See [CHANGELOG.md in rails/webpacker (up to v5.4.3)](https://github.com/rails/webpacker/blob/master/CHANGELOG.md)
355
372
 
356
- [Unreleased]: https://github.com/shakacode/shakapacker/compare/v7.2.3...main
373
+ [Unreleased]: https://github.com/shakacode/shakapacker/compare/v8.0.0-rc.3...main
374
+ [v8.0.0.rc.3]: https://github.com/shakacode/shakapacker/compare/v8.0.0-rc.2...v8.0.0-rc.3
375
+ [v8.0.0.rc.2]: https://github.com/shakacode/shakapacker/compare/v7.2.3...v8.0.0-rc.2
357
376
  [v7.2.3]: https://github.com/shakacode/shakapacker/compare/v7.2.2...v7.2.3
358
377
  [v7.2.2]: https://github.com/shakacode/shakapacker/compare/v7.2.1...v7.2.2
359
378
  [v7.2.1]: https://github.com/shakacode/shakapacker/compare/v7.2.0...v7.2.1
data/README.md CHANGED
@@ -27,11 +27,17 @@ See a comparison of [Shakapacker with jsbundling-rails](https://github.com/rails
27
27
  For discussions, see our [Slack Channel](https://reactrails.slack.com/join/shared_invite/enQtNjY3NTczMjczNzYxLTlmYjdiZmY3MTVlMzU2YWE0OWM0MzNiZDI0MzdkZGFiZTFkYTFkOGVjODBmOWEyYWQ3MzA2NGE1YWJjNmVlMGE).
28
28
 
29
29
  ---
30
- ### ShakaCode Support
30
+ ## ShakaCode Support
31
31
 
32
- [ShakaCode](https://www.shakacode.com) offers support for upgrading from Webpacker and using Shakapacker. If interested, contact Justin Gordon, [justin@shakacode.com](mailto:justin@shakacode.com). We're also [hiring](https://jobs.lever.co/shakacode/3bdbfdb3-4495-4611-a279-01dddb351abe)!
32
+ [ShakaCode](https://www.shakacode.com) focuses on helping Ruby on Rails teams use React and Webpack better. We can upgrade your project and improve your development and customer experiences, allowing you to focus on building new features or fixing bugs instead.
33
33
 
34
- Here's a testimonial of how ShakaCode can help, from [Florian Gößler](https://github.com/FGoessler) of [Blinkist](https://www.blinkist.com/), January 2, 2023:
34
+ For an overview of working with us, see our [Client Engagement Model](https://www.shakacode.com/blog/client-engagement-model/) article and [how we bill for time](https://www.shakacode.com/blog/shortcut-jira-trello-github-toggl-time-and-task-tracking/).
35
+
36
+ We also specialize in helping development teams lower infrastructure and CI costs. Check out our project [Control Plane Flow](https://github.com/shakacode/control-plane-flow/), which can allow you to get the ease of Heroku with the power of Kubernetes and big cost savings.
37
+
38
+ If you think ShakaCode can help your project, [click here](https://meetings.hubspot.com/justingordon/30-minute-consultation) to book a call with [Justin Gordon](mailto:justin@shakacode.com), the creator of React on Rails and Shakapacker.
39
+
40
+ Here's a testimonial of how ShakaCode can help from [Florian Gößler](https://github.com/FGoessler) of [Blinkist](https://www.blinkist.com/), January 2, 2023:
35
41
  > Hey Justin 👋
36
42
  >
37
43
  > I just wanted to let you know that we today shipped the webpacker to shakapacker upgrades and it all seems to be running smoothly! Thanks again for all your support and your teams work! 😍
@@ -40,7 +46,7 @@ Here's a testimonial of how ShakaCode can help, from [Florian Gößler](https://
40
46
  >
41
47
  > Have a great 2023 and maybe we get to work together again later in the year! 🙌
42
48
 
43
- Read the [full review here](https://clutch.co/profile/shakacode#reviews?sort_by=date_DESC#review-2118154). Here's [another review of a Shakapacker migration that led to more work](https://clutch.co/profile/shakacode#reviews?sort_by=date_DESC#review-2096078).
49
+ Read the [full review here](https://clutch.co/profile/shakacode#reviews?sort_by=date_DESC#review-2118154).
44
50
 
45
51
  ---
46
52
 
@@ -985,7 +991,7 @@ The following companies support our Open Source projects, and ShakaCode uses the
985
991
  <img alt="ScoutAPM" src="https://user-images.githubusercontent.com/4244251/184881152-9f2d8fba-88ac-4ba6-873b-22387f8711c5.png" height="120px">
986
992
  </picture>
987
993
  </a>
988
- <a href="https://controlplane.com">
994
+ <a href="https://shakacode.controlplane.com">
989
995
  <picture>
990
996
  <img alt="Control Plane" src="https://github.com/shakacode/.github/assets/20628911/90babd87-62c4-4de3-baa4-3d78ef4bec25" height="120px">
991
997
  </picture>
data/docs/v8_upgrade.md CHANGED
@@ -7,9 +7,55 @@ manager is used to manage JavaScript dependencies.
7
7
  Support for Ruby 2.6 and Node v12 has also been dropped since they're very old
8
8
  at this point.
9
9
 
10
+ ## CDN host is stripped from the manifest output
11
+
12
+ In Webpacker v5, the manifest.json file did not include the CDN asset host if defined. THis has been added in the aborted v6 and we've retained this in Shakapacker.
13
+
14
+ Presence of this host in the output could lead to unexpected issues and required [some workarounds](https://github.com/shakacode/shakapacker/blob/main/docs/troubleshooting.md#wrong-cdn-src-from-javascript_pack_tag) in certain cases.
15
+
16
+ If you are not using CDN, then this change will have no effect on your setup.
17
+
18
+ If you are using CDN and your CDN host is static, `config.asset_host` setting in Rails will be respected during compilation and when referencing assets through view helpers.
19
+
20
+ If your host might differ, between various environments for example, you will either need to:
21
+ - Ensure the assets are specifically rebuilt for each environment (Heroku pipeline promote feature for example does not do that by default).
22
+ - Make sure the assets are compiled with `SHAKAPACKER_ASSET_HOST=''` ENV variable to avoid hardcording URLs in packs output.
23
+
24
+ Second option has got a certain gotcha - dynamic imports and static asset references (like image paths in CSS) will end up without host reference and the app will try and fetch them from your app host rather than defined `config.asset_host`.
25
+
26
+ Make sure the assets are compiled with `SHAKAPACKER_ASSET_HOST=''` ENV variable to avoid hardcoding URLs in packs output.
27
+
28
+ To get around that, you can use dynamic override as outlined by [Webpack documentation](https://webpack.js.org/guides/asset-modules/#on-the-fly-override).
29
+
30
+ Setting for example:
31
+
32
+ ```
33
+ __webpack_public_path__ = 'https://mycdn.url.com/packs';
34
+ ```
35
+
36
+ In your code and ensuring it is run first in the app, will allow the dynamic imports lookup path to be overriden at runtime.
37
+
38
+ You can also try Webpack `output.publicPath` option of `'auto'` as per https://webpack.js.org/guides/public-path/#automatic-publicpath.
39
+
40
+ For example in your `webpack.config.js`:
41
+
42
+ ```
43
+ const { generateWebpackConfig } = require('shakapacker')
44
+
45
+ const customConfig = {
46
+ output: {
47
+ publicPath: 'auto'
48
+ }
49
+ };
50
+
51
+ module.exports = generateWebpackConfig(customConfig);
52
+ ```
53
+
54
+ This will work in number of environments although some older browsers like IE will require a polyfill as mentioned in the Webpack documentation linked above.
55
+
10
56
  ## The `packageManager` property in `package.json` is used to determine the package manager
11
57
 
12
- The biggest functional change in v8, `shakapacker` is now able to work with any
58
+ The biggest functional change in v8, `shakapacker` can now work with any
13
59
  of the major JavaScript package managers thanks to the
14
60
  [`package_json`](https://github.com/shakacode/package_json) gem which uses the
15
61
  [`packageManager`](https://nodejs.org/api/packages.html#packagemanager) property
@@ -61,7 +61,7 @@ class Shakapacker::Commands
61
61
 
62
62
  packs = all_files - manifest_config - current_version
63
63
  packs.reject { |file| File.directory?(file) }.group_by do |path|
64
- base, _, ext = File.basename(path).scan(/(.*)(-[\da-f]+)(\.\w+)/).flatten
64
+ base, _, ext = File.basename(path).scan(/(.*)(-[\da-f]+)([.\w]+)/).flatten
65
65
  "#{File.dirname(path)}/#{base}#{ext}"
66
66
  end.values
67
67
  end
@@ -1,4 +1,4 @@
1
1
  module Shakapacker
2
2
  # Change the version in package.json too, please!
3
- VERSION = "8.0.0.rc.2".freeze
3
+ VERSION = "8.0.0.rc.4".freeze
4
4
  end
@@ -207,8 +207,13 @@ module Shakapacker
207
207
  content = YAML.load_file(@pnpm_lock)
208
208
 
209
209
  content.fetch("packages", {}).each do |key, value|
210
+ # git-based constraints will include a "version" key with their pseudo semantic version
211
+ return value["version"] if key.start_with?("shakapacker") && value.key?("version")
210
212
  return value["version"] if value["name"] == "shakapacker"
211
213
 
214
+ # v9+ uses the same key format just without the leading slash, so we just add one in
215
+ key = "/#{key}" unless key.start_with?("/")
216
+
212
217
  parts = key.split("/")
213
218
 
214
219
  return parts[2] if parts[1] == "shakapacker"
@@ -80,7 +80,7 @@ const getPlugins = () => {
80
80
  writeToDisk: true,
81
81
  output: config.manifestPath,
82
82
  entrypointsUseAssets: true,
83
- publicPath: true
83
+ publicPath: config.publicPathWithoutCDN
84
84
  })
85
85
  ]
86
86
 
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shakapacker",
3
- "version": "8.0.0-rc.2",
3
+ "version": "8.0.0-rc.4",
4
4
  "description": "Use webpack to manage app-like JavaScript modules in Rails",
5
5
  "homepage": "https://github.com/shakacode/shakapacker",
6
6
  "bugs": {
data/spec/dummy/yarn.lock CHANGED
@@ -4060,7 +4060,7 @@ setprototypeof@1.2.0:
4060
4060
  integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==
4061
4061
 
4062
4062
  "shakapacker@file:.yalc/shakapacker":
4063
- version "7.2.3"
4063
+ version "8.0.0-rc.2"
4064
4064
  dependencies:
4065
4065
  js-yaml "^4.1.0"
4066
4066
  path-complete-extname "^1.0.0"