5 ms·
Having talked to a ton of friends about Svelte, Typescript support has always been the biggest push-back for adoption. Stoked for Svelte to support it. We've
by nickreese 6y ago
Having talked to a ton of friends about Svelte, Typescript support has always been the biggest push-back for adoption.
Stoked for Svelte to support it.
We've been using Svelte in production and I can't speak highly enough about the developer experience. Absolute game changer for our ssite that use it.
- The_rationalist 6y agoWhat 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.
- G4BB3R 6y agoDo you use pure svelte or with sapper? how is it compared to react?
- nickreese 6y agoWe wrote our own SSG for https://elderguide.com https://elderguide.com. We tried Sapper but our data flow and routing needs were to complex and not a fit. Svelte is a dream compared to React. That said, I've never felt like React was the right solution for the problem. I've extensively used Gatsby and for static sites, React is absolutely overkill. For apps it can be nice. In both cases my go-to these days is Svelte.
- uxcolumbo 6y agoNice site and real snappy. I haven't used Svelte yet - but am interested. Can you explain a bit more about what you mean with your data flow and routing needs were too complex for Sapper. And what makes Svelte a dream compared to React?
- nickreese 6y agoSapper's data flow uses a file based routing system similar to /blog/[id].svelte becomes /blog/:id/. If you are familiar with Next.js then you'll recognize this. Our primary problem with Sapper is that we wanted our URL structure to be such that you can't tightly route a template/view by just looking at their URL. /senior-living/blog-post/ and /senior-living/nursing-home-name/ need to live side-by-side. This forced us to build our own custom routing system, what we call an "inverted router" for our SSG. Also we found it less than elegant to use DB queries with Sapper and had a lot of concerns about what was actually on the client and what wasn't. As for why we swear by Svelte: * Bundle size. For SEO focused sites React is overkill. * Stores compared to Mobx or other state management * $: reactivity * No css-in-js hacks required. Css is automatically scoped, but can be easily globally scoped. * Single file components are just beautiful. * We've built in the ability to SSR our entire site, but only hydrate the parts that need to be. This is a game changer for page size and not pushing your data twice to the client.
- rawoke083600 6y agoI LOVEE Svelte, if your any sort of dev... try it out. It's a super small API, you can learn in a few hours. I'm not a frontend dev by trade, but compared to Angular(prev fav) it's soo much simpler.