Handles automatic JavaScript hooks integration for PhoenixKit installation.
This module:
- Copies
phoenix_kit.jsto the parent app'spriv/static/assets/vendor/ - Adds a
<script>tag to the root layout so hooks are loaded before LiveSocket
The JS file defines window.PhoenixKitHooks which is spread into LiveSocket's
hooks object in app.js: hooks: { ...window.PhoenixKitHooks, ...colocatedHooks }
Summary
Functions
Copies phoenix_kit.js to the parent app's static vendor directory and adds a script tag to the root layout.
Updates the JS file in the parent app's static vendor directory.
Called during mix phoenix_kit.update to keep hooks in sync.
Functions
Copies phoenix_kit.js to the parent app's static vendor directory and adds a script tag to the root layout.
Safe to run multiple times (idempotent).
Updates the JS file in the parent app's static vendor directory.
Called during mix phoenix_kit.update to keep hooks in sync.