Commit b52a50f
Add CHANGELOG entry and fix YAML manipulation fragility
## Changes
1. **Add CHANGELOG entry**
- Added entry under "Unreleased > Added" section
- Documents --rspack flag, performance benefits, and new utilities
- Follows CHANGELOG.md format conventions
2. **Fix YAML manipulation fragility in base_generator.rb**
- Replaced fragile regex-based string manipulation with proper YAML parsing
- Uses YAML.load_file and YAML.dump for safe config updates
- Handles edge cases: existing assets_bundler settings, custom configs
- Matches the robust approach used in bin/switch-bundler
## Issues Fixed
**Before:**
- Regex wouldn't update existing assets_bundler (only added if missing)
- Assumed specific whitespace formatting
- Could break with environment-specific overrides
- Silent failures on non-standard formatting
**After:**
- Properly parses YAML structure
- Updates or creates assets_bundler setting correctly
- Works with any valid YAML formatting
- Handles all edge cases safely
## Testing
- All 19 rspack specs pass (0 failures)
- RuboCop checks pass (zero offenses)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 4cf8041 commit b52a50f
File tree
2 files changed
+10
-13
lines changed- lib/generators/react_on_rails
2 files changed
+10
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
| 410 | + | |
| 411 | + | |
420 | 412 | | |
421 | | - | |
422 | | - | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
423 | 417 | | |
424 | | - | |
| 418 | + | |
| 419 | + | |
425 | 420 | | |
426 | 421 | | |
427 | 422 | | |
| |||
0 commit comments