PhoenixAssets.Electric (PhoenixAssets v0.1.0)

View Source

Integration plugin that generates a typed ElectricSQL client from declarations.

Reads the shapes declared in the module passed as shapes: (see PhoenixAssets.Electric.Shapes) and emits electric.ts -- a ShapeStream factory per shape, typed by the shape's row type. Each factory takes a params map whose route placeholders are required, typed keys (the rest become query params), and is built through @phoenix-assets/svelte: the URL via createShapeUrl/2 and, critically, the request's auth headers via authHeaders/0. Also contributes graph entries and a doctor check per shape that the route exists in the router.

Summary

Functions

dev_processes(_, _)

Callback implementation for PhoenixAssets.Plugin.dev_processes/2.

name()

Callback implementation for PhoenixAssets.Plugin.name/0.

vite_config(_, _)

Callback implementation for PhoenixAssets.Plugin.vite_config/2.