Commit 6032d64
Improve bundle path resolution with secure server bundle locations
Major improvements to bundle_js_file_path logic:
**Security & Architecture:**
- Server bundles (SSR/RSC) now try secure non-public locations first:
- ssr-generated/ (primary)
- generated/server-bundles/ (secondary)
- Client bundles continue using manifest lookup as primary approach
- Prevents exposure of server-side logic in public directories
**Priority Order:**
- SERVER BUNDLES: secure locations → manifest → legacy public locations
- CLIENT BUNDLES: manifest → fallback locations (original behavior)
- Fixed priority order (normal case first, edge cases second)
**Code Quality:**
- Extracted complex method into smaller, focused private methods
- Reduced cyclomatic complexity and improved maintainability
- Added comprehensive test coverage for all scenarios
- Added ssr-generated/ to .gitignore
**Backwards Compatibility:**
- Legacy public locations still work as fallbacks
- Existing client bundle behavior unchanged
- Gradual migration path for server bundles
This addresses the core architectural issue where server bundles were
unnecessarily exposed in public directories while maintaining full
compatibility with existing setups.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>1 parent 89ac6eb commit 6032d64
File tree
3 files changed
+144
-37
lines changed- lib/react_on_rails
- spec/react_on_rails
3 files changed
+144
-37
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
64 | 67 | | |
65 | 68 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
81 | 75 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
| 76 | + | |
104 | 77 | | |
105 | 78 | | |
106 | 79 | | |
| |||
109 | 82 | | |
110 | 83 | | |
111 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
112 | 150 | | |
113 | 151 | | |
114 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
106 | 114 | | |
107 | 115 | | |
108 | 116 | | |
| |||
158 | 166 | | |
159 | 167 | | |
160 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
161 | 227 | | |
162 | 228 | | |
163 | 229 | | |
| |||
204 | 270 | | |
205 | 271 | | |
206 | 272 | | |
207 | | - | |
| 273 | + | |
208 | 274 | | |
209 | 275 | | |
210 | 276 | | |
211 | 277 | | |
212 | 278 | | |
213 | 279 | | |
214 | | - | |
| 280 | + | |
215 | 281 | | |
216 | 282 | | |
217 | 283 | | |
| |||
235 | 301 | | |
236 | 302 | | |
237 | 303 | | |
238 | | - | |
| 304 | + | |
239 | 305 | | |
240 | 306 | | |
241 | 307 | | |
| |||
246 | 312 | | |
247 | 313 | | |
248 | 314 | | |
249 | | - | |
| 315 | + | |
250 | 316 | | |
251 | 317 | | |
252 | 318 | | |
| |||
303 | 369 | | |
304 | 370 | | |
305 | 371 | | |
306 | | - | |
| 372 | + | |
307 | 373 | | |
308 | 374 | | |
309 | 375 | | |
310 | 376 | | |
311 | 377 | | |
312 | 378 | | |
313 | | - | |
| 379 | + | |
314 | 380 | | |
315 | 381 | | |
316 | 382 | | |
| |||
0 commit comments