Commit 79a7efc
authored
Migrate to Shakapacker 9.0.0-beta.8 (#665)
Updates Shakapacker from 9.0.0-beta.7 to 9.0.0-beta.8 with minimal changes.
The primary fix addresses a breaking change in the webpack configuration
structure introduced in beta.8.
Key Changes:
- Updated Shakapacker to 9.0.0-beta.8 in Gemfile and package.json
- Fixed commonWebpackConfig.js to properly detect SCSS rules in the new
webpack config structure
- Added defensive edge case handling for missing SCSS rules
- Removed redundant null checks and added ESLint-compliant formatting
Technical Details:
Shakapacker beta.8 introduced a new webpack rule structure with a oneOf
pattern at index 0 that matches .scss files but lacks a use array. The
original code would find this incorrect rule and crash when attempting to
access the use property.
The fix modifies the SCSS rule finder to require both a test match AND a
use array, ensuring it finds the correct rule with configured loaders. An
additional safety check warns if no valid SCSS rule is found, preventing
runtime errors.
Breaking Changes:
None. This is a patch-level update with no API changes.
Impact:
- Existing installations: Update dependencies and rebuild assets
- New installations: No special considerations
- Build process remains identical
- All existing webpack configurations continue to work
Testing:
- Full test build passes (yarn build:test)
- RuboCop linting passes
- Production build verified
- No behavioral changes to asset pipeline
Related Issues:
Follow-up migrations planned in separate PRs:
- Issue #666: Migrate from Babel to SWC transpiler
- Issue #667: Migrate to TypeScript
- Issue #668: Migrate from Webpack to Rspack1 parent 8f7bb45 commit 79a7efc
File tree
5 files changed
+44
-40
lines changed- config/webpack
5 files changed
+44
-40
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
393 | | - | |
| 393 | + | |
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
| |||
499 | 499 | | |
500 | 500 | | |
501 | 501 | | |
502 | | - | |
| 502 | + | |
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
38 | 41 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
51 | 55 | | |
52 | | - | |
53 | 56 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
60 | 63 | | |
61 | | - | |
62 | | - | |
63 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
64 | 67 | | |
65 | | - | |
| 68 | + | |
| 69 | + | |
66 | 70 | | |
67 | 71 | | |
68 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8263 | 8263 | | |
8264 | 8264 | | |
8265 | 8265 | | |
8266 | | - | |
8267 | | - | |
8268 | | - | |
8269 | | - | |
| 8266 | + | |
| 8267 | + | |
| 8268 | + | |
| 8269 | + | |
8270 | 8270 | | |
8271 | 8271 | | |
8272 | 8272 | | |
| |||
0 commit comments