Commit 50bf8a1
Refactor generateRSCPayload from global to parameter
Fix data leakage issue by passing generateRSCPayload as a parameter
instead of defining it as a global function in the VM context.
Changes:
- Changed globalThis.generateRSCPayload to local const in server_rendering_js_code.rb
- Pass generateRSCPayload as parameter to ReactOnRails rendering functions
- Update RSCRequestTracker to accept generateRSCPayload in constructor
- Update streamingUtils to extract and pass generateRSCPayload from options
- Add GenerateRSCPayloadFunction type and add to Params interface
- Update test fixtures to reflect new local function pattern
This prevents concurrent requests from sharing state and eliminates
potential race conditions where one request could use another's context.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 6364abd commit 50bf8a1
File tree
6 files changed
+41
-39
lines changed- packages
- react-on-rails-pro/src
- react-on-rails/src/types
- react_on_rails_pro
- lib/react_on_rails_pro
- packages/node-renderer/tests
- fixtures/projects/spec-dummy
6 files changed
+41
-39
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | 24 | | |
41 | 25 | | |
42 | 26 | | |
| |||
52 | 36 | | |
53 | 37 | | |
54 | 38 | | |
55 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
56 | 45 | | |
| 46 | + | |
57 | 47 | | |
58 | 48 | | |
59 | 49 | | |
| |||
120 | 110 | | |
121 | 111 | | |
122 | 112 | | |
123 | | - | |
124 | | - | |
| 113 | + | |
| 114 | + | |
125 | 115 | | |
126 | 116 | | |
127 | 117 | | |
| |||
130 | 120 | | |
131 | 121 | | |
132 | 122 | | |
133 | | - | |
| 123 | + | |
134 | 124 | | |
135 | 125 | | |
136 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
185 | 193 | | |
186 | 194 | | |
187 | 195 | | |
188 | | - | |
| 196 | + | |
189 | 197 | | |
190 | 198 | | |
191 | 199 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
219 | 225 | | |
220 | 226 | | |
221 | 227 | | |
222 | 228 | | |
223 | 229 | | |
| 230 | + | |
224 | 231 | | |
225 | 232 | | |
226 | 233 | | |
| |||
Lines changed: 6 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
47 | 45 | | |
48 | 46 | | |
49 | 47 | | |
| |||
94 | 92 | | |
95 | 93 | | |
96 | 94 | | |
| 95 | + | |
97 | 96 | | |
98 | 97 | | |
99 | 98 | | |
| |||
Lines changed: 6 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
| |||
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
| 36 | + | |
38 | 37 | | |
39 | 38 | | |
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
165 | | - | |
| 164 | + | |
166 | 165 | | |
167 | 166 | | |
168 | 167 | | |
| |||
0 commit comments