Generates client-side JavaScript for hybrid components.
Takes the Vize Vue Vapor SFC compilation output and transforms it:
- Replaces
__propswith a bridge-controlled reactive source - Replaces server action bodies with optimistic update + pushEvent stubs
- Adds bridge initialization and props application exports
Summary
Functions
Generate the client JS module for a hybrid component.
Transform Vize's Vue Vapor output for hybrid mode.
Functions
@spec generate(String.t(), PhoenixVapor.Hybrid.Classifier.classification()) :: {:ok, String.t()} | {:error, term()}
Generate the client JS module for a hybrid component.
Takes the raw SFC source and classification, produces a self-contained JS module that can hydrate server-rendered HTML and manage client reactivity.
@spec transform(String.t(), PhoenixVapor.Hybrid.Classifier.classification()) :: String.t()
Transform Vize's Vue Vapor output for hybrid mode.
Performs AST-based rewrites:
- Wraps
__propsaccess in a reactive bridge - Replaces server action function bodies
- Adds bridge exports