You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update CHANGELOG and migration guide for v9.1.0 release
- Change Unreleased section to v9.1.0 with October 8, 2025 date
- Add prominent warning about SWC loose mode breaking change
- Add dedicated section in v9 upgrade guide explaining the breaking change
- Link from CHANGELOG to migration guide for detailed instructions
- Clarify that most projects need no changes
- Explain impact on Stimulus users and spread operators
This ensures users upgrading from v9.0.0 to v9.1.0 are aware of the
breaking change and know how to handle it if needed.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+16-7Lines changed: 16 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,21 +11,30 @@
11
11
12
12
Changes since the last non-beta release.
13
13
14
+
_No unreleased changes._
15
+
16
+
## [v9.1.0] - October 8, 2025
17
+
18
+
**⚠️ IMPORTANT:** This release includes a breaking change for SWC users. Please see the [v9 Upgrade Guide - SWC Loose Mode Breaking Change](./docs/v9_upgrade.md#swc-loose-mode-breaking-change-v910) for migration details.
19
+
14
20
### ⚠️ Breaking Changes
15
21
16
-
-**SWC default configuration now uses `loose: false` for spec-compliant transforms** ([#657](https://github.com/shakacode/shakapacker/issues/657))
22
+
-**SWC default configuration now uses `loose: false` for spec-compliant transforms** ([#658](https://github.com/shakacode/shakapacker/pull/658))
17
23
- Previously, Shakapacker set `loose: true` by default in SWC configuration, which caused:
18
24
- Silent failures with Stimulus controllers
19
25
- Incorrect behavior with spread operators on iterables (e.g., `[...new Set()]`)
20
26
- Deviation from both SWC and Babel upstream defaults
21
27
- Now defaults to `loose: false`, matching SWC's default and fixing compatibility with Stimulus
22
28
- This aligns with the previous fix to Babel configuration in [PR #107](https://github.com/shakacode/shakapacker/pull/107)
23
-
-**Migration:** If you need the old behavior for performance reasons, add to `config/swc.config.js`:
29
+
-**Migration:** Most projects need no changes as the new default provides spec-compliant behavior. Projects with Stimulus will benefit from this fix. See [v9 Upgrade Guide - SWC Loose Mode](./docs/v9_upgrade.md#swc-loose-mode-breaking-change-v910) for details
30
+
- If you must restore the old behavior (not recommended), add to `config/swc.config.js`:
24
31
```javascript
25
32
module.exports= {
26
33
options: {
27
34
jsc: {
28
-
loose:true// Restore old behavior (not recommended)
35
+
// Only use this if you have code that requires loose transforms.
36
+
// This provides slightly faster build performance but may cause runtime bugs.
37
+
loose:true// Restore v9.0.0 behavior
29
38
}
30
39
}
31
40
}
@@ -47,16 +56,16 @@ Changes since the last non-beta release.
Copy file name to clipboardExpand all lines: docs/v9_upgrade.md
+45Lines changed: 45 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
This guide outlines new features, breaking changes, and migration steps for upgrading from Shakapacker v8 to v9.
4
4
5
+
> **⚠️ Important for v9.1.0 Users:** If you're upgrading to v9.1.0 or later, please note the [SWC Configuration Breaking Change](#swc-loose-mode-breaking-change-v910) below. This affects users who previously configured SWC in v9.0.0.
6
+
5
7
## New Features
6
8
7
9
### TypeScript Support
@@ -41,6 +43,49 @@ See the [TypeScript Documentation](./typescript.md) for usage examples.
41
43
- Remove custom scripts that set NODE_ENV before running the dev server
42
44
- Remove `NODE_ENV=development` from your `bin/dev` or Procfile.dev
43
45
46
+
## SWC Loose Mode Breaking Change (v9.1.0)
47
+
48
+
> **⚠️ This breaking change was introduced in v9.1.0.** If you're upgrading from v9.0.0, pay special attention to this section.
49
+
50
+
**What changed:** SWC default configuration now uses `loose: false` instead of `loose: true`.
51
+
52
+
**Why:** The previous default of `loose: true` caused:
53
+
54
+
-**Silent failures with Stimulus controllers** - Controllers wouldn't register properly
55
+
-**Incorrect behavior with spread operators** on iterables (e.g., `[...new Set()]`)
56
+
-**Deviation from SWC and Babel defaults** - Both tools default to `loose: false`
57
+
58
+
**Impact:**
59
+
60
+
-**Most projects:** No action needed. The new default is more correct and fixes bugs.
61
+
-**Stimulus users:** This fixes silent controller failures you may have experienced.
62
+
-**Projects relying on loose mode behavior:** May need to explicitly configure `loose: true` (not recommended).
63
+
64
+
**When you might need the old behavior:**
65
+
66
+
- If you have code that breaks with spec-compliant transforms
67
+
- Note: `loose: true` provides slightly faster build times but generates less spec-compliant code
68
+
69
+
**How to restore old behavior (not recommended):**
70
+
71
+
Create or update `config/swc.config.js`:
72
+
73
+
```javascript
74
+
module.exports= {
75
+
options: {
76
+
jsc: {
77
+
// Only use this if you have code that requires loose transforms.
78
+
// This provides slightly faster build performance but may cause runtime bugs.
79
+
loose:true// Restore v9.0.0 behavior
80
+
}
81
+
}
82
+
}
83
+
```
84
+
85
+
**Better solution:** Fix your code to work with spec-compliant transforms. The `loose: false` default aligns with both SWC and Babel standards and prevents subtle bugs.
86
+
87
+
**Using Stimulus?** The new default includes `keepClassNames: true` to prevent SWC from mangling class names. If you use `rake shakapacker:migrate_to_swc`, this is configured automatically. See [Using SWC with Stimulus](./using_swc_loader.md#using-swc-with-stimulus) for details.
88
+
44
89
## Breaking Changes
45
90
46
91
### 1. CSS Modules Configuration Changed to Named Exports
0 commit comments