I also quite enjoyed Svelte.
I have very little interest in touching the DOM imperatively when a declarative option exists.
11–20 of 41 posts
I also quite enjoyed Svelte.
I have very little interest in touching the DOM imperatively when a declarative option exists.
I'm not saying jQuery or vanilla JS (which is the same thing, just a different API) is the end-all of everything, but with a bit of care and organisation it's not too hard to make dynamic "modern" sites and even web apps that are fast and can be maintained fairly easily. It is easy to make a mess of things though, as it doesn't guide you through a "framework" and especially in larger teams with different experience/skill levels this can be an issue.
At the end of the day I think this is a "Python vs. Ruby" type of discussion, where both can obviously work well, but both obviously also have their own strengths and weaknesses.
I dislike a certain section of the frontend crowd who thinks that going full-in on WebPack+React+TypeScript+1561 dependencies is the only possible way to build something useful and derides anyone who disagrees (at some point someone called me "the anti-vaxxer of frontend development" over this).
Or just use vanilla JS
I like being able to do elem.remove() instead of elem.parentNode.removeChild(elem), and elem.prepend(other) instead of elem.insertAdjacentElement('afterbegin', other). There's loads of stuff like this. The DOM API does not spark joy.
Earlier quoted context omitted.
Or just don't use JS
Modern CSS and HTML's built in elements are better at a lot of the things people use JS for. I think as coders we feel most comfortable reaching for JavaScript first, when really we should be doing as much in HTML itself as possible, then prettying it all up with CSS, and then finally adding some JS for interactivity such as client side form validation.
Earlier quoted context omitted.
I like being able to do elem.remove() instead of elem.parentNode.removeChild(elem), and elem.prepend(other) instead of elem.insertAdjacentElement('afterbegin', other). There's loads of stuff like this. The DOM API does not spark joy.
Those exist now: https://developer.mozilla.org/en-US/docs/Web/API/Element/rem... , https://developer.mozilla.org/en-US/docs/Web/API/Element/pre...
I have 2 production Svelte projects completed, and it is a charm to work with.
Or just use vanilla JS
I'm quite happy with Vue, and the Vue HTTP component loader so I don't have to deal with the build process in Python apps. I also quite enjoyed Svelte. I have very little interest in touching the DOM imperatively when a declarative option exists.
Even just a naive approach of plopping a whole page in one big component or enhancing a page rendered elsewhere by mounting a few self-contained widgets on it is nicer than manually keeping track of state with events. Even my best an most concerted efforts at jQuery frontends eventually had many bugs that simply don’t happen with a declarative approach.
Earlier quoted context omitted.
Modern CSS and HTML's built in elements are better at a lot of the things people use JS for. I think as coders we feel most comfortable reaching for JavaScript first, when really we should be doing as much in HTML itself as possible, then prettying it all up with CSS, and then finally adding some JS for interactivity such as client side form validation.
Indeed, and even a lot of client side form validation can be done using HTML and CSS: https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_va...
You can work around them, but you’re approaching the complexity of just writing your own validator by that point.