Hacker News new | ask | show | jobs
by _acco 812 days ago
Author here. We did not. We briefly tried Alpine, which I think is comparable?

I think Alpine is cool, but it didn't really stick with the team. I think that's because we were still writing our components in LiveView and sprinkling in Alpine. A big unlock with LiveSvelte was getting to move so much into `.svelte` files, but not converting the whole thing to a SPA. Working in a `.svelte` file gives you a lot of niceties that an Alpine-decorated LiveView component won't (prettier, intellisense, etc).

This approach could totally work with other paradigms, like Alpine and HTMX. I think the key is using LiveView as a backend-for-frontend, so writing all your components in `.htmx` files or whatever.

1 comments

Alpine isn't really comparable to HTMX, though their names often come up together.

Alpine is something like "AngularJS lite," a lightweight JavaScript framework with some similarities to the original version of Angular.

HTMX is a collection of HTML attributes that simplify replacing HTML on your page with HTML partials from your server.

In the article's example of interdependent dropdowns, you'd have HTMX attributes for catching the change event of the first select, specifying the server URL to fetch updated HTML from, and specifying the target to put the HTML into (the second select).

Some have recommended using HTMX for less complicated client-side interactivity and adding AlpineJS to pages that need more. That said, people have built impressive apps just by leveraging HTMX.