Shared action analysis and JS generation for optimistic updates.
Used by both ColocatedTransformer (compile-time) and JsGenerator (runtime).
Summary
Functions
Checks if an action has transpilable client-side operations (sets/updates).
Analyze a value to determine how to generate JS for it.
Normalize a dependency to its root field name as a string.
Functions
Checks if an action has transpilable client-side operations (sets/updates).
Actions with effects, submits, navigates, or invokes can still be partially optimistic — the sets run client-side immediately while the server handles the side effects.
Analyze a value to determine how to generate JS for it.
Returns:
{:rx, source}for rx() expressions{:literal, value}for simple literals:from_params_valuefor param accessors:unknownfor non-transpilable values
Normalize a dependency to its root field name as a string.
Path deps like {:path, :params, ["name"]} become "params".
Atom deps like :count become "count".