beacon
beacon copied to clipboard
Add support for user-defined client JS hooks
Allow users to pass https://hexdocs.pm/phoenix_live_view/js-interop.html#client-hooks-via-phx-hook to the Beacon livesocket.
The socket is initialized at https://github.com/BeaconCMS/beacon/blob/4dd3b55475eae63fd8594f22510bae6a71c8a9d7/assets/js/beacon.js#L31 and note it does reuse the LiveView
object from the host app and connects to the same socket path. It's important to reuse the same JS client version to avoid misbehavior.
Ideally the hook code should be stored in the DB and changed at runtime in the admin interface but that imposes some challenges on how to inject the js hook code into the socket.
For now according to the team in the backlog. Could come back in Q4