Skip to content

LEO foundation: model-owned state, keyed rendering and familiar JSX - #29

Merged
basiclines merged 1 commit into
masterfrom
leo/model-rendering-foundation
Nov 5, 2026
Merged

basiclines merged 1 commit into
masterfrom
leo/model-rendering-foundation

Conversation

@basiclines

@basiclines basiclines commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Direction

Make LEO a credible React alternative without moving application state into the component tree. Preserve LEOObject, LEOList and LEOElement and existing lifecycle/string-template entry points.

The research and staged acceptance criteria are in docs/react-direction.md, citing State of JS and React's own documentation. The 80% migration target and performance advantage remain unmeasured, not claimed.

Changes

  • Replace destroy-and-rebuild rendering with keyed DOM reconciliation, stable input identity, controlled values, event replacement and callback refs.
  • Add classic JSX/createElement, function props, children and fragments without a React dependency.
  • Add synchronous model-owned setState with shallow patches and current-state updater functions; a multi-field update notifies after commit.
  • Observe model/list references and release only the view's subscriptions; preserve shared data through disconnect/reconnect.
  • Add shared-counter and searchable/keyed-list examples with model actions separate from view code.
  • Update the generated README, migration boundaries, build compatibility and CI.

Evidence

52 unit tests pass. All 34 new unit tests fail under relevant reverted/mutated production behavior, then pass after exact restoration. Both built-example integration checks also fail with the original production implementation and pass after restoration.

Production bundles, generated docs and example bundles build successfully. Both demos were exercised in a real browser, including shared state after reconnection and keyed input identity, focus and selection.

Deliberate limits

This is the first foundation, not a production-readiness or drop-in React compatibility claim. SSR/hydration, async/error boundaries, concurrent scheduling, types and representative migration/performance studies remain follow-up milestones. Native DOM events differ from React synthetic events; string templates remain trusted HTML.

No npm release or automatic merge is included.

@basiclines
basiclines merged commit 10a59cd into master Nov 5, 2026
2 checks passed
@basiclines basiclines mentioned this pull request Nov 5, 2026
1 of 7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants