Commit 087a04b
authored
* Post-SWC migration improvements (#678)
Key improvements after SWC migration:
1. **SWC Development Mode Configuration**
- Added `development: env.isDevelopment` to SWC React transform
- Matches Babel's behavior for better dev error messages
- Improves debugging experience in development
2. **Babel Dependency Cleanup**
- Removed unused `babel-loader` (replaced by swc-loader)
- Removed unused `babel-plugin-macros` (not used in codebase)
- Moved `@babel/preset-react` to devDependencies (only needed for Jest/ESLint)
- Updated babel.config.js with clear comments explaining Babel is only for Jest/ESLint
3. **Test Coverage for Stimulus Controllers**
- Added test to verify SWC config preserves class names (keepClassNames: true)
- Verified React 19 compatibility with automatic runtime
- Fixed Jest config paths (setupFiles and testRegex)
4. **Documentation & Configuration**
- Documented that production builds use SWC, tests use Babel
- Clarified which Babel packages must be kept and why
- Simplified babel.config.js (removed unused plugins for webpack)
**React 19 Compatibility**: Verified SWC 1.13.5 works correctly with React 19
using automatic runtime transform.
**Dependencies Status**: @swc/core@1.13.5 and swc-loader@0.2.6 are latest versions.
1 parent 8b80714 commit 087a04b
File tree
8 files changed
+722
-440
lines changed- client
- __tests__
- app
- bundles/comments/components/CommentBox/CommentList
- Comment
- libs
8 files changed
+722
-440
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| 8 | + | |
| 9 | + | |
6 | 10 | | |
7 | 11 | | |
8 | 12 | | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| 16 | + | |
12 | 17 | | |
13 | 18 | | |
14 | 19 | | |
15 | 20 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 21 | + | |
26 | 22 | | |
27 | 23 | | |
28 | 24 | | |
29 | | - | |
30 | 25 | | |
31 | 26 | | |
32 | 27 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
Lines changed: 15 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | 5 | | |
8 | 6 | | |
9 | | - | |
| 7 | + | |
10 | 8 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
17 | 13 | | |
18 | 14 | | |
19 | 15 | | |
20 | | - | |
| 16 | + | |
21 | 17 | | |
22 | | - | |
23 | | - | |
| 18 | + | |
| 19 | + | |
24 | 20 | | |
25 | 21 | | |
26 | 22 | | |
27 | | - | |
| 23 | + | |
28 | 24 | | |
29 | | - | |
30 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
31 | 30 | | |
32 | 31 | | |
Lines changed: 14 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | 5 | | |
9 | 6 | | |
10 | 7 | | |
| |||
30 | 27 | | |
31 | 28 | | |
32 | 29 | | |
33 | | - | |
| 30 | + | |
34 | 31 | | |
35 | 32 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
43 | | - | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
51 | | - | |
52 | | - | |
| 53 | + | |
| 54 | + | |
53 | 55 | | |
54 | 56 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
| 27 | + | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | 51 | | |
56 | 52 | | |
57 | 53 | | |
| |||
110 | 106 | | |
111 | 107 | | |
112 | 108 | | |
| 109 | + | |
113 | 110 | | |
114 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| |||
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
| 154 | + | |
153 | 155 | | |
154 | 156 | | |
155 | 157 | | |
156 | | - | |
157 | | - | |
| 158 | + | |
| 159 | + | |
158 | 160 | | |
159 | | - | |
| 161 | + | |
160 | 162 | | |
161 | 163 | | |
162 | 164 | | |
| |||
0 commit comments