5 ms·
The most important part of Svelte, to me, is that it allows me to write web applications in the most elegant possible way. The compiler first approach means we
by FractalHQ 5y ago
The most important part of Svelte, to me, is that it allows me to write web applications in the most elegant possible way. The compiler first approach means we get to choose whatever syntax we want to make the whole process as enjoyable as possible.
The most brilliant part of Svelte was the decision to stay as close to JavaScript as possible, so anyone who knows JS, HTML, and CSS knows svelte. Importing any vanilla JS library is plug-and-play, meaning the community and ecosystem span the entire JS ecosystem. No more x-for-react or y-for-vue.
The unbeatable performance is just a plus for me. The DX is so good that building things is incredibly fun, intuitive, and headache free. I can’t emphasize enough how empowering it is.
It’s so exciting seeing the community grow exponentially lately!!
- KronisLV 5y ago> Importing any vanilla JS library is plug-and-play, meaning the community and ecosystem span the entire JS ecosystem. No more x-for-react or y-for-vue. This makes me feel conflicted. With React/Angular/Vue you're given a stable base upon which to build new components and logic, so most of the libraries end up being vaguely consistent with the underlying tech. With JS libraries it's the wild west once again and before you know it, your components will need 3 different mechanisms of being initialized, their internals will use different approaches, before long you'll have multiple versions of jQuery in there as well and it'll make you consider the downsides of that approach. But maybe I only have that outlook because I've witnessed many such situations of poorly integrated JS libraries and have therefore gotten used to walled gardens.
- rendall 5y ago> With React/Angular/Vue you're given a stable base upon which to build new components and logic Oh you sweet summer child. Wait until you see the multilayered horror of devs insisting on styled components because they never spent the time to learn the specificity rules of CSS; their grabbing at lowdash debounce or react-virtual because they don't have the confidence to build a leaner version themselves; suggesting that core concepts of the web are outdated because they came up in the Age of React. React/Vue/Angular will not protect you from bloated, poorly written apps. I would argue they encourage bad practices.
- yohannparis 5y agoI agree 100%. The number of times someone told me they prefer using Bootstrap classnames while using CSS when they bootstrap does not provide a classname for it... My front-end heart sinks!
- jakelazaroff 5y agoThe purpose of styled components (or CSS modules or what have you) isn't to deal with specificity. It's to deal with collisions between what are essentially global variables.
- rendall 5y agoI don't think you and I disagree. Use the tool appropriate for the job. If the team doesn't have the discipline or will to use the cascade as intended, definitely, better to have a bloated CSS-in-JS that at least is usable, rather than a bloated cascade that people are afraid to use.
- IceDane 5y agoThis is an extremely cringey, gatekeepy reply. It's just missing a "it's nothing personal, kiddo". Good on you if you prefer writing everything from scratch. Some of us have shit to do and goals to meet and we'd rather spend our time on building actual functionality than reinvent the wheel for the nth time.
- dimitrios1 5y agoYour reply is the real cringe here. "I got shit to do" is no excuse to toss aside quality and craftsmanship. And you misread their argument they didn't say write everything from scratch, they said write a simple leaner version, but the argument is most people lack even basic problem solving skills. If you spend all your day glueing things together, you forget how to design and build them yourself. Sure you can stack the blocks in order, and make a really tall tower, but how soon until it falls over, or how will it withstand the first gust of air. That's the larger point. And this isn't "gatekeepy" this is reality. As software continues to eat the world, and most of us are forced increasingly to rely on these shitty apps and interfaces, it could do a little good to the world if Software engineering as a discipline took on a little more professionalism. So less of the "I got shit to do" and "move fast and break things" mentality, and more of the "lets do this right" mentality. Good engineers can write a little utility that solves a problem wonderfully for their context or scope, and still get their shit done and meet their goals.
- FractalHQ 5y agoThis is certainly not my experience. I’ve never had to touch a library with jQuery, and the vast majority of libraries with framework wrappers also have vanilla implementations. The difference being the wrappers need to be updated to keep up with the frameworks, and often have more ways to fail considering they’re often just vanilla libraries + wrapper code. If a library is maintained, the existence of a framework wrapper doesn’t make it any more reliable in my experience.
- mtm7 5y ago> The DX is so good that building things is incredibly fun, intuitive, and headache free. I can’t emphasize enough how empowering it is. Yes! I've been a full-time React developer for about 5 years, and recently had the chance to try Svelte on a small pet project. I'd written most of the project in React and had a free weekend so I figured what the heck – let's see how it'd look in Svelte. :) Within a day most of the functionality was in place, and the code just felt _beautiful_. I loved that it removed so much boilerplate (wrote some examples here[0]), and some of the React headaches (like using "Undo" in a controlled <textarea>) were just gone. The ergonomics (especially the built-in stores, error handling, and <svelte:head>) were lovely surprises! I'm really bullish on it and so happy it's starting to grow. [0]: https://mtm.dev/react-vs-svelte https://mtm.dev/react-vs-svelte
- stoicjumbotron 5y agoReally helpful article. Thinking about diving into Svelte. I'm a huge fan of react-query[0] so I was wondering, is there a good alternative for it in Svelte? Would you recommend svelte-query[1]. Thanks. [0]: https://react-query.tanstack.com/ https://react-query.tanstack.com/ [1]: https://github.com/SvelteStack/svelte-query https://github.com/SvelteStack/svelte-query