Skip to content

Kudzu 0.8.8 - Conditional keyed map roots

Choose a tag to compare

@bunzzeok bunzzeok released this 06 Aug 06:50
· 16 commits to main since this release

Kudzu 0.8.8 compiles ordinary expression-bodied conditional keyed maps through the existing pure collection selector path.

New

  • Support one-parameter keyed maps returning condition && <Row /> or condition ? <Row /> : null.
  • Allow top-level conditions over the current item and direct primitive parent state, plus item-only nested conditions.
  • Release row state, effects, and refs when a condition becomes false; create fresh ownership on re-entry.
  • Preserve retained sibling DOM identity through condition changes, insertion, and reorder.
  • Keep same-file and relative row components compiler-specialized.
  • Fold imported build-known item-only conditions to complete zero-JavaScript HTML.
  • Restore the React Notes migration's ordinary notes.map(note => activeId === note.id && <Editor />) source.
  • Diagnose map indexes, alternate JSX fallbacks, block-bodied conditional maps, arbitrary captures, and impure predicates.
  • Pass the complete 134/134 test suite.

Boundary

Conditional map callbacks must be synchronous expression arrows with exactly one item parameter. Indexes are rejected because implicit filtering changes their meaning. No runtime capability, VDOM, hydration, or component rerenderer is added.

Upgrade

npm install @kudzujs/core@^0.8.8