3 ms·
What would it bring in ergonomics and expressivity versus Vue ?
by The_rationalist 6y ago
What would it bring in ergonomics and expressivity versus Vue ?
- kjksf 6y agoThose things really need to be experienced to be understood, so just try Svelte in a toy project. Or go through the interactive tutorial https://svelte.dev/tutorial/basics https://svelte.dev/tutorial/basics I used both React and Vue and am now only using Svelte. You type less. Significantly less. The thing you type is simpler. I tend to get lost in Vue's object structure. What you type is closer to HTML/CSS/JavaScript than what you type in React/Vue. It's therefore easier to understand what gets generated. The seamless reactivity is awesome. Scoped CSS support is built-in so you don't need css-in-js hacks. Built-in support for data (stores) is excellent. The final bundle is smaller and faster. There's more but the above are the major points. The only downside is smaller ecosystem. But I don't care because I'm in the camp of minimizing my dependencies.
- preommr 6y ago> Scoped CSS support is built-in so you don't need css-in-js hacks. vue/react also have scoped css, but built into the building process using loaders rather than being a feature of the frameworks.
- buzzerbetrayed 6y agoLess time setting up build processes is another win you git with Svelte, in my experience.
- nickreese 6y agoI haven't used Vue extensively since what was probably v1 so I'm likely the wrong person to comment on this. That said, I find that Svelte aligns more with my/our team's mental model about how the web should work and that is why went with it for our sites. Just like with Vue you can write your JS/CSS/HTML in a single file, but the reactivity and state management is much easier to reason about than what we've seen elsewhere. - `$:` is great. - Stores and derived stores are amazing. - Data binding / rerendering is really intuitive. That said, the biggest headache in building our own SSG was getting SSR/Hydration working well, but that was mainly fighting Webpack and got easier when we went with Rollup. edit: formatting.