Phase 4: Runtime and LiveView Integration - #8
Merged
pcharbon70 merged 7 commits intoMar 19, 2026
Merged
Conversation
Implemented screen mounting through LiveView mount/3 callback: - AshUI.LiveView.Integration module with mount_ui_screen/3 - Screen authorization on mount with policy checking - Screen compilation to IUR on initial mount - Binding evaluation for initial render - AshUI.LiveView.Hooks for lifecycle management - on_mount, on_update, on_unmount hooks - User-defined lifecycle callbacks - Telemetry events for mount operations - Tests for mount integration and hooks
Implemented reactive updates through LiveView handle_info/2 callback: - Subscribe/unsubscribe to Ash resource change notifications - Filter notifications to bound resources - Handle resource change notifications (created, updated, destroyed) - Re-evaluate affected bindings on notification - Batch multiple updates for performance - Cleanup subscriptions on unmount - Tests for update integration
Implemented UI event handling through LiveView handle_event/3: - Event routing to appropriate handlers based on type - Value change events (phx-blur, phx-change) - Action events (phx-click, phx-submit) - Event data validation - Error handling with flash messages - Wire handlers for screen bindings - Tests for event handling
Implemented screen lifecycle hooks and state management: - Lifecycle hooks (on_init, on_update, on_unmount, on_error) - Session initialization with unique IDs - State isolation between LiveView sessions - Session-specific state storage - User-defined lifecycle callbacks - Session cleanup on disconnect - Telemetry events for lifecycle tracking - Error handling during lifecycle - Tests for lifecycle management
Implemented error handling for runtime failures: - Compilation error handling with user-friendly messages - Binding error handling with fallback values - Action error handling with flash feedback - Authorization error handling - Runtime error handling with stacktraces - Recovery strategies (retry, fallback, skip, abort) - Retry with exponential backoff - User-friendly error messages - Error telemetry emission - Tests for error handling
Added comprehensive integration tests for Phase 4: - Mount lifecycle integration scenarios - Event handling integration scenarios - Reactivity integration scenarios - End-to-end screen lifecycle tests - Error recovery flow tests - Session management tests - Telemetry event tests
8 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the LiveView integration layer that manages screen lifecycle, session state, and event handling.
Section 4.1 - LiveView Mount Integration
AshUI.LiveView.Integrationwithmount_ui_screen/3AshUI.LiveView.Hooksfor lifecycle managementSection 4.2 - LiveView Update Integration
Section 4.3 - Event Handling Integration
Section 4.4 - Screen Lifecycle Management
Section 4.5 - Error Handling and Recovery
Section 4.6 - Integration Tests
Test plan