TLX.Extractor.LiveView (TLX v0.5.2)

Copy Markdown

Extracts LiveView structure from Elixir source code.

Parses source with Code.string_to_quoted/1 and walks the AST to extract fields (from mount/3 assigns), event handlers, and info handlers. Detects field changes from assign/2,3, update/3, and pipe chains.

Usage

{:ok, result} = TLX.Extractor.LiveView.extract_from_file("lib/my_live.ex")

result.fields  #=> [status: :idle, show_modal: false]
result.events  #=> [%{name: :filter, next: [status: ...], ...}]

The result can feed into TLX.Patterns.OTP.GenServer or TLX.Importer.Codegen.from_live_view/3.

Summary

Functions

Extract LiveView structure from a source file.

Extract LiveView structure from an Elixir source string.

Functions

extract_from_file(path)

Extract LiveView structure from a source file.

extract_from_source(source)

Extract LiveView structure from an Elixir source string.