Commit a576de4
committed
[Fix] ui/runtime: unwrap single reactive values before passing to component processors
When a component processor (e.g. `out="symbol|SymbolDetails"`) receives a
single reactive cell as its input, the reactive wrapper was previously passed
through unchanged to the component. This was inconsistent with starred (`*`)
component processors, which already unwrap the reactive wrapper before
iterating, and with function processors, which fully expand values before
calling the function. The mismatch meant a component receiving a bare
reactive cell could not reliably access named keys from its template data
because `resolveSourceValue(data, key)` directly accesses `data[key]`, and
reactive cells do not expose user properties on themselves.
The fix unwraps the top-level reactive cell before handing the value to the
component, matching the existing behaviour of the starred-component path.
Multi-valued sourceMap bindings (`out="a:b,c:d|SymbolDetails"`) are
unaffected because the top-level value is a plain object, not a reactive.
This is a **breaking change** for any component that relied on receiving the
reactive cell directly rather than its unwrapped inner value. Such components
must either add an explicit `unwrap` processor (`out="key|unwrap|SymbolDetails"`)
or extract `.value` from the reactive inside their behaviour functions.
Changed:
- src/js/select/ui/components/runtime.js: unwrap single reactive values in
`applyNamedProcessor` before passing to component processors, consistent
with the existing starred-component and function-processor paths.
Added:
- tests/ui-processor-reactives.test.js: three new tests covering unwrapping
of single reactive values, preservation of non-reactive values, and
regression guard confirming sourceMap bindings still pass reactive
internals inside the mapped object.
Updated:
- tests/ui-reactive-props.tests.js: "passes reactive values through component
processors" now expects the unwrapped value instead of the reactive cell.
- docs/ref-ui.md: added note that single reactive values are unwrapped before
reaching the component, matching the documented starred-component behaviour.
No breaking changes for: sourceMap bindings (`out="a:b,c:d|Component"`),
starred component processors (`out="items|*Component"`), function processors,
event payloads (`on:click=...`), or template-mode out bindings.1 parent 200e0a7 commit a576de4
4 files changed
Lines changed: 105 additions & 2 deletions
File tree
- docs
- src/js/select/ui/components
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
| 558 | + | |
558 | 559 | | |
559 | 560 | | |
560 | 561 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
| 251 | + | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
458 | 560 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
0 commit comments