3 ms·
Why did you decide going old school using Alpine.js instead of using plain vanilla web components?
by o_m 1y ago
Why did you decide going old school using Alpine.js instead of using plain vanilla web components?
- edoceo 1y agoAlpine is old school now?
- o_m 1y agoI'd say anything new in 2025 that involves working with the DOM that doesn't use web component is a waste. Lately I have been porting some old JS libraries (7+ years old) that still are visually impressive to web components, and in my experience after porting some libraries there is about 30% fewer lines of code. Before web components there was so much work to get things up and running in the DOM. Alpine.js does this behind the scenes, but there isn't really a need for it anymore.
- edoceo 1y agoI've been using RiotJS when I need partial component support - wasn't an all-in thing like React ; and I thought HTMX and Alpine are also good for these partial upgrades. Maybe WebComponents are fully supported now? (I can't keep up)
- 1oooqooq 1y agohttps://caniuse.com/?search=web%20components https://caniuse.com/?search=web%20components
- hunvreus 1y agoI did seriously consider it, but again that was about trying to solve the problem in the least opinionated way. Which is also why I made the Alpine code as unobtrusive as possible. You can get away with using purely the CSS if you don't need dialogs or combobox. And you can plug your own JS if you decide to do so. However, I will definitely try and see if I can make a web components version as soon as I have some time.