39 lines
1.4 KiB
Markdown
39 lines
1.4 KiB
Markdown
---
|
|
id: component/map
|
|
name: Implement <Map> ujsx component
|
|
status: completed
|
|
depends_on:
|
|
- schema/edge-attrs
|
|
- setup/project-init
|
|
scope: narrow
|
|
risk: low
|
|
impact: component
|
|
level: implementation
|
|
---
|
|
|
|
## Description
|
|
|
|
Implement the `Map` ujsx component function. Represents mapping over an array — creates one child instance per array item. Structurally equivalent to a dynamically-generated Parallel group.
|
|
|
|
## Acceptance Criteria
|
|
|
|
- [ ] `src/component/map.ts` exports `Map` component function
|
|
- [ ] `Map` produces `UElement` with `type: "map"`
|
|
- [ ] Props: `over: Signal<unknown[]> | unknown[] | ((results: Record<string, CallResult>) => unknown[])` (required), `as: string` (required), `children: UNode` (required — template rendered per item)
|
|
- [ ] The `as` prop names the variable each item is bound to
|
|
- [ ] Aggregate completion semantics: all mapped nodes must reach satisfying terminal state for Map to be "completed"; any failed/aborted child makes Map failed/aborted
|
|
- [ ] Re-exported from `src/component/index.ts`
|
|
- [ ] Unit tests: correct UElement shape with each over form (static, function), as prop preserved
|
|
|
|
## References
|
|
|
|
- docs/architecture/workflow-templates.md — Map component, aggregate completion semantics, edge type
|
|
- docs/architecture/reactive-execution.md — Map reactive behavior, maxConcurrency interaction
|
|
|
|
## Notes
|
|
|
|
> To be filled by implementation agent
|
|
|
|
## Summary
|
|
|
|
> To be filled on completion |