anuaralfetahe

anuaralfetahe

Phoenix LiveView compatibility with Alpine.js

Hello, I’m planning to create a Phoenix Liveview application. I need some guidance on the JS side.

I’ve researched the topic and concluded that Alpine.js may be the way to go for me. I have experience with Vue and Angular, but this time I prefer something lightweight that works well with LiveView.

Lately, I’ve started to have some doubts. My main concerns are:

  • compatibility issues where HTML updates on LiveView components break the Alpine.js virtual DOM
  • mixing data and code and bloating the HTML

Could anybody share their experience with LiveView + Alpine.js or recommend any other combination instead?

Thanks :slight_smile:

Most Liked

cmo

cmo

I used to use it but I much prefer to use Phoenix.LiveView.JS commands and LiveVIew Hooks these days. I don’t find Alpine to be worth the hassle of having to deal with the compatability with LiveView or the additionaly bundle size.

slouchpie

slouchpie

You might be interested in this thread:

markevans

markevans

For many apps with LiveView probably don’t need a “JS-side” as such (the JS module can do some basic stuff).

When LiveView doesn’t cut it and you do need JS, personally I’d recommend rendering frontend JS components here and there (most frameworks allow you to sprinkle components here and there on the page - the whole page doesn’t need to be an SPA).

My go-to would be Svelte - for that you could use LiveSvelte or you could use a library I recently published Komodo

Last Post!

anuaralfetahe

anuaralfetahe

Thank you all for the replies.

I will check out those leads as well before making the decision.
Solid.js seems viable option too right now.

Where Next?

Popular in Discussions Top

ben-pr-p
In general I’ve been sticking to this community style guide GitHub - christopheradams/elixir_style_guide: A community driven style guide ...
New
acrolink
How does the two languages compare when it comes to server side application development? Any experiences or ideas? Thank you.
New
PragTob
Hello everyone, I know we had quite some threads (read through lots of them) about background job processing but it remains a hotly deba...
New
Fl4m3Ph03n1x
Background This question comes mainly from my ignorance. Today is Black Friday, one of my favorite days of the year to buy books. One boo...
New
RudManusachi
What configs will make sense to put to runtime.exs? – A bit of how I configure apps: I have generic configs in config/config.exs, dev...
New
cvkmohan
The upcoming Phoenix 1.6 release looks very interesting. Became a habit to watch the commits - and - what they are bringing in. phx.gen...
New
AstonJ
Can you believe the first professionally published Elixir book was published just 8 years ago? Since then I think we’ve seen more books f...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement