API Reference Lavash v#0.4.0-rc.1

Copy Markdown View Source

Modules

Reactive state management for Phoenix LiveView.

Shared action execution runtime for both LiveView and Component.

An action that transforms state in response to events.

A side effect

A flash message operation within an action.

Invokes an action on a child Lavash component.

Maps over an array field, finding items by a key field and applying a transformation.

A navigation operation within an action.

An action op that calls Phoenix.LiveView.push_event/3 on the socket. Fires a client-side event for a JS hook to receive via this.handleEvent("name", fn).

An action op that calls Phoenix.LiveView.push_patch/2 on the socket. Updates the URL and re-runs handle_params/3 without remounting the LiveView, so calc/state hydration from the new URL flows through normally.

An action op that calls Phoenix.LiveView.redirect/2 on the socket. Full-page reload to an external URL or to a non-live route in the same app.

Executes a function that returns updated assigns.

Sets a field to a value.

An async form submission within an action.

OTP Application for Lavash.

Projects metadata into socket assigns.

A self-contained chip set component for multi-select filtering.

Stateful Phoenix LiveComponents with the same DSL as Lavash.LiveView.

A calculated field computed from state using a reactive expression.

Runtime utilities for Lavash Component compilation.

Shared compiler utilities for Lavash components.

The Spark DSL extension for Lavash Components.

Helper functions for using Lavash components in LiveViews.

Transpiles parsed HEEx template nodes to JavaScript template literal strings.

An optimistic action that generates both client JS and server handlers.

A prop passed from the parent component.

A render function for LiveViews and Components.

Runtime implementation for Lavash Components.

A state field that connects component state to parent state.

DEPRECATED: Use Lavash.Component.Render instead.

Analyzes pre-tokenized template tokens for optimistic derives.

Compiles component template and generates all LiveComponent callbacks.

Tokenizes the template source string into HTML tokens.

Block-structured DSL for defining function components.

Optimistic toggle switch component.

Optimistic tag input component.

A derived state field.

A declarative form definition in the derived section.

The Spark DSL extension for Lavash LiveViews.

Shared DSL entity definitions used by both Lavash.Dsl (LiveView) and Lavash.Component.Dsl.

Builds and caches a Lavash.Rx.Graph from DSL module metadata.

Helper functions for use in Lavash DSL declarations.

Extends auto-generated form field errors with custom error checks.

A single custom error check within extend_errors.

A wrapper around Ash.Changeset that provides both form rendering and submission.

Transpiles Ash resource constraints to rx() expressions for client-side validation.

Shared form handling runtime for both LiveView and Component.

Struct representing a top-level form declaration.

DSL entity for a form step that creates an AshPhoenix.Form.

Generates JavaScript for form field validation and error checking.

Transpiles Ash resource validations (from validations do block) to client-side validation.

Pure graph algorithms for dependency graphs.

JSON encoding utilities for Lavash optimistic state.

Capability: declare a triggerable async task that produces a value into an assigns field.

Runtime support for async :name do run fn assigns -> ... end end declarations and the fire :name op.

Capability: react to a server-side message arriving at this LiveView. Used for PubSub broadcasts, self-scheduled timers (Process.send_after/3), monitor/DOWN messages, and the like.

Capability: declare what happens at LiveView mount, beyond the state-defaults and reactive-graph initialisation lavash sets up automatically.

Re-exports Phoenix.LiveView.on_mount/1 so the macro is in scope inside use Lavash.LiveView modules without the user having to write import Phoenix.LiveView, only: [on_mount: 1].

Runtime support for lifecycle DSL blocks (messages do message ... end end today; mount/handle_params/connected blocks if/when they land).

Use this module to create a Lavash-powered LiveView.

Utility functions for LiveView compilation.

Lavash form components with built-in optimistic updates.

Non-DSL entry point for using the Lavash reactive graph from a plain Phoenix.LiveView.

Helper functions available in Lavash LiveViews.

Runtime implementation for Lavash LiveViews.

Compiles LiveView template and generates all LiveView callbacks.

Namespace module for Lavash's optimistic update infrastructure.

Shared action analysis and JS generation for optimistic updates.

Macro for defining optimistic actions that run on both client and server.

Macros for optimistic actions.

Spark transformer that expands animated state fields into phase tracking state and calculations.

Spark transformer that expands defrx function calls in rx expressions.

Extracts generated optimistic JS to colocated files for esbuild bundling.

Overlay components for Lavash - modals, slideovers, and other layered UI.

Spark DSL extension for flyover (slideover) behavior.

Helper components for flyover (slideover) rendering.

Generates the render/1 function for flyover components.

Transformer that generates the render/1 function for flyover components.

Transformer that injects flyover state and actions into a Lavash Component.

Modal behavior plugin for Lavash Components.

Spark DSL extension for modal behavior.

Helper components for modal rendering.

Generates the render/1 function for modal components.

Transformer that generates the render/1 function for modal components.

Transformer that injects modal state and actions into a Lavash Component.

Behaviour for overlay render generators.

PubSub integration for cross-process resource invalidation.

Reactive state management for Phoenix LiveViews.

Macro for defining reactive graphs with client-side JS generation.

A read step that loads an Ash resource.

An argument override for a read action.

A render function declaration.

Ash extension for Lavash resource configuration.

A reactive expression that captures AST for isomorphic execution.

Module-scoped node-global cache for compiled rx() ASTs.

Module for defining reusable reactive functions that can be imported into LiveViews.

A precomputed reactive dependency graph.

String utility functions that transpile to JavaScript.

Translates Elixir expressions to JavaScript.

The ~L sigil for Lavash HEEx templates.

Helpers for accessing Lavash private socket data.

Spike: a Spark DSL extension that treats HEEx templates as a first-class DSL element, not as opaque sigil contents inside a function body.

The template do ~H"..." end macro.

Compiles the HEEx template source into a render/1 function on the using module. The function takes an assigns map and returns a %Phoenix.LiveView.Rendered{}, identical in shape to what ~H produces inside a regular Phoenix.Component.

Reads the @__lavash_heex_template__ module attribute (set by the template macro) and persists it into the DSL state so subsequent transformers can inspect it.

Per-element cross-check between phx-value-* attributes and the declared params on the corresponding action.

Cross-validates the tokenized HEEx template against declared action entities.

Demonstrates the core spike value: the template is now a first-class DSL citizen, so we can cross-validate it against other DSL entities at DSL build time (i.e. inside the Spark transformer pipeline, not in a bolted-on post-compile pass).

State hydration and management.

An ephemeral state field

A mutable state field from an external source.

Represents a form binding that syncs DOM form params to ephemeral state.

Raised when a from: :url, required: true state field is absent from the URL on mount or handle_params. Carries the offending field name so callers (error pages, telemetry, etc.) can pattern-match.

A socket state field.

A URL-backed state field

Thin wrapper around Phoenix.LiveView.TagEngine.{Parser, Compiler}.

Utilities for parsing HEEx templates into a small :element tree.

Transforms compiled HEEx template AST to inject Lavash-specific attributes.

Represents a compiled Lavash template with source preservation.

Macro for defining render functions in Lavash LiveViews and Components.

Unified token-tree transformer for Lavash templates.

A self-contained toggle chip component for boolean state.

Behaviour for transforming HEEx tokens before they are processed by TagEngine.

Spark transformer that expands all DSL entities (reads, forms, calculations, explicit derives, multi_selects, toggles) into field specs at compile time.

Compile-time validation of cross-entity references in the DSL.

Behaviour for bidirectional type conversion between URL strings and Elixir values.