4 ms·
I personally like the separation of concerns that HTML/CSS/JS evangelizes and I feel like it lines up well with how the old school MVC frameworks want you to t
by skgough 3y ago
I personally like the separation of concerns that HTML/CSS/JS evangelizes and I feel like it lines up well with how the old school MVC frameworks want you to think about things.
I think a good middle ground here is that HTML web components article that was shared here a few weeks ago:
https://gomakethings.com/html-web-components/ https://gomakethings.com/html-web-components/
I like this because it's still fairly low-code but you get cool stuff out of the box like attributeChangedCallback. You don't have to mess with build tools, which is what I like the most about this strategy. I can just drop these components into my Rails views like any other element, and their custom functionality gets mounted up as soon as they get folded into the DOM. No more document.querySelectorAll(".foo-bar").forEach(foo => bar()). Much cleaner, and the intent is more clear too. With <foo-bar>, it's much more obvious that the element has scripting attached to it than <div class=”foo-bar">.
- alexpetros 3y agoThanks for sharing this article, I really liked it!