News for hackers. Stuff that matters.
Re:Svelte and TypeScript by The_rationalist on Tuesday July 21, 2020 @04:17PM (#23910528)
What would it bring in ergonomics and expressivity versus Vue ?
Re:Svelte and TypeScript by kjksf on Tuesday July 21, 2020 @05:33PM (#23911238)
Those 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

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.

Re:Svelte and TypeScript by preommr on Tuesday July 21, 2020 @09:17PM (#23912941)
> 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.

Re:Svelte and TypeScript by buzzerbetrayed on Wednesday July 22, 2020 @12:42AM (#23913994)
Less time setting up build processes is another win you git with Svelte, in my experience.
Re:Svelte and TypeScript by nickreese on Tuesday July 21, 2020 @05:41PM (#23911308)
I 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.