Commit 683b1e9
Migrate from Babel to SWC transpiler (#666)
This commit migrates the project from Babel to SWC for JavaScript transpilation,
aligning with Shakapacker 9.0's default transpiler and providing significant
performance improvements.
## Changes
### Configuration
- Update shakapacker.yml to use SWC transpiler
- Create .swcrc configuration file with equivalent Babel settings
- Add config/swc.config.js to customize SWC loader for Shakapacker
- Update .eslintrc to use espree parser instead of @babel/eslint-parser
### Dependencies
- Remove Babel-specific dependencies:
- @babel/cli, @babel/core, @babel/plugin-transform-runtime
- @babel/preset-env, @babel/preset-react
- @babel/eslint-parser
- babel-loader, babel-jest, babel-plugin-macros
- babel-plugin-transform-react-remove-prop-types
- Add SWC dependencies:
- @swc/core, @swc/jest, swc-loader
### Testing Configuration
- Update Jest to use @swc/jest instead of babel-jest
- Keep @babel/runtime for polyfills
### Cleanup
- Remove babel.config.js file
- Remove unused Babel configuration
## Benefits
- 10-20x faster build times for large codebases
- Lower memory footprint during builds
- Modern, actively maintained transpiler
- Aligns with Shakapacker 9.0 defaults
## Testing
- ✅ Test build passes (yarn build:test)
- ✅ Development build passes (yarn build:dev)
- ✅ ESLint passes
- ✅ RuboCop passes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 79a7efc commit 683b1e9
File tree
10 files changed
+284
-1025
lines changed- client/app/libs/i18n
- config
10 files changed
+284
-1025
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | 4 | | |
7 | 5 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
8 | 18 | | |
9 | 19 | | |
10 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
This file was deleted.
| 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 | + | |
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | 34 | | |
40 | 35 | | |
41 | 36 | | |
| |||
47 | 42 | | |
48 | 43 | | |
49 | 44 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | 45 | | |
54 | 46 | | |
55 | 47 | | |
| |||
106 | 98 | | |
107 | 99 | | |
108 | 100 | | |
109 | | - | |
110 | 101 | | |
| 102 | + | |
| 103 | + | |
111 | 104 | | |
| 105 | + | |
112 | 106 | | |
113 | | - | |
114 | 107 | | |
115 | 108 | | |
116 | 109 | | |
| |||
155 | 148 | | |
156 | 149 | | |
157 | 150 | | |
158 | | - | |
| 151 | + | |
159 | 152 | | |
160 | 153 | | |
161 | 154 | | |
| |||
0 commit comments