Commit 224eb46
committed
refactor!: prepare for v1.0.0 - rename @Prefix to @action_prefix and unify dispatch API
BREAKING CHANGES:
1. Renamed @Prefix to @action_prefix in reducer system
- All reducer modules must update from @Prefix to @action_prefix
- @action_prefix can be nil or "" for catch-all reducers
- Generated function renamed: __reducer_prefix__ → __reducer_action_prefix__
2. Changed dispatch return values to :ok
- dispatch/3 now returns :ok instead of {:ok, state}
- dispatch_async/3 now returns :ok instead of {:ok, state}
- All dispatches are now async (fire-and-forget)
- Use get_state/1-2 to retrieve state after dispatch
3. Added dispatch_async/3 function
- New explicit async dispatch function for clarity
- Same behavior as dispatch/3 but clearer intent
MIGRATION:
For @Prefix rename:
- Find: @Prefix
- Replace: @action_prefix
For dispatch return values:
- Find: {:ok, state} = SessionProcess.dispatch(...)
- Replace: :ok = SessionProcess.dispatch(...)
- Add: state = SessionProcess.get_state(session_id)
Files changed:
- lib/phoenix/session_process.ex
- lib/phoenix/session_process/redux/reducer_compiler.ex
- test/phoenix/session_process/dispatch_test.exs
- test/phoenix/session_process/reducer_integration_test.exs
- README.md
- CLAUDE.md
- CHANGELOG.md
New documentation:
- V1_0_0_PREPARATION.md - Comprehensive v1.0.0 preparation guide
- REDUCER_IMPROVEMENTS.md - Reducer system improvement tracking
All 264 tests passing.1 parent a987113 commit 224eb46
File tree
9 files changed
+983
-148
lines changed- lib/phoenix
- session_process/redux
- test/phoenix/session_process
9 files changed
+983
-148
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
8 | 92 | | |
9 | 93 | | |
10 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
281 | | - | |
| 280 | + | |
| 281 | + | |
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
292 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
293 | 296 | | |
294 | 297 | | |
295 | 298 | | |
| |||
366 | 369 | | |
367 | 370 | | |
368 | 371 | | |
369 | | - | |
370 | | - | |
| 372 | + | |
| 373 | + | |
371 | 374 | | |
372 | 375 | | |
373 | 376 | | |
374 | 377 | | |
375 | 378 | | |
376 | 379 | | |
377 | | - | |
378 | | - | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
379 | 385 | | |
380 | 386 | | |
381 | 387 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
| 151 | + | |
150 | 152 | | |
151 | 153 | | |
152 | 154 | | |
| |||
163 | 165 | | |
164 | 166 | | |
165 | 167 | | |
166 | | - | |
| 168 | + | |
167 | 169 | | |
168 | 170 | | |
169 | 171 | | |
| |||
173 | 175 | | |
174 | 176 | | |
175 | 177 | | |
176 | | - | |
177 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
178 | 183 | | |
179 | | - | |
180 | | - | |
| 184 | + | |
| 185 | + | |
181 | 186 | | |
182 | 187 | | |
183 | 188 | | |
| |||
405 | 410 | | |
406 | 411 | | |
407 | 412 | | |
408 | | - | |
409 | | - | |
| 413 | + | |
| 414 | + | |
410 | 415 | | |
411 | 416 | | |
412 | 417 | | |
| |||
416 | 421 | | |
417 | 422 | | |
418 | 423 | | |
419 | | - | |
420 | | - | |
| 424 | + | |
| 425 | + | |
421 | 426 | | |
422 | | - | |
423 | | - | |
| 427 | + | |
| 428 | + | |
424 | 429 | | |
425 | | - | |
426 | | - | |
| 430 | + | |
| 431 | + | |
427 | 432 | | |
428 | 433 | | |
429 | | - | |
| 434 | + | |
430 | 435 | | |
431 | 436 | | |
432 | 437 | | |
| |||
449 | 454 | | |
450 | 455 | | |
451 | 456 | | |
452 | | - | |
| 457 | + | |
453 | 458 | | |
454 | 459 | | |
455 | 460 | | |
| |||
0 commit comments