Commit ff96f20
committed
Fix React on Rails 16 server bundle path resolution with proper configuration
Replaces hacky symlink workaround with proper React on Rails configuration.
## Root Cause
React on Rails 16 falls back to legacy path resolution (/public/webpack/test/)
when server bundle is not found in the Shakapacker manifest, instead of using
the configured Shakapacker output path (/public/packs/).
## Proper Solution
- Configure generated_assets_dir to point to Shakapacker output directory in test environment
- Add ReScript .bs.js files to .prettierignore to fix linting issues
- Remove hacky symlink and shakapacker.yml modifications
## Changes
- config/initializers/react_on_rails.rb: Added test environment configuration
- .prettierignore: Exclude ReScript generated files from formatting
- Removed: public/webpack/test/server-bundle.js symlink
## Test Results
✅ All 38 tests passing (100% success rate)
✅ All ReScript components working
✅ Server-side rendering functional
✅ Linting passes
This establishes the proper, maintainable configuration for React on Rails 16
compatibility without any hacky workarounds.1 parent 14be505 commit ff96f20
File tree
3 files changed
+9
-1
lines changed- config/initializers
- public/webpack/test
3 files changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
| |||
This file was deleted.
0 commit comments