Commit 5385b64
authored
Update React on Rails to 16.1.1 and move SSR to private directory (#656)
Relocate server-side rendering bundles from public assets to a private
directory following React on Rails 16 security best practices.
Changes:
- Configure webpack to output server bundles to ssr-generated directory
- Update React on Rails config to use server_bundle_output_path setting
- Add ssr-generated and client/app/generated to .gitignore
- Move path require to top of file for proper code organization
Configuration:
- Uses React on Rails default path: ssr-generated
- Server bundle remains named server-bundle.js
- Client assets continue to output to public/packs
Security Impact:
- Server bundles are now isolated from publicly accessible assets
- Prevents potential exposure of server-only code and dependencies
- Follows React on Rails 16+ recommended security patterns
Compatibility:
- No breaking changes for existing deployments
- Server rendering continues to work transparently
- Client-side functionality unchanged
This change only affects the build output location for SSR bundles.
The application behavior remains identical, with improved security
by keeping server-only code separate from public web assets.1 parent 84f3d24 commit 5385b64
File tree
3 files changed
+16
-1
lines changed- config
- initializers
- webpack
3 files changed
+16
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
53 | | - | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
| |||
0 commit comments