DEV Community

Cover image for Svelte. What is your opinion about the lightweight JS framework?
Dennis Frijlink
Dennis Frijlink

Posted on

Svelte. What is your opinion about the lightweight JS framework?

Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue do the bulk of their work in the browser, Svelte shifts that work into a compile step that happens when you build your app.

Instead of using techniques like virtual DOM diffing, Svelte writes code that surgically updates the DOM when the state of your app changes.

As we all know the popularity of Svelte is at the moment way lower than other JS frameworks/libraries like React.js or Vue.js, but that is no reason for Svelte to lose the game.

Alt Text

So what's your opinion about Svelte? Will Svelte continue with growing and will it become more popular than popular frameworks/libraries like React or Vue? Or will it at the end become a forgotten project?

Top comments (25)

Collapse
 
kansuler profile image
Simon Wikstrand

It's very promising, I like it a lot.

The development experience is still young, so there is a few things that require config a know-hows, but that will get better with time.

Now, I'm very excited for SvelteKit + Snowpack. Going to write my next project in this.

Collapse
 
dennisfrijlink profile image
Dennis Frijlink

Nice to know! I heard en saw a lot about Svelte and I'm very excited.

Collapse
 
andreidascalu profile image
Andrei Dascalu

Not sure. But the concept is great and performance is worlds ahead of React & Co.

Collapse
 
dennisfrijlink profile image
Dennis Frijlink

Thanks for your reply. Performance is indeed a big benefit of Svelte against React or Vue.

Collapse
 
andreidascalu profile image
Andrei Dascalu

Also, I like it a lot but my issue with adopting it is that I haven't found a way to reliably introduce itbin a legacy project that uses a lot of jQuery.
React is friendlier with this approach despite the performance impact.

Thread Thread
 
dennisfrijlink profile image
Dennis Frijlink

Aah okay. Nice to know. So React is more flexible than Svelte. Thanks for your reply!

Thread Thread
 
shriji profile image
Shriji

React is more flexible care to explain?

Thread Thread
 
dennisfrijlink profile image
Dennis Frijlink

Yeah if you want :)

Thread Thread
 
shriji profile image
Shriji

Yeah, please go ahead how react is flexible?

Collapse
 
matiaslopezd profile image
Matías López Díaz

We're starting to use Svelte in pieces of our products on the basis of performance, bundle size, and easy implementation. An example is we created in 48 hours a complete piece of or product with Svelte at the same time we learned it. Meanwhile, with Vue, we take 1 week. We don't use React because is complex and slow.

So, I believe that Svelte is a perfect framework to do things that need to be fast, lighter, and not too complex.

When I talk about fast is related to a project where update DOM will be critical and can take a lot of CPU to process, and/or you need a small bundle to not waste too much bandwidth with third-party libraries like Vue, React, etc.

The other thing that is awesome is that you can copy the single dist file and paste it in the dev tools console and works, simple.

We still using Vue to develop dashboards, for example.

Collapse
 
dennisfrijlink profile image
Dennis Frijlink

Thanks for your reply! I love Svelte for its simplicity. So you're using svelte for your "basic" applications and vue for the more complex ones?

Collapse
 
matiaslopezd profile image
Matías López Díaz

Mmmh I don't if I can call it complex or simple, because, for example, we need lightweight pieces on our platform like WebRTC, which in itself is too complex and consume a lot of CPU, but it's not an app with a lot of pages, components, and reactivity. In that context we use Vue, but recently with Svelte, we saw that the performance was improved 10x or 20x and CPU consumption was 20x lower (DOM update).

Also, our widget is integrated on our customer's websites and the bandwidth consumption was reduced 15x lower than with Vue. (bundle size)

So, for us, Svelte is truly awesome for that type of uses cases.

Thread Thread
 
dennisfrijlink profile image
Dennis Frijlink

Nice to know! Thanks for your reply

Collapse
 
giorgosk profile image
Giorgos Kontopoulos 👀

I think it has a good chance to compete against the other frameworks. Apps seem to be easier to be built and it is easier to be productive with it than with other frameworks so perhaps it can pick up pace and get some nice apps out in the wild and get even more people join in for the FUN.

Collapse
 
dennisfrijlink profile image
Dennis Frijlink

Yeah I heard a lot of the simplicity of learning Svelte.

Collapse
 
feldev profile image
Félix Paradis

I think there are 2 options:
1- Svelte "wins" because the compiler approach makes way more sense
2- React and/or Vue and or something else "wins" because they adopt the compiler approach. (Or something even better we haven't seen yet... don't ask me what that could be.)

I come from an Angular.js background and started using Svelte rather than React for my personal projects because, not only does the philosophy make more sense to me, but it was much easier to learn. React kinda feels like it's not embracing the platform enough to me, to be fair, I have not given it a proper try.

Another thing I want to touch on is Vanilla JS. I built a website with Routify (a Svelte router) and a few months later, wanted to update that site. Quickly I found out that a bunch of breaking changes have happened and a bunch of basic stuff like plugging a CMS into the framework is not documented. I really felt the meaning of "bleeding edge" that day.
You know what never gets breaking changes and has a ton of documentation? Vanilla JS. I think many new devs jump right into React/Vue/whatever and don't learn to think in plain HTML/CSS/JS, but you can do a ton of cool stuff without a ton of dependencies.

This is becoming a blog post... But, ehm, yeah. TL;DR Svelte is pretty cool

Collapse
 
dennisfrijlink profile image
Dennis Frijlink

First of all thanks for your answer. It's nice to hear that Svelte is worth a try.

Second I strongly agree with your last part of the comment/post. For new developers I strongly disagree to start with a framework or library. Frameworks are useful for production, but learning JS with starting with a framework will limit a developer by learning new things in the future and how it really works behind the scenes.

Thanks again for you answer

Collapse
 
edm00se profile image
Eric McCormick

It's fast, efficient, requires little cognitive load to learn making it easy to pick up.

Collapse
 
dennisfrijlink profile image
Dennis Frijlink

Thanks for your anwser. You think Svelte will keep growing in popularity?

Collapse
 
edm00se profile image
Eric McCormick

Definitely. So long as developers continue to be inspired by its ease of use, it absolutely will.

Collapse
 
codebyjustin profile image
Justin

Haven't tried it. I'm married to Angular at this point, lol.

Collapse
 
shriji profile image
Shriji

The future is compiler based frameworks and I use svelte a lot and it not only improves the performance but also the time to deploy as you take less time to code stuff!

Collapse
 
dennisfrijlink profile image
Dennis Frijlink

Nice to hear!

Some comments may only be visible to logged-in visitors. Sign in to view all comments.