News for hackers. Stuff that matters.
Re:Alpine.js by blowski on Friday January 13, 2023 @08:17AM (#34367241)
I’m glad when tools like Alpine remain in their niche. Too many of them grow with their userbase, adding every requested feature, until they become as unwieldy as the framework they originally tried replacing. If you outgrow Alpine, migrate to another framework instead.
Re:Alpine.js by graftak on Saturday January 14, 2023 @03:50AM (#34378544)
Then why not go with nextjs outright so you can apply the exact amount of interactivity for every little detail on your website without changing your entire setup halfway through.
Re:Alpine.js by blowski on Saturday January 14, 2023 @06:09AM (#34379285)
Next.js is a fantastic solution if you're building a SPA.

Imagine I'm a very early stage startup so I start out with a simple app built on Laravel. All my engineers are relatively non-senior PHP folks, not great at JavaScript. So it's rendered server-side in PHP - easier to achieve enough performance, security, maintainability by leveraging the framework. Then I want to put some tiny bit of client-side interactivity. Going full SPA with Next.js would involve a lot of extra cost and complexity. jQuery and Alpine fit well into that niche, and Alpine particularly helps with reacting to state in a way that jQuery is hard.