beacon icon indicating copy to clipboard operation
beacon copied to clipboard

Add support for user-defined client JS hooks

Open leandrocp opened this issue 1 year ago • 1 comments

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.

leandrocp avatar Jul 13 '23 16:07 leandrocp

For now according to the team in the backlog. Could come back in Q4

AZholtkevych avatar Aug 03 '23 19:08 AZholtkevych