Skip to content

v0.7.6

Choose a tag to compare

@github-actions github-actions released this 08 Nov 04:28
e771371

Summary

Child components first render with the props their parent gives them, lists update a new item before inserting it, and Light DOM slots take only content written in HTML, so children a framework renders go to shadow: true components. Recorded in CHANGELOG under 0.7.6.

Changes

  • Start order: a component inside another component, in its Light DOM or its shadow tree at any depth, starts after the outer component's first render, as a browser orders a shadow host and its shadow tree. A child of a template first renders with the props that render gives it. Starts are isolated from each other's errors, still run when the outer first render throws, and run once.
  • Lists: replace() and upsert() call update for a new item before inserting it, as assigning items does; an upsert() whose update throws leaves no item behind.
  • Light DOM slots: they place the children an element has when it is built and nodes a list or data-if of a parent template puts in later. A node other code adds afterwards stays where it was put, with the console warning unplaced-child once per tag. Slots move a node to another slot with moveBefore where the browser has it.
  • Cleanups: every cleanup and disconnected() runs when one throws; the errors are rethrown together.
  • Docs and Skills: the slot boundary is a design decision; the framework Skills give framework children shadow: true only; render writes compare first; a prop the parent always gives is declared with null, typed DeepReadonly<T> | null in an interface. Seven Skills re-verified by agent trials on 0.7.6.

Verification

  • npm run check, npm test (764), npm run lint, npm run test:browser (124), npm run bench:check, npm run smoke, npm run smoke:no-bundler.
  • Chrome tests of the start order in both modes, of nested parsing, of moveBefore in slots and of the slot rules; the start-order test fails without the change.
  • Fresh Sonnet agent trials of core, testing, react, vue, svelte, angular and integration, each checked again independently.

Breaking Changes

  • Child components of a Light DOM template start after the parent's first render: in that render a child has not built its own content, so calling its methods there moves to a later render or an event handler.
  • replace() and upsert() run update on a new item before it is in the document: read layout after the list call.
  • Light DOM slots no longer place nodes that code or a framework adds after the element is built: give such a component shadow: true, or put TypeScript content into an element the component exposes through a ref.

🤖 Generated with Claude Code