shakapacker 8.4.0 → 9.0.0

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.
Files changed (166) hide show
  1. checksums.yaml +4 -4
  2. data/.eslintignore +1 -0
  3. data/.eslintrc.fast.js +40 -0
  4. data/.eslintrc.js +48 -0
  5. data/.github/STATUS.md +1 -0
  6. data/.github/workflows/claude-code-review.yml +54 -0
  7. data/.github/workflows/claude.yml +50 -0
  8. data/.github/workflows/dummy.yml +8 -4
  9. data/.github/workflows/generator.yml +17 -14
  10. data/.github/workflows/node.yml +23 -1
  11. data/.github/workflows/ruby.yml +11 -0
  12. data/.github/workflows/test-bundlers.yml +170 -0
  13. data/.gitignore +17 -0
  14. data/.husky/pre-commit +2 -0
  15. data/.npmignore +56 -0
  16. data/.prettierignore +3 -0
  17. data/.rubocop.yml +1 -0
  18. data/.yalcignore +26 -0
  19. data/CHANGELOG.md +156 -18
  20. data/CLAUDE.md +29 -0
  21. data/CONTRIBUTING.md +138 -20
  22. data/Gemfile.lock +3 -3
  23. data/README.md +130 -5
  24. data/Rakefile +39 -4
  25. data/TODO.md +50 -0
  26. data/TODO_v9.md +87 -0
  27. data/conductor-setup.sh +70 -0
  28. data/conductor.json +7 -0
  29. data/docs/cdn_setup.md +379 -0
  30. data/docs/css-modules-export-mode.md +512 -0
  31. data/docs/deployment.md +10 -1
  32. data/docs/optional-peer-dependencies.md +198 -0
  33. data/docs/peer-dependencies.md +60 -0
  34. data/docs/rspack.md +190 -0
  35. data/docs/rspack_migration_guide.md +202 -0
  36. data/docs/transpiler-migration.md +188 -0
  37. data/docs/transpiler-performance.md +179 -0
  38. data/docs/troubleshooting.md +5 -0
  39. data/docs/typescript-migration.md +378 -0
  40. data/docs/typescript.md +99 -0
  41. data/docs/using_esbuild_loader.md +3 -3
  42. data/docs/using_swc_loader.md +5 -3
  43. data/docs/v6_upgrade.md +10 -0
  44. data/docs/v9_upgrade.md +413 -0
  45. data/lib/install/bin/shakapacker +3 -5
  46. data/lib/install/config/rspack/rspack.config.js +6 -0
  47. data/lib/install/config/rspack/rspack.config.ts +7 -0
  48. data/lib/install/config/shakapacker.yml +12 -2
  49. data/lib/install/config/webpack/webpack.config.ts +7 -0
  50. data/lib/install/package.json +38 -0
  51. data/lib/install/template.rb +194 -44
  52. data/lib/shakapacker/configuration.rb +141 -0
  53. data/lib/shakapacker/dev_server_runner.rb +25 -5
  54. data/lib/shakapacker/doctor.rb +844 -0
  55. data/lib/shakapacker/manifest.rb +4 -2
  56. data/lib/shakapacker/rspack_runner.rb +19 -0
  57. data/lib/shakapacker/runner.rb +144 -4
  58. data/lib/shakapacker/swc_migrator.rb +376 -0
  59. data/lib/shakapacker/utils/manager.rb +2 -0
  60. data/lib/shakapacker/version.rb +1 -1
  61. data/lib/shakapacker/version_checker.rb +1 -1
  62. data/lib/shakapacker/webpack_runner.rb +4 -42
  63. data/lib/shakapacker.rb +2 -1
  64. data/lib/tasks/shakapacker/doctor.rake +8 -0
  65. data/lib/tasks/shakapacker/install.rake +12 -2
  66. data/lib/tasks/shakapacker/migrate_to_swc.rake +13 -0
  67. data/lib/tasks/shakapacker.rake +1 -0
  68. data/package/.npmignore +4 -0
  69. data/package/babel/preset.ts +56 -0
  70. data/package/config.ts +175 -0
  71. data/package/{dev_server.js → dev_server.ts} +8 -5
  72. data/package/env.ts +92 -0
  73. data/package/environments/base.ts +138 -0
  74. data/package/environments/development.ts +90 -0
  75. data/package/environments/production.ts +80 -0
  76. data/package/environments/test.ts +53 -0
  77. data/package/environments/types.ts +90 -0
  78. data/package/esbuild/index.ts +42 -0
  79. data/package/index.d.ts +3 -97
  80. data/package/index.ts +52 -0
  81. data/package/loaders.d.ts +28 -0
  82. data/package/optimization/rspack.ts +36 -0
  83. data/package/optimization/webpack.ts +57 -0
  84. data/package/plugins/rspack.ts +103 -0
  85. data/package/plugins/webpack.ts +62 -0
  86. data/package/rspack/index.ts +64 -0
  87. data/package/rules/{babel.js → babel.ts} +2 -2
  88. data/package/rules/{coffee.js → coffee.ts} +1 -1
  89. data/package/rules/css.ts +3 -0
  90. data/package/rules/{erb.js → erb.ts} +1 -1
  91. data/package/rules/esbuild.ts +10 -0
  92. data/package/rules/file.ts +40 -0
  93. data/package/rules/{jscommon.js → jscommon.ts} +4 -4
  94. data/package/rules/{less.js → less.ts} +4 -4
  95. data/package/rules/raw.ts +25 -0
  96. data/package/rules/rspack.ts +176 -0
  97. data/package/rules/{sass.js → sass.ts} +7 -3
  98. data/package/rules/{stylus.js → stylus.ts} +4 -8
  99. data/package/rules/swc.ts +10 -0
  100. data/package/rules/{index.js → webpack.ts} +1 -1
  101. data/package/swc/index.ts +54 -0
  102. data/package/types/README.md +87 -0
  103. data/package/types/index.ts +60 -0
  104. data/package/types.ts +108 -0
  105. data/package/utils/configPath.ts +6 -0
  106. data/package/utils/debug.ts +49 -0
  107. data/package/utils/defaultConfigPath.ts +4 -0
  108. data/package/utils/errorCodes.ts +219 -0
  109. data/package/utils/errorHelpers.ts +143 -0
  110. data/package/utils/getStyleRule.ts +64 -0
  111. data/package/utils/helpers.ts +85 -0
  112. data/package/utils/{inliningCss.js → inliningCss.ts} +3 -3
  113. data/package/utils/pathValidation.ts +139 -0
  114. data/package/utils/requireOrError.ts +15 -0
  115. data/package/utils/snakeToCamelCase.ts +5 -0
  116. data/package/utils/typeGuards.ts +342 -0
  117. data/package/utils/validateDependencies.ts +61 -0
  118. data/package/webpack-types.d.ts +33 -0
  119. data/package/webpackDevServerConfig.ts +117 -0
  120. data/package.json +134 -9
  121. data/scripts/remove-use-strict.js +45 -0
  122. data/scripts/type-check-no-emit.js +27 -0
  123. data/test/package/config.test.js +3 -0
  124. data/test/package/env.test.js +42 -7
  125. data/test/package/environments/base.test.js +5 -1
  126. data/test/package/rules/babel.test.js +16 -0
  127. data/test/package/rules/esbuild.test.js +1 -1
  128. data/test/package/rules/raw.test.js +40 -7
  129. data/test/package/rules/swc.test.js +1 -1
  130. data/test/package/rules/webpack.test.js +35 -0
  131. data/test/package/staging.test.js +4 -3
  132. data/test/package/transpiler-defaults.test.js +127 -0
  133. data/test/peer-dependencies.sh +85 -0
  134. data/test/scripts/remove-use-strict.test.js +125 -0
  135. data/test/typescript/build.test.js +118 -0
  136. data/test/typescript/environments.test.js +107 -0
  137. data/test/typescript/pathValidation.test.js +142 -0
  138. data/test/typescript/securityValidation.test.js +182 -0
  139. data/tools/README.md +124 -0
  140. data/tools/css-modules-v9-codemod.js +179 -0
  141. data/tsconfig.eslint.json +16 -0
  142. data/tsconfig.json +38 -0
  143. data/yarn.lock +2704 -767
  144. metadata +111 -41
  145. data/package/babel/preset.js +0 -48
  146. data/package/config.js +0 -56
  147. data/package/env.js +0 -48
  148. data/package/environments/base.js +0 -171
  149. data/package/environments/development.js +0 -13
  150. data/package/environments/production.js +0 -88
  151. data/package/environments/test.js +0 -3
  152. data/package/esbuild/index.js +0 -40
  153. data/package/index.js +0 -40
  154. data/package/rules/css.js +0 -3
  155. data/package/rules/esbuild.js +0 -10
  156. data/package/rules/file.js +0 -29
  157. data/package/rules/raw.js +0 -5
  158. data/package/rules/swc.js +0 -10
  159. data/package/swc/index.js +0 -50
  160. data/package/utils/configPath.js +0 -4
  161. data/package/utils/defaultConfigPath.js +0 -2
  162. data/package/utils/getStyleRule.js +0 -40
  163. data/package/utils/helpers.js +0 -62
  164. data/package/utils/snakeToCamelCase.js +0 -5
  165. data/package/webpackDevServerConfig.js +0 -71
  166. data/test/package/rules/index.test.js +0 -16
data/CHANGELOG.md CHANGED
@@ -1,27 +1,95 @@
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
- * Please see the [v8 Upgrade Guide](./docs/v8_upgrade.md) for upgrading to version 8 and accounting for breaking changes.
3
- * Please see the [v7 Upgrade Guide](./docs/v7_upgrade.md) for upgrading to new spelling in version 7.
4
- * Please see the [v6 Upgrade Guide](./docs/v6_upgrade.md) to go from versions prior to v6.
5
- * [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).
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
+ - **Please see the [v9 Upgrade Guide](./docs/v9_upgrade.md) for upgrading to version 9 and accounting for breaking changes.**
3
+ - Please see the [v8 Upgrade Guide](./docs/v8_upgrade.md) for upgrading to version 8 and accounting for breaking changes.
4
+ - Please see the [v7 Upgrade Guide](./docs/v7_upgrade.md) for upgrading to new spelling in version 7.
5
+ - Please see the [v6 Upgrade Guide](./docs/v6_upgrade.md) to go from versions prior to v6.
6
+ - [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).
6
7
 
7
8
  # Versions
9
+
8
10
  ## [Unreleased]
11
+
9
12
  Changes since the last non-beta release.
10
13
 
11
- ## [v8.4.0] - September 8, 2025
14
+ ### Fixed
15
+
16
+ - Fixed NODE_ENV defaulting to production breaking dev server ([Issue 631](https://github.com/shakacode/shakapacker/issues/631)). NODE_ENV now defaults to development unless RAILS_ENV is explicitly set to production. This ensures the dev server works out of the box without requiring NODE_ENV to be set, and fixes incorrect port and 404 asset errors.
17
+
18
+ ## [v9.0.0-beta.8] - October 3, 2025
19
+
20
+ See the [v9 Upgrade Guide](https://github.com/shakacode/shakapacker/blob/main/docs/v9_upgrade.md) for detailed migration instructions.
21
+
22
+ ### ⚠️ Breaking Changes
23
+
24
+ 1. **SWC is now the default JavaScript transpiler instead of Babel** ([PR 603](https://github.com/shakacode/shakapacker/pull/603) by [justin808](https://github.com/justin808))
25
+
26
+ - Babel dependencies are no longer included as peer dependencies
27
+ - Improves compilation speed by 20x
28
+ - **Migration for existing projects:**
29
+ - **Option 1 (Recommended):** Switch to SWC - Run `rake shakapacker:migrate:to_swc` or manually:
30
+ ```yaml
31
+ # config/shakapacker.yml
32
+ javascript_transpiler: "swc"
33
+ ```
34
+ Then install: `npm install @swc/core swc-loader`
35
+ - **Option 2:** Keep using Babel:
36
+ ```yaml
37
+ # config/shakapacker.yml
38
+ javascript_transpiler: "babel"
39
+ ```
40
+
41
+ 2. **CSS Modules now use named exports by default**
42
+
43
+ - **JavaScript:** Use named imports: `import { className } from './styles.module.css'`
44
+ - **TypeScript:** Use namespace imports: `import * as styles from './styles.module.css'`
45
+ - To keep the old behavior with default imports, see [CSS Modules Export Mode documentation](./docs/css-modules-export-mode.md) for configuration instructions
46
+
47
+ 3. **Configuration option renamed from `webpack_loader` to `javascript_transpiler`**
48
+ - Better reflects its purpose of configuring JavaScript transpilation
49
+ - Old `webpack_loader` option deprecated but still supported with warning
12
50
 
13
51
  ### Added
14
52
 
15
- - Support for subresource integrity. [PR 570](https://github.com/shakacode/shakapacker/pull/570) by [panagiotisplytas](https://github.com/panagiotisplytas)
53
+ - **Rspack support** as an alternative assets bundler to webpack
54
+ - Configure `assets_bundler: 'rspack'` in `shakapacker.yml`
55
+ - Faster Rust-based bundling with webpack-compatible APIs
56
+ - Built-in SWC loader and CSS extraction
57
+ - Automatic bundler detection in `bin/shakapacker`
58
+ - **TypeScript type definitions** for improved IDE support and autocomplete
59
+ - Types available via `import type { WebpackConfig, RspackConfig, EnvironmentConfig } from "shakapacker/types"`
60
+ - See [TypeScript Documentation](./docs/typescript.md) for migration and usage instructions
61
+ - **Optional peer dependencies** - All peer dependencies now marked as optional, preventing installation warnings while maintaining version compatibility tracking
62
+ - **Private output path** for server-side rendering bundles ([PR 592](https://github.com/shakacode/shakapacker/pull/592))
63
+ - Configure `private_output_path` for private server bundles separate from public assets
64
+ - **`rake shakapacker:doctor` diagnostic command** to check for configuration issues and missing dependencies
65
+ - **`rake shakapacker:migrate:to_swc`** migration helper to assist with switching from Babel to SWC
66
+
67
+ ### Security
68
+
69
+ - **Path Validation Utilities** ([PR 614](https://github.com/shakacode/shakapacker/pull/614) by [justin808](https://github.com/justin808))
70
+ - Added validation to prevent directory traversal attacks
71
+ - Implemented environment variable sanitization to prevent injection
72
+ - Enforced strict port validation (reject strings with non-digits)
73
+ - Added SHAKAPACKER_NPM_PACKAGE path validation (only .tgz/.tar.gz allowed)
74
+ - Path traversal security checks now run regardless of validation mode
75
+
76
+ ### Fixed
77
+
78
+ - Fixed private_output_path configuration edge cases ([PR 604](https://github.com/shakacode/shakapacker/pull/604))
79
+ - Updated webpack-dev-server to secure versions (^4.15.2 || ^5.2.2) ([PR 585](https://github.com/shakacode/shakapacker/pull/585))
80
+
81
+ ## [v8.4.0] - September 8, 2024
82
+
83
+ ### Added
84
+
85
+ - Support for subresource integrity. [PR 570](https://github.com/shakacode/shakapacker/pull/570) by [panagiotisplytas](https://github.com/panagiotisplytas).
16
86
 
17
87
  ### Fixed
18
88
 
19
89
  - Install the latest major version of peer dependencies [PR 576](https://github.com/shakacode/shakapacker/pull/576) by [G-Rath](https://github.com/g-rath).
20
- - Remove duplicate word in comment from generated `shakapacker.yml` config [PR 572](https://github.com/shakacode/shakapacker/pull/572) by [G-Rath](https://github.com/g-rath).
21
- - fix: update webpack-dev-server to secure versions (^4.15.2 || ^5.2.2) [PR 585](https://github.com/shakacode/shakapacker/pull/585) by [justin808](https://github.com/justin808)
22
90
 
91
+ ## [v8.3.0] - April 28, 2024
23
92
 
24
- ## [v8.3.0] - April 25, 2025
25
93
  ### Added
26
94
 
27
95
  - Allow `webpack-assets-manifest` v6. [PR 562](https://github.com/shakacode/shakapacker/pull/562) by [tagliala](https://github.com/tagliala), [shoeyn](https://github.com/shoeyn).
@@ -36,6 +104,7 @@ Changes since the last non-beta release.
36
104
  - More precise types for `devServer` and `rules` in the configuration. [PR 555](https://github.com/shakacode/shakapacker/pull/555) by [alexeyr-ci2](https://github.com/alexeyr-ci2).
37
105
 
38
106
  ## [v8.2.0] - March 12, 2025
107
+
39
108
  ### Added
40
109
 
41
110
  - Support for `async` attribute in `javascript_pack_tag`, `append_javascript_pack_tag`, and `prepend_javascript_pack_tag`. [PR 554](https://github.com/shakacode/shakapacker/pull/554) by [AbanoubGhadban](https://github.com/abanoubghadban).
@@ -48,21 +117,25 @@ Changes since the last non-beta release.
48
117
  - Allow `webpack-cli` v6. [PR 533](https://github.com/shakacode/shakapacker/pull/533) by [tagliala](https://github.com/tagliala).
49
118
 
50
119
  ### Changed
120
+
51
121
  - Changed internal `require`s to `require_relative` to make code less dependent on the load path. [PR 516](https://github.com/shakacode/shakapacker/pull/516) by [tagliala](https://github.com/tagliala).
52
122
  - Allow configuring webpack from a Typescript file (`config/webpack/webpack.config.ts`). [PR 524](https://github.com/shakacode/shakapacker/pull/524) by [jdelStrother](https://github.com/jdelStrother).
53
123
 
54
124
  ### Fixed
125
+
55
126
  - Fix error when rails environment is required from outside the rails root directory [PR 520](https://github.com/shakacode/shakapacker/pull/520)
56
127
 
57
128
  ## [v8.0.2] - August 28, 2024
58
129
 
59
130
  ### Fixed
131
+
60
132
  - Fix wrong instruction in esbuild loader documentation [PR 504](https://github.com/shakacode/shakapacker/pull/504) by [adriangohjw](https://github.com/adriangohjw).
61
133
  - Add logic to sass rule conditional on sass-loader version [PR 508](https://github.com/shakacode/shakapacker/pull/508) by [Judahmeek](https://github.com/Judahmeek).
62
134
 
63
135
  ## [v8.0.1] - July 10, 2024
64
136
 
65
137
  ### Changed
138
+
66
139
  - Update outdated GitHub Actions to use Node.js 20.0 versions instead [PR 497](https://github.com/shakacode/shakapacker/pull/497) by [adriangohjw](https://github.com/adriangohjw).
67
140
  - Allow `webpack-merge` v6 to be used [PR 502](https://github.com/shakacode/shakapacker/pull/502) by [G-Rath](https://github.com/g-rath).
68
141
 
@@ -123,71 +196,89 @@ See the [v8 Upgrade Guide](https://github.com/shakacode/shakapacker/blob/main/do
123
196
 
124
197
  - Remove `isArray` utility (just use `Array.isArray` directly) and renamed a few files [PR 454](https://github.com/shakacode/shakapacker/pull/454) by [G-Rath](https://github.com/g-rath).
125
198
 
126
- - Make JavaScript test helper utilities internal (`chdirTestApp`, `chdirCwd`, `resetEnv`) [PR 458](https://github.com/shakacode/shakapacker/pull/458) by [G-Rath](https://github.com/g-rath).
199
+ - Make JavaScript test helper utilities internal (`chdirTestApp`, `chdirCwd`, `resetEnv`) [PR 458](https://github.com/shakacode/shakapacker/pull/458) by [G-Rath](https://github.com/g-rath).
127
200
 
128
201
  ## [v7.2.3] - March 23, 2024
129
202
 
130
203
  ### Added
204
+
131
205
  - Emit warnings instead of errors when compilation is success but stderr is not empty. [PR 416](https://github.com/shakacode/shakapacker/pull/416) by [n-rodriguez](https://github.com/n-rodriguez).
132
206
  - Allow `webpack-dev-server` v5. [PR 418](https://github.com/shakacode/shakapacker/pull/418) by [G-Rath](https://github.com/g-rath)
133
207
 
134
208
  ### Removed
209
+
135
210
  - Removes dependency on `glob` library. [PR 435](https://github.com/shakacode/shakapacker/pull/435) by [tomdracz](https://github.com/tomdracz).
136
211
 
137
212
  ### Fixed
213
+
138
214
  - Uses config file passed in `SHAKAPACKER_CONFIG` consistently.[PR 448](https://github.com/shakacode/shakapacker/pull/448) by [tomdracz](https://github.com/tomdracz).
139
215
 
140
- Previously this could have been ignored in few code branches, especially when checking for available environments.
216
+ Previously this could have been ignored in few code branches, especially when checking for available environments.
141
217
 
142
218
  ## [v7.2.2] - January 19, 2024
143
219
 
144
220
  ### Added
221
+
145
222
  - Allow `compression-webpack-plugin` v11. [PR 406](https://github.com/shakacode/shakapacker/pull/406) by [tagliala](https://github.com/tagliala).
146
223
 
147
224
  ## [v7.2.1] - December 30, 2023
148
225
 
149
226
  ### Fixed
227
+
150
228
  - Show deprecation message for `relative_url_root` only if it is set. [PR 400](https://github.com/shakacode/shakapacker/pull/400) by [ahangarha](https://github.com/ahangarha).
151
229
 
152
230
  ## [v7.2.0] - December 28, 2023
153
231
 
154
232
  ### Added
233
+
155
234
  - Experimental support for other JS package managers using `package_json` gem [PR 349](https://github.com/shakacode/shakapacker/pull/349) by [G-Rath](https://github.com/g-rath).
156
235
  - Support `hmr: only` configuration [PR 378](https://github.com/shakacode/shakapacker/pull/378) by [SimenB](https://github.com/SimenB).
157
236
  - Use `config/shakapacker.yml` as the secondary source for `asset_host` and `relative_url_root` configurations [PR 376](https://github.com/shakacode/shakapacker/pull/376) by [ahangarha](https://github.com/ahangarha).
158
237
 
159
238
  ### Fixed
239
+
160
240
  - Recommend `server` option instead of the deprecated `https` option when `--https` is provided [PR 380](https://github.com/shakacode/shakapacker/pull/380) by [G-Rath](https://github.com/g-rath)
161
241
  - Recompile assets on asset host change [PR 364](https://github.com/shakacode/shakapacker/pull/364) by [ahangarha](https://github.com/ahangarha).
162
242
  - Add deprecation warning for `https` option in `shakapacker.yml` (use `server: 'https'` instead) [PR 382](https://github.com/shakacode/shakapacker/pull/382) by [G-Rath](https://github.com/g-rath).
163
243
  - Disable Hot Module Replacement in `webpack-dev-server` when `hmr: false` [PR 392](https://github.com/shakacode/shakapacker/pull/392) by [thedanbob](https://github.com/thedanbob).
164
244
 
165
245
  ### Deprecated
246
+
166
247
  - The usage of `relative_url_root` is deprecated in Shakapacker and will be removed in v8. [PR 376](https://github.com/shakacode/shakapacker/pull/376) by [ahangarha](https://github.com/ahangarha).
167
248
 
168
249
  ## [v7.1.0] - September 30, 2023
169
250
 
170
251
  ### Added
252
+
171
253
  - Support passing custom webpack config directly to `generateWebpackConfig` for merging [PR 343](https://github.com/shakacode/shakapacker/pull/343) by [G-Rath](https://github.com/g-rath).
172
254
 
173
255
  ### Fixed
256
+
174
257
  - Use `NODE_OPTIONS` to enable Node-specific debugging flags [PR 350](https://github.com/shakacode/shakapacker/pull/350).
175
258
  - Add the boilerplate `application.js` into `packs/` [PR 363](https://github.com/shakacode/shakapacker/pull/363).
176
259
 
177
260
  ## [v7.0.3] - July 7, 2023
261
+
178
262
  ### Fixed
263
+
179
264
  - Fixed commands execution for projects with space in the absolute path [PR 322](https://github.com/shakacode/shakapacker/pull/322) by [kukicola](https://github.com/kukicola).
180
265
 
181
266
  ## [v7.0.2] - July 3, 2023
267
+
182
268
  ### Fixed
269
+
183
270
  - Fixed creation of assets:precompile if it is missing [PR 325](https://github.com/shakacode/shakapacker/pull/325) by [ahangarha](https://github.com/ahangarha).
184
271
 
185
272
  ## [v7.0.1] - June 27, 2023
273
+
186
274
  ### Fixed
275
+
187
276
  - Fixed the condition for showing warning for setting `useContentHash` to `false` in the production environment. [PR 320](https://github.com/shakacode/shakapacker/pull/320) by [ahangarha](https://github.com/ahangarha).
188
277
 
189
278
  ## [v7.0.0] - June 23, 2023
279
+
190
280
  ### Breaking changes
281
+
191
282
  - Removes defaults passed to `@babel/preset-typescript`. [PR 273](https://github.com/shakacode/shakapacker/pull/273) by [tomdracz](https://github.com/tomdracz).
192
283
 
193
284
  `@babel/preset-typescript` has been initialised in default configuration with `{ allExtensions: true, isTSX: true }` - meaning every file in the codebase was treated as TSX leading to potential issues. This has been removed and returns to sensible default of the preset which is to figure out the file type from the extensions. This change might affect generated output however so it is marked as breaking.
@@ -197,18 +288,21 @@ See the [v8 Upgrade Guide](https://github.com/shakacode/shakapacker/blob/main/do
197
288
  The `webpackConfig` property in the `shakapacker` module has been updated to be a function instead of a global mutable webpack configuration. This function now returns an immutable webpack configuration object, which ensures that any modifications made to it will not affect any other usage of the webpack configuration. If a project still requires the old mutable object, it can be accessed by replacing `webpackConfig` with `globalMutableWebpackConfig`. Check [v7-upgrade](https://github.com/shakacode/shakapacker/blob/main/docs/v7_upgrade.md) documentation for more detail.
198
289
 
199
290
  ### Added
291
+
200
292
  - Set CSS modules mode depending on file type. [PR 261](https://github.com/shakacode/shakapacker/pull/261) by [talyuk](https://github.com/talyuk).
201
293
  - All standard webpack entries with the camelCase format are now supported in `shakapacker.yml` in snake_case format. [PR276](https://github.com/shakacode/shakapacker/pull/276) by [ahangarha](https://github.com/ahangarha).
202
294
  - The `shakapacker:install` rake task now has an option to force overriding files using `FORCE=true` environment variable [PR311](https://github.com/shakacode/shakapacker/pull/311) by [ahangarha](https://github.com/ahangarha).
203
295
  - Allow configuration of use of contentHash for specific environment [PR 234](https://github.com/shakacode/shakapacker/pull/234) by [justin808](https://github/justin808).
204
296
 
205
297
  ### Changed
298
+
206
299
  - Rename Webpacker to Shakapacker in the entire project including config files, binstubs, environment variables, etc. with a high degree of backward compatibility.
207
300
 
208
301
  This change might be breaking for certain setups and edge cases. More information: [v7 Upgrade Guide](./docs/v7_upgrade.md) [PR157](https://github.com/shakacode/shakapacker/pull/157) by [ahangarha](https://github.com/ahangarha)
209
302
 
210
303
  - Set `source_entry_path` to `packs` and `nested_entries` to `true` in`shakapacker.yml` [PR 284](https://github.com/shakacode/shakapacker/pull/284) by [ahangarha](https://github.com/ahangarha).
211
304
  - Dev server configuration is modified to follow [webpack recommended configurations](https://webpack.js.org/configuration/dev-server/) for dev server. [PR276](https://github.com/shakacode/shakapacker/pull/276) by [ahangarha](https://github.com/ahangarha):
305
+
212
306
  - Deprecated `https` entry is removed from the default configuration file, allowing to set `server` or `https` as per the project requirements. For more detail, check webpack documentation. The `https` entry can be effective only if there is no `server` entry in the config file.
213
307
  - `allowed_hosts` is now set to `auto` instead of `all` by default.
214
308
 
@@ -219,6 +313,7 @@ See the [v8 Upgrade Guide](https://github.com/shakacode/shakapacker/blob/main/do
219
313
  Going forward, the top level directory of static files will be retained so this will necessitate the update of file name references in asset helpers. In the example above, the file sourced from `app/javascript/images/image.png` will be now output to `static/images/image.png` and needs to be referenced as `image_pack_tag("images/image.jpg")` or `image_pack_tag("static/images/image.jpg")`.
220
314
 
221
315
  ### Fixed
316
+
222
317
  - Move compilation lock file into the working directory. [PR 272](https://github.com/shakacode/shakapacker/pull/272) by [tomdracz](https://github.com/tomdracz).
223
318
  - Process `source_entry_path` with values starting with `/` as a relative path to `source_path` [PR 284](https://github.com/shakacode/shakapacker/pull/284) by [ahangarha](https://github.com/ahangarha).
224
319
  - Removes defaults passed to `@babel/preset-typescript` to make it possible to have projects with mix of JS and TS code [PR 273](https://github.com/shakacode/shakapacker/pull/273) by [tomdracz](https://github.com/tomdracz).
@@ -227,16 +322,22 @@ See the [v8 Upgrade Guide](https://github.com/shakacode/shakapacker/blob/main/do
227
322
 
228
323
  - Fixed RC version detection during installation. [PR312](https://github.com/shakacode/shakapacker/pull/312) by [ahangarha](https://github.com/ahangarha)
229
324
  - Fix addition of webpack-dev-server to devDependencies during installation. [PR310](https://github.com/shakacode/shakapacker/pull/310) by [ahangarha](https://github.com/ahangarha)
325
+
230
326
  ### Removed
327
+
231
328
  - Remove redundant enhancement for precompile task to run `yarn install` [PR 270](https://github.com/shakacode/shakapacker/pull/270) by [ahangarha](https://github.com/ahangarha).
232
329
  - Remove deprecated `check_yarn_integrity` from `Shakapacker::Configuration` [PR SP288](https://github.com/shakacode/shakapacker/pull/288) by [ahangarha](https://github.com/ahangarha).
233
330
 
234
331
  ## [v6.6.0] - March 7, 2023
332
+
235
333
  ### Improved
334
+
236
335
  - Allow configuration of webpacker.yml through env variable. [PR 254](https://github.com/shakacode/shakapacker/pull/254) by [alecslupu](https://github.com/alecslupu).
237
336
 
238
337
  ## [v6.5.6] - February 11, 2023
338
+
239
339
  ### Fixed
340
+
240
341
  - Fixed failing to update `bin/setup` file due to different formats of the file in different versions of Rails. [PR 229](https://github.com/shakacode/shakapacker/pull/229) by [ahangarha](https://github.com/ahangarha).
241
342
 
242
343
  - Upgrade several JS dependencies to fix security issues. [PR 243](https://github.com/shakacode/shakapacker/pull/243) by [ahangarha](https://github.com/ahangarha).
@@ -250,27 +351,33 @@ See the [v8 Upgrade Guide](https://github.com/shakacode/shakapacker/blob/main/do
250
351
  ## [v6.5.5] - December 28, 2022
251
352
 
252
353
  ### Improved
354
+
253
355
  - Describe keys different from `webpack-dev-server` in generated `webpacker.yml`. [PR 194](https://github.com/shakacode/shakapacker/pull/194) by [alexeyr](https://github.com/alexeyr).
254
356
  - Allow webpack-cli v5 [PR 216](https://github.com/shakacode/shakapacker/pull/216) by [tagliala](https://github.com/tagliala).
255
357
  - Allow babel-loader v9 [PR 215](https://github.com/shakacode/shakapacker/pull/215) by [tagliala](https://github.com/tagliala).
256
358
 
257
359
  ## [v6.5.4] - November 4, 2022
360
+
258
361
  ### Fixed
362
+
259
363
  - Fixed regression caused by 6.5.3. PR #192 introduce extra split() call. [PR 202](https://github.com/shakacode/shakapacker/pull/202) by [Eric-Guo](https://github.com/Eric-Guo).
260
364
 
261
365
  ## [v6.5.3] - November 1, 2022
262
366
 
263
367
  ### Improved
368
+
264
369
  - 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).
265
370
  - 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/).
266
- 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).
371
+ 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).
267
372
 
268
373
  ## [v6.5.2] - September 8, 2022
269
374
 
270
375
  ### Upgrade
376
+
271
377
  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).
272
378
 
273
379
  ### Fixed
380
+
274
381
  - 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).
275
382
 
276
383
  ```
@@ -280,23 +387,30 @@ ENV["NODE_ENV"] ||= (ENV["RAILS_ENV"] == "production") ? "production" : "develop
280
387
  ## [v6.5.1] - August 15, 2022
281
388
 
282
389
  ### Improved
390
+
283
391
  - 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).
284
392
 
285
393
  ### Fixed
394
+
286
395
  - `append_javascript_pack_tag` and `append_stylesheet_pack_tag` helpers return `nil` to prevent rendering the queue into view when using `<%= … %>` ERB syntax. [PR 167](https://github.com/shakacode/shakapacker/pull/167) by [ur5us](https://github.com/ur5us). While `<%=` should not be used, it's OK to return nil in case it's misused.
287
396
  - Fixed non-runnable test due to wrong code nesting. [PR 173](https://github.com/shakacode/shakapacker/pull/173) by [ur5us](https://github.com/ur5us).
288
397
  - Fixed default configurations not working for custom Rails environments [PR 168](https://github.com/shakacode/shakapacker/pull/168) by [ur5us](https://github.com/ur5us).
289
398
  - Added accessor method for `nested_entries` configuration. [PR 176](https://github.com/shakacode/shakapacker/pull/176) by [pulkitkkr](https://github.com/pulkitkkr).
290
399
 
291
400
  ## [v6.5.0] - July 4, 2022
401
+
292
402
  ### Added
403
+
293
404
  - `append_stylesheet_pack_tag` helper. It helps in configuring stylesheet pack names from the view for a route or partials. It is also required for filesystem-based automated Component Registry API on React on Rails gem. [PR 144](https://github.com/shakacode/shakapacker/pull/144) by [pulkitkkr](https://github.com/pulkitkkr).
294
405
 
295
406
  ### Improved
407
+
296
408
  - Make sure at most one compilation runs at a time [PR 139](https://github.com/shakacode/shakapacker/pull/139) by [artemave](https://github.com/artemave)
297
409
 
298
410
  ## [v6.4.1] - June 5, 2022
411
+
299
412
  ### Fixed
413
+
300
414
  - Restores automatic installation of yarn packages removed in [#131](https://github.com/shakacode/shakapacker/pull/131), with added deprecation notice. [PR 140](https://github.com/shakacode/shakapacker/pull/140) by [tomdracz](https://github.com/tomdracz).
301
415
 
302
416
  This will be again removed in Shakapacker v7 so you need to ensure you are installing yarn packages explicitly before the asset compilation, rather than relying on this behaviour through `asset:precompile` task (e.g. Capistrano deployment).
@@ -304,13 +418,17 @@ ENV["NODE_ENV"] ||= (ENV["RAILS_ENV"] == "production") ? "production" : "develop
304
418
  - Disable Spring being used by `rails-erb-loader`. [PR 141](https://github.com/shakacode/shakapacker/pull/141) by [tomdracz](https://github.com/tomdracz).
305
419
 
306
420
  ## [v6.4.0] - June 2, 2022
421
+
307
422
  ### Fixed
423
+
308
424
  - Fixed [Issue 123: Rails 7.0.3 - Webpacker configuration file not found when running rails webpacker:install (shakapacker v6.3)](https://github.com/shakacode/shakapacker/issues/123) in [PR 136: Don't enhance precompile if no config #136](https://github.com/shakacode/shakapacker/pull/136) by [justin808](https://github.com/justin808).
309
425
 
310
426
  ### Added
427
+
311
428
  - Configuration boolean option `nested_entries` to use nested entries. This was the default prior to v6.0. Because entries maybe generated, it's useful to allow a `generated` subdirectory. [PR 121](https://github.com/shakacode/shakapacker/pull/121) by [justin808](https://github.com/justin808).
312
429
 
313
430
  ### Improved
431
+
314
432
  - Allow v10 of `compression-webpack-plugin` as a peer dependency. [PR 117](https://github.com/shakacode/shakapacker/pull/117) by [aried3r](https://github.com/aried3r).
315
433
 
316
434
  - [Remove assets:precompile task enhancement #131](https://github.com/shakacode/shakapacker/pull/131) by [James Herdman](https://github.com/jherdman): Removed the `yarn:install` Rake task, and no longer enhance `assets:precompile` with said task. These tasks were used to ensure required NPM packages were installed before asset precompilation. Going forward you will need to ensure these packages are already installed yourself. Should you wish to restore this behaviour you'll need to [reimplement the task](https://github.com/shakacode/shakapacker/blob/bee661422f2c902aa8ac9cf8fa1f7ccb8142c914/lib/tasks/yarn.rake) in your own application.
@@ -318,9 +436,11 @@ ENV["NODE_ENV"] ||= (ENV["RAILS_ENV"] == "production") ? "production" : "develop
318
436
  ## [v6.3.0] - May 19, 2022
319
437
 
320
438
  ### Improved
439
+
321
440
  - Add ability to configure usage of either last modified timestamp and digest strategies when checking asset freshness. [PR 112](https://github.com/shakacode/shakapacker/pull/112) by [tomdracz](https://github.com/tomdracz).
322
441
 
323
442
  ### Fixed
443
+
324
444
  - On Windows CSS urls no longer contain backslashes resulting in 404 errors. [PR 115](https://github.com/shakacode/shakapacker/pull/115) by [daniel-rikowski](https://github.com/daniel-rikowski).
325
445
 
326
446
  ## [v6.3.0-rc.1] - April 24, 2022
@@ -328,6 +448,7 @@ ENV["NODE_ENV"] ||= (ENV["RAILS_ENV"] == "production") ? "production" : "develop
328
448
  Note: [Rubygem is 6.3.0.pre.rc.1](https://rubygems.org/gems/shakapacker/versions/6.3.0.pre.rc.1) and [NPM is 6.3.0-rc.1](https://www.npmjs.com/package/shakapacker/v/6.3.0-rc.1).
329
449
 
330
450
  ### Changed
451
+
331
452
  - Remove Loose mode from the default @babel-preset/env configuration. [PR 107](https://github.com/shakacode/shakapacker/pull/107) by [Jeremy Liberman](https://github.com/MrLeebo).
332
453
 
333
454
  Loose mode compiles the bundle down to be compatible with ES5, but saves space by skipping over behaviors that are considered edge cases. Loose mode can affect how your code runs in a variety of ways, but in newer versions of Babel it's better to use [Compiler Assumptions](https://babeljs.io/docs/en/assumptions) to have finer-grained control over which edge cases you're choosing to ignore.
@@ -335,10 +456,12 @@ Note: [Rubygem is 6.3.0.pre.rc.1](https://rubygems.org/gems/shakapacker/versions
335
456
  This change may increase the file size of your bundles, and may change some behavior in your app if your code touches upon one of the edge cases where Loose mode differs from native JavaScript. There are notes in the linked PR about how to turn Loose mode back on if you need to, but consider migrating to Compiler Assumptions when you can. If you have already customized your babel config, this change probably won't affect you.
336
457
 
337
458
  ### Added
459
+
338
460
  - Adds `webpacker_precompile` setting to `webpacker.yml` to allow controlling precompile behaviour, similar to existing `ENV["WEBPACKER_PRECOMPILE"]` variable. [PR 102](https://github.com/shakacode/shakapacker/pull/102) by [Judahmeek](https://github.com/Judahmeek).
339
461
  - Adds `append_javascript_pack_tag` helper. Allows for easier usage and coordination of multiple javascript packs. [PR 94](https://github.com/shakacode/shakapacker/pull/94) by [tomdracz](https://github.com/tomdracz).
340
462
 
341
463
  ### Improved
464
+
342
465
  - Use last modified timestamps rather than file digest to determine compiler freshness. [PR 97](https://github.com/shakacode/shakapacker/pull/97) by [tomdracz](https://github.com/tomdracz).
343
466
 
344
467
  Rather than calculating SHA digest of all the files in the paths watched by the compiler, we are now comparing the modified time of the `manifest.json` file versus the latest modified timestamp of files and directories in watched paths. Unlike calculating digest, which only looked at the files, the new calculation also considers directory timestamps, including the parent ones (i.e. `config.source_path` folder timestamp will be checked together will timestamps of all files and directories inside of it).
@@ -349,18 +472,22 @@ Note: [Rubygem is 6.3.0.pre.rc.1](https://rubygems.org/gems/shakapacker/versions
349
472
  - Add `webpack-dev-server` as `peerDependency` to make its usage clear. [PR 109](https://github.com/shakacode/shakapacker/pull/109) by [tomdracz](https://github.com/tomdracz).
350
473
 
351
474
  ## [v6.2.1] - April 15, 2022
475
+
352
476
  ### Fixed
477
+
353
478
  - 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).
354
479
 
355
480
  ## [v6.2.0] - March 22, 2022
356
481
 
357
482
  ### Added
483
+
358
484
  - Make manifest_path configurable, to keep manifest.json private if desired. [PR 78](https://github.com/shakacode/shakapacker/pull/78) by [jdelStrother](https://github.com/jdelStrother).
359
485
  - Rewrite webpack module rules as regular expressions. Allows for easy iteration during config customization. [PR 60](https://github.com/shakacode/shakapacker/pull/60) by [blnoonan](https://github.com/blnoonan).
360
486
  - Initialization check to ensure shakapacker gem and NPM package version are consistent. Opt-in behaviour enabled by setting `ensure_consistent_versioning` configuration variable. [PR 51](https://github.com/shakacode/shakapacker/pull/51) by [tomdracz](https://github.com/tomdracz).
361
487
  - Add `dev_server.inline_css: bool` config option to allow for opting out of style-loader and into mini-css-extract-plugin for CSS HMR in development. [PR 69](https://github.com/shakacode/shakapacker/pull/69) by [cheald](https://github.com/cheald).
362
488
 
363
489
  ### Improved
490
+
364
491
  - Increase default connect timeout for dev server connections, establishing connections more reliably for busy machines. [PR 74](https://github.com/shakacode/shakapacker/pull/74) by [stevecrozz](https://github.com/stevecrozz).
365
492
  - Allow multiple invocations of stylesheet_pack_tag (eg for a regular stylesheet & a print stylesheet). [PR 82](https://github.com/shakacode/shakapacker/pull/82) by [jdelStrother](https://github.com/jdelStrother).
366
493
  - Tweak swc config for parity with Babel. [PR 79](https://github.com/shakacode/shakapacker/pull/79) by [dleavitt](https://github.com/dleavitt).
@@ -368,31 +495,39 @@ Note: [Rubygem is 6.3.0.pre.rc.1](https://rubygems.org/gems/shakapacker/versions
368
495
  ## [v6.1.1] - February 6, 2022
369
496
 
370
497
  ### Added
498
+
371
499
  - Support for esbuild-loader. [PR 53](https://github.com/shakacode/shakapacker/pull/53) by [tomdracz](https://github.com/tomdracz).
372
500
 
373
501
  ## [v6.1.0] - February 4, 2022
502
+
374
503
  ### Added
504
+
375
505
  - Support for SWC loader. [PR 29](https://github.com/shakacode/shakapacker/pull/29) by [tomdracz](https://github.com/tomdracz).
376
506
 
377
507
  ### Fixed
508
+
378
509
  - Static asset subdirectories are retained after compilation, matching Webpacker v5 behaviour. [PR 47](https://github.com/shakacode/shakapacker/pull/47) by [tomdracz](https://github.com/tomdracz). Fixes issues [rails/webpacker#2956](https://github.com/rails/webpacker/issues/2956) which broke in [rails/webpacker#2802](https://github.com/rails/webpacker/pull/2802).
379
510
 
380
511
  ## [v6.0.2] - January 25, 2022
512
+
381
513
  ### Improved
514
+
382
515
  - Fix incorrect command name in warning. [PR 33](https://github.com/shakacode/shakapacker/pull/33) by [tricknotes](https://github.com/tricknotes).
383
516
 
384
517
  ## [v6.0.1] - January 24, 2022
518
+
385
519
  ### Improved
520
+
386
521
  - PR #21 removed pnp-webpack-plugin as a dev dependency but did not remove it from the peer dependency list. [PR 30](https://github.com/shakacode/shakapacker/pull/30) by [t27duck](https://github.com/t27duck).
387
522
 
388
523
  ## [v6.0.0 changes from v6.0.0.rc.6] - January 22, 2022
389
524
 
390
525
  ### Improved
526
+
391
527
  - Raise on multiple invocations of javascript_pack_tag and stylesheet_pack_tag helpers. [PR 19](https://github.com/shakacode/shakapacker/pull/19) by [tomdracz](https://github.com/tomdracz).
392
528
  - Remove automatic addition of node_modules into rails asset load path. [PR 20](https://github.com/shakacode/shakapacker/pull/20) by [tomdracz](https://github.com/tomdracz).
393
529
  - Remove pnp-webpack-plugin. [PR 21](https://github.com/shakacode/shakapacker/pull/21) by [tomdracz](https://github.com/tomdracz).
394
530
 
395
-
396
531
  ### Merged from rails/webpacker
397
532
 
398
533
  - Make watched_files_digest thread safe. [rails/webpacker #3233](https://github.com/rails/webpacker/pull/3233)
@@ -400,18 +535,18 @@ Note: [Rubygem is 6.3.0.pre.rc.1](https://rubygems.org/gems/shakapacker/versions
400
535
  - Switch to peer dependencies. [rails/webpacker #3234](https://github.com/rails/webpacker/pull/3234)
401
536
 
402
537
  ### Upgrading from rails/webpacker 6.0.0.rc.6
538
+
403
539
  - Single default configuration file of `config/webpack/webpack.config.js`. Previously, the config file was set
404
540
  to `config/webpack/#{NODE_ENV}.js`.
405
541
  - Changed all package.json dependencies to peerDependencies, so upgrading requires adding the dependencies, per the [UPGRADE GUIDE](./docs/v6_upgrade.md).
406
542
 
407
543
  ## [v6.0.0.rc.6 changes from v5.4] - Forked January 16, 2022
408
544
 
409
-
410
545
  - `node_modules` will no longer be babel transformed compiled by default. This primarily fixes [rails issue #35501](https://github.com/rails/rails/issues/35501) as well as [numerous other webpacker issues](https://github.com/rails/webpacker/issues/2131#issuecomment-581618497). The disabled loader can still be required explicitly via:
411
546
 
412
547
  ```js
413
- const nodeModules = require('@rails/webpacker/rules/node_modules.js')
414
- environment.loaders.append('nodeModules', nodeModules)
548
+ const nodeModules = require("@rails/webpacker/rules/node_modules.js")
549
+ environment.loaders.append("nodeModules", nodeModules)
415
550
  ```
416
551
 
417
552
  - If you have added `environment.loaders.delete('nodeModules')` to your `environment.js`, this must be removed or you will receive an error (`Item nodeModules not found`).
@@ -424,15 +559,18 @@ Note: [Rubygem is 6.3.0.pre.rc.1](https://rubygems.org/gems/shakapacker/versions
424
559
  - Deprecated configuration option `watched_paths`. Use `additional_paths` instead in `webpacker.yml`.
425
560
 
426
561
  ### Breaking changes
562
+
427
563
  - Renamed `/bin/webpack` to `/bin/webpacker` and `/bin/webpack-dev-server` to `bin/webpacker-dev-server` to avoid confusion with underlying webpack executables.
428
564
  - Removed integration installers
429
565
  - Splitchunks enabled by default
430
566
  - CSS extraction enabled by default, except when devServer is configured and running
431
567
 
432
568
  ## v5.4.3 and prior changes from rails/webpacker
569
+
433
570
  See [CHANGELOG.md in rails/webpacker (up to v5.4.3)](https://github.com/rails/webpacker/blob/master/CHANGELOG.md)
434
571
 
435
- [Unreleased]: https://github.com/shakacode/shakapacker/compare/v8.4.0...main
572
+ [Unreleased]: https://github.com/shakacode/shakapacker/compare/v9.0.0-beta.8...main
573
+ [v9.0.0-beta.8]: https://github.com/shakacode/shakapacker/compare/v8.4.0...v9.0.0-beta.8
436
574
  [v8.4.0]: https://github.com/shakacode/shakapacker/compare/v8.3.0...v8.4.0
437
575
  [v8.3.0]: https://github.com/shakacode/shakapacker/compare/v8.2.0...v8.3.0
438
576
  [v8.2.0]: https://github.com/shakacode/shakapacker/compare/v8.1.0...v8.2.0
data/CLAUDE.md ADDED
@@ -0,0 +1,29 @@
1
+ # Shakapacker Project Guidelines
2
+
3
+ ## Critical Requirements
4
+ - **ALWAYS end all files with a trailing newline character.** This is required by the project's linting rules.
5
+ - **ALWAYS use `bundle exec` prefix when running Ruby commands** (rubocop, rspec, rake, etc.)
6
+ - **ALWAYS run `bundle exec rubocop` before committing Ruby changes**
7
+ - **ALWAYS run `yarn lint` before committing JavaScript changes**
8
+
9
+ ## Testing
10
+ - Run corresponding RSpec tests when changing source files
11
+ - For example, when changing `lib/shakapacker/foo.rb`, run `spec/shakapacker/foo_spec.rb`
12
+ - Run the full test suite with `bundle exec rspec` before pushing
13
+
14
+ ## Code Style
15
+ - Follow existing code conventions in the file you're editing
16
+ - Use the project's existing patterns and utilities
17
+ - No unnecessary comments unless requested
18
+ - Keep changes focused and minimal - avoid extraneous diffs
19
+
20
+ ## Git Workflow
21
+ - Create feature branches for all changes
22
+ - Never push directly to main branch
23
+ - Create small, focused PRs that are easy to review
24
+ - Always create a PR immediately after pushing changes
25
+
26
+ ## Shakapacker-Specific
27
+ - This gem supports both webpack and rspack configurations
28
+ - Test changes with both bundlers when modifying core functionality
29
+ - Be aware of the dual package.json/Gemfile dependency management