-
-
Notifications
You must be signed in to change notification settings - Fork 638
Open
Labels
Description
Summary
Improve the SWC compiler detection and default behavior for projects using Shakapacker 9.3.0+.
Background
PR #1896 (now closed) contained valuable SWC improvements that should be extracted and applied to current master.
Proposed Changes
1. Enhance using_swc? Helper
- Update to properly parse
shakapacker.ymlfor SWC configuration - Make SWC the default for Shakapacker 9.3.0+
- Better fallback logic when config is ambiguous
2. Update Generator
- Set SWC as default in generated
shakapacker.ymlfor Shakapacker 9.3.0+ - Add helpful comments in generated config
- Ensure
swc-loaderand@swc/coreare in devDependencies
3. Documentation
- Document SWC as the recommended compiler for Shakapacker 9.3.0+
- Add migration notes for projects upgrading from Babel
Files to Update
From PR #1896 as reference:
lib/generators/react_on_rails/base_generator.rblib/generators/react_on_rails/generator_helper.rblib/generators/react_on_rails/templates/base/base/config/shakapacker.yml- Package.json files (move SWC deps to devDependencies)
Testing
- Test generator with Shakapacker 9.3.0
- Test SWC detection logic
- Verify build works with SWC
- Test fallback to Babel when SWC not configured
Related
- Extracted from closed PR Upgrade Shakapacker to 9.3.0 #1896
- Related to Shakapacker 9.3.0 upgrade (already on master)
Labels
enhancement