Live data from Hacker News

Alpine.js Magic Helpers Library

github.com

1–10 of 19 posts

Re: Alpine.js Magic Helpers Library

#2
This is really cool. I absolutely love Alpine, and a lot of these look like they could come in quite handy.

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.

Re: Alpine.js Magic Helpers Library

#4
Alpine.js is one of those ideas that filled a massive void many people didn't even know existed (I certainly didn't, though was subconsciously annoyed with the options). Data-centric, declarative template rendering was married to SPA frameworks, which are very good at what they do but are often overkill. Alpine cut development time in half for one of my projects and I'm looking forward to reaching for it again.

Re: Alpine.js Magic Helpers Library

#5

Alpine.js is one of those ideas that filled a massive void many people didn't even know existed (I certainly didn't, though was subconsciously annoyed with the options). Data-centric, declarative template rendering was married to SPA frameworks, which are very good at what they do but are often overkill. Alpine cut development time in half for one of my projects and I'm looking forward to reaching for it again.

From what I can see, Alpine is an SPA framework.

Re: Alpine.js Magic Helpers Library

#6

Alpine.js is one of those ideas that filled a massive void many people didn't even know existed (I certainly didn't, though was subconsciously annoyed with the options). Data-centric, declarative template rendering was married to SPA frameworks, which are very good at what they do but are often overkill. Alpine cut development time in half for one of my projects and I'm looking forward to reaching for it again.

Could you say a little more about the sort of project you’d use Alpine on? “filled a massive void many people didn't even know existed” is certainly intriguing!

Re: Alpine.js Magic Helpers Library

#8

Alpine.js is one of those ideas that filled a massive void many people didn't even know existed (I certainly didn't, though was subconsciously annoyed with the options). Data-centric, declarative template rendering was married to SPA frameworks, which are very good at what they do but are often overkill. Alpine cut development time in half for one of my projects and I'm looking forward to reaching for it again.

AFAIK, Vue filled that void before alpine. and alpine is micro Vue to be used when your needs are so small, that vue becomes an overkill.

is there any other advantage of alipne over vue, aside from file size?

Re: Alpine.js Magic Helpers Library

#9
post #8

Alpine.js is one of those ideas that filled a massive void many people didn't even know existed (I certainly didn't, though was subconsciously annoyed with the options). Data-centric, declarative template rendering was married to SPA frameworks, which are very good at what they do but are often overkill. Alpine cut development time in half for one of my projects and I'm looking forward to reaching for it again.

AFAIK, Vue filled that void before alpine. and alpine is micro Vue to be used when your needs are so small, that vue becomes an overkill. is there any other advantage of alipne over vue, aside from file size?

Zero build tooling is necessary with Alpine.js, just import it through a script tag, ES module script import, etc. and you're done. No webpack setup, no bundling--nothing. Vue can be used like that too but from what I understand there are some tradeoffs (and it should be noted the modern wave of near zero config build tools like vite, snowpack, etc. easily bundle and build components like vue automatically too).

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.

Re: Alpine.js Magic Helpers Library

#10
post #6

Alpine.js is one of those ideas that filled a massive void many people didn't even know existed (I certainly didn't, though was subconsciously annoyed with the options). Data-centric, declarative template rendering was married to SPA frameworks, which are very good at what they do but are often overkill. Alpine cut development time in half for one of my projects and I'm looking forward to reaching for it again.

Could you say a little more about the sort of project you’d use Alpine on? “filled a massive void many people didn't even know existed” is certainly intriguing!

Sure! Basically we had a thorny problem that needed to be solved on the frontend- users would be picking a plan, adding a payment, and possibly applying a promo code. JS is a prerequisite for Stripe payment collection and in general this solution would have been a non-starter in a backend template. But this was the only such page in the application, so it really felt like overkill to integrate an SPA like Vue or React. Vue's drop-in CDN is close, but there's still some setup boilerplate that was nice to do without.
Post reply on HN