Hacker News new | ask | show | jobs
by atonse 813 days ago
I've wanted something like this for Vue/React too with LiveView, because then you get access to this massive ecosystem of great components to put in your phoenix apps while still utilizing LiveView. (the LiveView component ecosystem is tiny).

So maybe this can be the start of a general bridge that can bridge LV with React or Vue components too? And make it easy to put these in a page and interact with LV events, etc.

3 comments

I created a useLiveView() hook a couple of years ago for a couple of personal side projects. It was pretty straightforward and let me have bi-directional state.

The only big downside is you also need to setup server side React rendering for the initial load if you care about SEO.

Maybe I should dig it up and post it in a gist somewhere (I don't want to maintain an open source library for it).

There is an adapter already for Inertia.js and Phoenix. https://github.com/devato/inertia_phoenix
I've recently developed a LV/React bridge and am using it on a production app, but nothing open sourced at the moment. I'll open it up at some point soon and try and post back here!
Even putting it in a gist would be a great start! Looking forward to it.