stryrckt
Support for AlpineJS in LiveView was added in 0.13.3 and it works fabulously. I just wrote a blog article about it and plan another one soon on transitions with AlpineJS and Tailwind CSS.
Trending in Blog Posts
The code in this post is Erlang, but it all applies to Elixir binaries just the same: how appends, match contexts and sub-binaries behave...
New
eMudhra’s leaked CA keys reached my Phoenix app through 2 trust stores, and my first redeploy patched neither. How I fixed the OS bundle ...
New
A deploy killed my OTP processes but not the containers running my AI agents. That mismatch kept a kanban card “executing” for eighteen h...
New
My first real blog post is up! Got five minutes? Come break some stuff. I put five demos in it, and they’re meant to be played with. Kill...
New
I run a kanban of AI coding agents, and one afternoon the board showed three tasks running while the profile page on the same screen said...
New
Following up on Making `dns_erlang` fast: binary tricks for the BEAM, there’s our second post in our series on making erldns, an authorit...
New
A small quality-of-life improvement to my blog that makes it easier to keep technical posts up to date with a revision history.
https://...
New
Other Trending Topics
Hey there,
I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first.
...
New
Hi everyone :waving_hand:
I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly)
AI dream has many faces, but general...
New
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #code-sync
- #discussion
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #elixirconf-us
- #full-time-contract
- #podcasts-by-brainlid
- #blog-post
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #elixirconf-eu
- #processes
- #security
- #api
- #forms
- #performance










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
webuhu
Thanks for your really good read.
it took me a long time until I’ve settled to used Phoenix).
I’m always very skeptical in using any framework (
Anyway Alpine.js could by a candidate to use.
But I’ve one question:
What’s the real benefit in using spruce for state management?
Isn’t the usage of
localStoragenot just enough or even better.Sprouce seems to store the state in
window- so it’s always just available in the current browser tab.With
localStorageI could manage to sync state across tabs, right?I just can’t see the benefit in using, but please convince me of the opposite.
stryrckt
You can certainly use localStorage from Alpine, as this article demonstrates: Sync Alpine.js x-data to localStorage/sessionStorage · Code with Hugo. So if you are skeptical about pulling in another framework, it is probably good enough.
For me, Spruce is nice because it integrates well with Alpine, allows you to watch for changes in state, and it works with
x-model.webuhu
Hmm, I need to prototype and check out
x-model. Thanks.stryrckt
I just published a follow-on article showing how to use AlpineJS and Tailwind CSS to create LiveView modals.
sreyansjain
I was trying to integrate Apline and Phoenix LiveView and your blog posts have been of great help. Thank you for sharing your knowledge with us.
I have a question, what if we have multiple components on a page that want to register for Alpine Hook.
For ex
How do you create uniqueness above?
So i tried to do CustomEvent dispatch and get the push_element. This works -
But the above doesn’t work when the EscapeHook element is put inside a conditional. For ex -
How can we make it work inside a conditional?
Thank you once again for taking the time to enlighten us all.
stryrckt
Nothing is obviously wrong to me. I frequently use Alpine in conditionally rendered markup. I have an example of that in my article on modals. See the alternative modal implementation section.
sfusato
Try adding an
idon the container div inside the conditional. See if that makes any change.mfilej
I’m really excited to try this out. I just tried adding AlpineJS to a LiveView project (following this post) and the browser console is now reporting this issue:
And I couldn’t google out anything that would apply (I can see lots of issues related to babel).
I
npm install-ed AlpineJS 2.8.2.Sebb
so you did this?
When I did this I had trouble with latest node, so I downgraded to node 14.
With latest phoenix (not really, 1.5.7 actually), node 14 and AlpineJS 2.8.1 (2.82 should not make a difference) it just works (under ubuntu 20.4). All I got to do is
And the patch above.
Obviously you have to start from a working
phx.newmfilej
Yes, all of the above is correct. Except I’m on node v10.24.1 and Elixir 1.5.8.