There is this little comment in the documentation (on the very bottom, the last code snippet) JavaScript interoperability — Phoenix LiveView v0.20.2 that explains how to interface with existing JS (in that case AlpineJS). I found that bit of code somehow cryptic but I used it as is and it’s working…
If someone has more links about that dom:
and window.___.clone
part I definitely want to learn more about that…
@ityonemo @elcritch I don’t have much experience with Front-end frameworks but I played a little with Vue and more recently with Svelte.
But I guess that it might be easier to do this (attaching liveview with some front end code) with Svelte… Because there is no VDOM or complex runtime code.
Also, Svelte for example has some option to do server-side hydration, so I guess that it could be possible to use liveview to update not only some data but even the views of Svelte components.
Again I’m not that expert in Front-ends but I’ll definitely try some experience soon…
Already tried SS hydration with regular SSR Phoenix…
Anyway, I’m interested in that topic and waiting to read more from you guys!