DEV Community

Bos Eriko Reyes
Bos Eriko Reyes

Posted on

TIL #001: Svelte does not use Virtual DOM and the Bus Factor

Okay. So I'm thinking of writing a short blog every night before going to bed. This is to improve my writing because I think I suck. So here's what I have in mind, I'll be writing everything that I learn within a day in a piece of paper and then write a blog about it every night here on DEV. With this, I'll be able to share what I've learned, assess my day if I really learned something, and push myself to learn every day. I think it's a win-win strategy.

So what did I learn today? I learned that Svelte does not believe in Virtual DOM and they think it's just a meme. At first, I was very skeptical but after reading the blog about it I was kind of convinced.

I think the "Bus Factor" is also worth mentioning. I read somewhere that having your project open source will decrease the bus factor. What the Bus Factor means (according to Wikipedia), "the measurement of the risk resulting from information and capabilities not being shared among team members, derived from the phrase 'in case they get hit by a bus.' It is also known as the bread truck scenario, lottery factor, truck factor, bus/truck number, or lorry factor."

That's it for today's TIL!

Top comments (4)

Collapse
 
seveneye profile image
seveneye

I wonder why is react still fast even tho it uses virtual dom. At first impression I feel like react website is still faster than svelte website

Collapse
 
boseriko profile image
Bos Eriko Reyes

I haven't seen that many Svelte websites and most (if not most, all of them) of those websites don't have service workers and other stuff like that. Maybe that's why? What do you think?

Collapse
 
jozsefsallai profile image
József Sallai

jozsefsallai.github.io/insomnia-do... - I made this using Svelte. It might be very fast here, but for larger data, it can get slow. A Vue rewrite is planned, mainly just to see which one would be faster.

My experience with Svelte was... interesting. Rather surreal. If there's one thing I don't really like about Svelte it's exactly that - it removes the niceness of having framework abstractions. It's also really difficult (or maybe impossible) to write actual frontend unit tests for your components (since you're mutating real DOM elements instead of vdom). Sure, there are E2E/integration tests, but it's not the same, especially not in terms of speed.

Also, twitter.com/youyuxi/status/1184824...

Thread Thread
 
boseriko profile image
Bos Eriko Reyes

Yeah. Good point. Would love to see frameworks (similar to nuxt or gatsby) that includes built in testing for svelte.