Building optimistic UI in Rails (and learn custom elements)
Posted by amalinovic 5 days ago
Comments
Comment by usernamed7 5 days ago
Comment by yoz-y 5 days ago
Comment by rsstack 5 days ago
> This is used for namespacing and to ensure forward compatibility (since no elements will be added to HTML, SVG, or MathML with hyphen-containing local names going forward).
So things that work today without a dash might break in the future if <badge>, for example, becomes a standard HTML element.
Comment by yoz-y 5 days ago
Comment by faboo 5 days ago
Comment by yoz-y 4 days ago
Comment by lazylester 5 days ago
Comment by dmix 5 days ago
Developers like to copy/paste UI component example HTML from Tailwind/Bootstrap documentation, they like predictability/portability. They don't want a project that's half HTML and half HAML...ie, Vue/React using HTML/JSX vs 50% of Rails views in HAML, 50% old ones in HTML.
Just like how using Vanilla JS is much smoother and reliable than using the latest wrapper framework.
Comment by matijsvzuijlen 5 days ago
I think it's worse than, e.g., typical yaml files because the nesting is deeper.
Comment by cgarvis 5 days ago
Comment by bdcravens 5 days ago
Comment by phoronixrly 5 days ago
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.
Comment by dmix 5 days ago
Comment by bgdkbtv 5 days ago
Comment by michaelyin 5 days ago
Comment by hamonrye 5 days ago