React VS Svelte - Which one should you choose in 2024? ft Rich Harris

about 1 year agoJuly 26, 2024
26:05
48,815 views
1,196 likes
P

Prismic

Channel

Interviewed Person

Rich Harris

Description

You’re starting a new web project and you’re hesitating between Svelte and React? We've got you covered! We brought Rich Harris, the creator of Svelte, to the Prismic studio to give you a full evaluation of those options. Spoiler: Rich knows more about React than you might imagine 🤯 — 🔗 Getting started with Sveltekit? Watch our latest full courses featuring Svelte / GSAP / Tailwind and Prismic: - https://youtu.be/v5Ncz5AcXjI - https://youtu.be/JQAbenI2YTA 🔗 If you’re a React lover, get started with Next.js and Prismic: - https://youtu.be/rXDCAAkiC-s - https://youtu.be/Cc37uTnbEos #svelte #react

Transcript

Group by:

So, you're starting a new web development project and you need to decide if you want to use React or Svelte. Well, my guest today can give you a proper, unbiased evaluation of the two. I'm here with Rich Harris, creator of Svelte. Rich, thanks so much for joining me. - Thanks for having me. - So Rich, how much React have you written in your life? - Enough to be pretty familiar with how it works. I haven't built any substantial applications with React, but I am the guy that people will sometimes come to for help with their React code because as a framework author, you know,

you got to study the enemy. - I'm glad we got that clip on camera, perfect. So, you know enough React to be dangerous. I have a question about this and it's following a little bit on a conversation you had with my colleague, Alex, a few months back. You guys were talking about how Svelte is a compiled language and React is a runtime language. I want to know, do you think that that gives Svelte kind of like an unfair advantage?

- It gives us, the makers of Svelte, a bit of an advantage in that we have just a much larger space in which to search for solutions to problems because we're not trying to shoehorn everything into, you know, a language that I would argue is fundamentally badly designed for the task that we put it to. Like I don't think that JavaScript is a good language for describing user interfaces. And a rendering framework's job is essentially to try and bully JavaScript into being suitable for UI development.

HTML on the other hand is a great language for describing user interfaces as long as they're static. And so for me, the gap between, you know, HTML and a good language for describing user interfaces is just adding some interactivity. Whereas the gap between JavaScript and a good language for user interfaces is much larger. So there are definite advantages from a design standpoint, but in other ways, it's definitely not an advantage.

Like in terms of being able to use existing tooling and things like that, like most frameworks don't have to write their own type checker. Like we have to have this separate package for type checking inside Svelte components and things like that. So it swings around about, I think we made the right choice. You know, your mileage may vary. A lot of people just fundamentally don't want to touch anything that isn't JavaScript. And that's fine.

But I would say it gives us an advantage, but certainly not an unfair one. And, you know, a lot of frameworks are adopting compilers themselves. Like last week, React 19 was announced, and it has a compiler. It's experimental for now, but React now has a compiler. Most frameworks have a compiler. And I think we're starting to see a broad agreement that the more work you can do before your application runs, the better it's going to be for users.

And so there's, you know, different ideas about what a compiler means. Like one of Twitter's favorite topics to discuss is the exact meaning of the word "compiler." But it seems like everyone is kind of drifting in that direction. So, you know, while we are probably the framework that is most strongly associated with the idea of compilers, I don't think it gives us a leg up over everyone else anymore. But I hear what you're saying that React has a compiler, Vue has a compiler, but

there's still languages that are fundamentally designed for runtime. Do you think it's inevitable that compile time, since increasingly all web, all code that we write for the web is compiled or transpiled or whatever inevitably, do you think it's inevitable that compiled languages, whether Svelte or some other up-and-comer, will eventually overtake languages that are designed for runtime? I wouldn't say inevitable, no. There have been more

53 segments (grouped from 742 original)4278 words~21 min readGrouped by 30s intervals

Video Details

Duration
26:05
Published
July 26, 2024
Channel
Prismic
Language
ENGLISH
Views
48,815
Likes
1,196

Related Videos