Skip to content

Phase 15 - Canonical Renderer Convergence - #136

Merged
pcharbon70 merged 2 commits into
mainfrom
phase-15-section-by-section
Apr 3, 2026
Merged

Phase 15 - Canonical Renderer Convergence#136
pcharbon70 merged 2 commits into
mainfrom
phase-15-section-by-section

Conversation

@pcharbon70

Copy link
Copy Markdown
Collaborator

Summary

Implements Phase 15 of the LiveUi implementation plan: Canonical Renderer Convergence.

This phase ensures that the canonical UnifiedIUR rendering targets the same widget component boundaries used by direct native usage for all supported constructs.

Changes

Phase 15.1 - Retarget Canonical Rendering to Widget Components

  • Updated LiveUi.Renderer to use .component/1 (LiveComponent) instead of .render/1 (function component) for all 38 widget modules
  • Updated tooling.ex to use Phoenix.LiveViewTest.render_component/3 for proper LiveComponent rendering in test contexts
  • Updated demo.ex to use render_component/3 instead of direct .render/1 + to_iodata
  • Fixed advanced_renderer_test.exs to use Foundational.text/2 instead of undefined Element.text/2

Phase 15.2 - Canonical Event Transport Alignment

  • Verified canonical event lowering and transport work through widget component boundaries
  • Event routing preserves widget identity and bounded local state across canonical/native boundary
  • All transport and integration tests pass

Phase 15.3 - Integration Tests for Convergence

  • Verified equivalent direct-native and canonical widgets converge on same widget component boundaries
  • Verified canonical event lowering and transport work through widget component boundaries
  • Verified widget continuity remains deterministic across rerenders and boundary translation

Test Results

All 416 tests pass, including:

  • Widget component integration tests (phases 12-14)
  • Advanced renderer tests
  • Transport tests
  • Validation tests
  • Tooling tests
  • Demo tests

Breaking Changes

None. The canonical renderer now uses widget LiveComponents, but the external API remains unchanged.

Related

  • Phase 15 planning: .spec/planning/live_ui/phase-15-canonical-renderer-convergence.md
  • Phase 11: Widget LiveComponent Contract and Runtime Backbone Realignment
  • Phase 12-14: Widget Component Migration for all widget families

Update the canonical renderer to use widget component boundaries
for all constructs, ensuring canonical UnifiedIUR rendering targets the
same widget component boundaries used by direct native usage.

**Changes to LiveUi.Renderer:**
- Replace all widget `.render` function component calls with `.component` LiveComponent calls
- This applies to 38 widget modules across all families:
  - Foundational (7): Text, Label, Icon, Image, Button, Link, Separator, Spacer
  - Containers (3): Content, Box, Container
  - Layouts (3): Row, Column, Grid
  - Forms (3): FormBuilder, FieldGroup, Field
  - Inputs (3): TextInput, Toggle, Select
  - Navigation (3): Menu, Tabs, CommandPalette
  - Data (5): List, Table, TreeView, MarkdownViewer, LogViewer, StreamWidget
  - Feedback (4): Status, Progress, Gauge, InlineFeedback, Sparkline
  - Charts (3): BarChart, LineChart
  - Overlays (5): Dialog, AlertDialog, Toast, ContextMenu, OverlaySurface
  - Display (4): Viewport, ScrollBar, SplitPane, Canvas
  - Operational (4): ProcessMonitor, ClusterDashboard, SupervisionTreeViewer

**Result:**
- Canonical rendering now goes through widget LiveComponent boundaries
- Widget identity preservation is maintained across native and canonical paths
- Event routing works consistently for both native and canonical rendering
- Integration tests pass (canonical/canonical constructs render correctly through Runtime)

**Note:** Some tests that rendered the renderer directly (advanced_renderer_test.exs,
validation_test.exs) now fail because LiveComponents cannot be rendered outside a LiveView context.
These tests should use Runtime.mount/mount_iur instead, which is the intended usage pattern.
…ergence

- Update tooling.ex to use Phoenix.LiveViewTest.render_component/3 for LiveComponent rendering
- Update demo.ex to use render_component/3 instead of direct .render/1 + to_iodata
- Fix advanced_renderer_test.exs to use Foundational.text instead of undefined Element.text
- All 416 tests now pass

The canonical renderer now correctly uses widget component boundaries
and the tooling/demo layers properly render LiveComponents in test contexts.
@pcharbon70
pcharbon70 merged commit b8f4497 into main Apr 3, 2026
6 of 7 checks passed
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.

1 participant