105 points · by kbatdorf · 5y ago · 17 comments
Alpine looks like Vue without computed properties.
is there any other advantage of alipne over vue, aside from file size?
I think from a usage perspective Alpine.js puts you more into a progressive enhancement mindset and focus too. With vue if you want to make something that's mostly static but with some dynamic flourishes you need to go deep down a rabbit hole of SSR, static site gens, Gridsome, etc. etc. and it can really make your head spin. With Alpine.js just write HTML and CSS, then add a bit of interactivity where it's needed--you can be done with an entire project in the time it takes to understand and setup an isomorphic SPA.
wait, what? that is not true. if you want a sprinkle of interactivity, you include vue with script tag and write small components over your html & css, jsut like you do with alpine
alpine actually takes the inspiration from vue in terms of this. but is optimised for small file size.
Alpine doesn't have any of those (eg. the devtools for it are a community project).
Phoenix
Elixir
TailwindCSS
AlpineJS
LiveView
TIL (by reading the source code) that you can add your own $functions to Alpine as well! I will definitely be making use of that functionality at some point.
There's a template repo/file you can use in that org https://www.github.com/alpine-collective/plugin/tree/master/....