PhoenixKitBoards.Web.AssetController (PhoenixKitBoards v0.4.2)

Copy Markdown View Source

Serves this module's collaboration hook bundle.

The bundle is what makes a board collaborative — without it a peer's edits and cursors never arrive, though the page renders and local edits still save, so the failure looks like "collaboration is broken" rather than "the JS didn't load".

Getting it into the page used to be the host's job: declare js_sources/0, add :phoenix_kit_js_sources to compilers, carry a <script> tag. A host that bundles dependency JS its own way got none of that, and nothing said so. Now the board page asks for the bundle from here, so the only thing a host has to do is depend on this module.

Read once at compile time rather than from priv per request: it is 40 KB, it cannot change while the VM is up, and it removes any question of priv_dir resolving differently inside a release.

Summary

Functions

The bundle's content digest.

Functions

digest()

The bundle's content digest.

Rides on the URL as a query parameter so the response can be cached indefinitely and still be replaced the moment the module is upgraded.

js(conn, params)