logoalt Hacker News

Building optimistic UI in Rails (and learn custom elements)

71 pointsby amalinovictoday at 11:03 AM9 commentsview on HN

Comments

dmixtoday at 7:20 PM

I appreciate how the author compares it to writing Stimulus components and it sounds like there's little real benefit for the day-to-day dev, unless you're doing something fancy and highly reusable in JS.

bdcravenstoday at 3:53 PM

This is actually a very nice primer on how to build custom elements even if you don't use Rails.

usernamed7today at 1:12 PM

FWIW you don't even need to define custom elements to use them: https://html3000.dev/

show 3 replies
phoronixrlytoday at 4:12 PM

Great article, however using raw custom elements goes IMO against Rails' spirit, as it is way too low level, and requires lots of boilerplate to get working.

Stimulus is in the sweet spot for that. Both lean (as opposed to bloated), and not too low level, so that using it does not lead to verbose code. It is one of the very few JS frameworks that IMO do not contribute to JS proliferation, but actually work to reduce the amount of JS written.

hamonryetoday at 4:41 PM

[dead]