Svelte with Rich Harris
LogRocket
Channel
Interviewed Person
Rich Harris
Description
0:00 Introduction 3:14 When should developers use Svelte? 5:19 How does Svelte perform without a virtual DOM? 8:03 What is Svelte's approach to managing state? 12:16 Could React reduce their boilerplates the way Svelte does? 18:20 How does templating work in Svelte? 21:13 How have React and Vue become more Svelte-like? 24:14 What is SvelteKit? 28:40 The future of Svelte 30:14 The future of front-end development 32:36 Differences between Svelte and React 36:00 Is Svelte an underdog? About the episode We interview Rich Harris about Svelte's position in the landscape of frameworks, how other popular frameworks are becoming more Svelte-like, how Svelte handles state, how SvelteKit works, and more! NOTE: This is the video recording of the podcast. You can listen to the audio-only version of the episode at https://podrocket.logrocket.com or wherever you get your podcasts. LogRocket PodRocket was created by LogRocket. LogRocket is a frontend monitoring solution that combines session replay, performance monitoring, and product analytics to help software teams create an ideal product experience. Try LogRocket pro for free: https://logrocket.com/podrocket Links https://twitter.com/Rich_Harris https://svelte.dev/ https://kit.svelte.dev/ https://github.com/sveltejs/svelte https://github.com/sveltejs/kit https://svelte.dev/chat https://twitter.com/sveltesociety
Transcript
Hey, everyone, welcome to PodRocket. Today I'm here with Rich Harris, who's the creator of Svelte. How are you, Rich? I'm good, thanks. How are you? I am doing well. It's been raining the past few days but excited for hopefully a decent
weekend. And I'm excited to talk to you. I've been hearing a lot about Svelte over the past few years, but I honestly have not done a deep dive myself so I'm excited to learn about it from you. So maybe you could give us a quick introduction. What is Svelte? How does it help build great web apps? Oh, man. You think that I'd be really good at giving an answer to this question by now, but I've yet to fully dial it in. Essentially, if you're familiar with front end frameworks,
like React and Vue, then you'll be familiar with the basic idea of Svelte, which is that it makes building robust web applications easier, instead of imperatively manipulating the DOM with document.createElement and all of the things that are provided by the platform. It puts a declarative layer on top of that so that you can describe the output that you want, and then the framework's job is to translate that into the underlying DOM manipulations.
Where it differs from those frameworks is that it does as much of the work as possible at build time instead of at runtime. And what I mean by that is that rather than creating a structure like a virtual DOM which then has to be reconciled against what's already on the page, Svelte analyzes your code during your build step and converts it into, essentially, vanilla JavaScript or as close to possible as what you would write if you are writing
your code by hand. And so because of that, it's able to deliver a few important advantages. It generates typically very small code, which means that your application is going to load very quickly, and the updates, when you have a state change within your application, also take place very quickly, because it doesn't need to regenerate your entire application. It's just surgically updating the part of the page that's affected. I should say at this point, because this is what I've been telling people about Svelte
since it first came around in 2016, the landscape has actually shifted a little bit and other frameworks are, in many cases, becoming a little bit more Svelte like. So when I talk about these unique advantages, they're not so unique anymore. Svelte's selling point these days is really more about the developer experience it provides. Vue, in particular,
has adopted a lot of these techniques and also has some of those bundle size and performance characteristics. But that's the basic gist. That's why Svelte exists, and the promise that it provides developers. And is there an ideal use case for Svelte? Would you say use Svelte for any type of web app on building, or does it tend to work better in maybe simpler or more your application where performance is maybe or bundle size is of more concern? When should people think
about using Svelte? Well, I should talk about where Svelte came from, because that indicates what it was initially designed for and what we initially thought of as being the sweet spot. I work as a graphics editor at the New York Times. I've been working in interactive journalism for most of my career. And Svelte was really designed to solve the problem that we had, which is we want to build these very highly-interactive applications. Typically, we're doing things like data visualization
Video Details
- Duration
- 40:52
- Published
- October 5, 2021
- Channel
- LogRocket
- Language
- ENGLISH
- Views
- 7,921
- Likes
- 247