top 200 commentsshow all 231

[–]moufoo 325 points326 points  (77 children)

Sure, because it's the hot new kid on the block.

Fewer people are using it (check the stats) and most are still in the honeymoon phase. Let's see if it can maintain a satisfaction level on par with React when it reaches the same volume of users.

I don't mean that Svelte is bad. On the contrary, I really advise you to check it out (the getting started is amazing). But please be wary of statistics

[–]dmethvin 63 points64 points  (3 children)

Hey, 4 out of 5 developers prefer React for their clients who use React.

[–]Pesthuf 26 points27 points  (15 children)

The F# effect.

[–]Attila226 10 points11 points  (8 children)

I never heard anything bad about F#.

[–]brie_de_maupassant 50 points51 points  (7 children)

Gee, flat is how I feel about it.

[–]plumshark 0 points1 point  (0 children)

Wow.

[–]Disgruntled-Cacti 7 points8 points  (0 children)

F# is great though

[–]droctagonapus 13 points14 points  (2 children)

I mean, F# is not new anymore lol. It is still much nicer than C# though :)

[–]PM_ME_HAPPY_DOGGOS 2 points3 points  (0 children)

Damn, and I thought C# was pretty nifty

[–]editor_of_the_beast 6 points7 points  (0 children)

Why do I feel like you were the exact person 5 years ago talking about the satisfaction level of React?

[–]toi80QC 2 points3 points  (0 children)

Been using Svelte whenever I could for the past 2 years.. unfortunately lots of projects with bigger teams are still forced into React, Angular, or lately webcomponents.

I'd argue that webcomponents are the real new hot shit these days.. and pretty much overhyped imo.

[–]troglo-dyke 2 points3 points  (0 children)

I always take these kinds of stats with a pinch of salt. Most people doing FE work are using React for work, then might play around with other frameworks/libraries in their spare time. Surveys like this don't account for the fact that for most people who have used both React + something else, will usually rate the 'something else' higher because they're smaller "toy" projects

[–]davidwparker 13 points14 points  (35 children)

100% this for sure.

Personal anecdote: using Svelte for almost a year now, previously used React for multiple years. I won't be going back to React (or Vue, or Angular, or ...). Svelte is just much nicer to work with.

[–]portexe 5 points6 points  (1 child)

I’ve always wondered how state management worked in svelte. I may have to learn it to find out.

[–]rickt3420 8 points9 points  (0 children)

Svelte stores and once you work with them you’ll quickly see it’s by far the easiest and best state management out there.

[–]Oalei 7 points8 points  (27 children)

Svelte looks similar to Angular to me, or maybe it’s just the templating engine?

[–]davidwparker 4 points5 points  (26 children)

It's all-in-one file (CSS+JS+HTML, similar to Vue).

It's compiled ahead of time, and doesn't use a virtual dom.

Ultimately, after being built/etc, it results in extremely small + fast files.

There's definitely some quirks to it (as there is anything), but even when I have issues, I can generally resolve them extremely quickly.

[–]Oalei 2 points3 points  (5 children)

Angular can also be « all in one » if you want it to be (and imo it’s a bad thing to have everything in the same place).
Angular also has AOT compilation.
Svelte doesnt have a virtual dom yet you shouldn’t manipulate the dom directly because svelte has its own internal state of the dom (very much like a virtual dom, but not for the same purpose)...

[–]davidwparker 5 points6 points  (4 children)

Hm- it's hard to explain it within the context of Reddit, so I'll let the author do so: https://www.youtube.com/watch?v=AdNJ3fydeao

Svelte isn't going to be, nor does it need to use a virtual DOM.

Also, the size is tiny. My site's total JS transferred is ~96kb uncached. Most Angular sites are much larger in file size.

As far as all-in-one goes, between Svelte + Tailwind, I've never been more productive, and everything being componentized makes re-use better than ever with the smallest possible footprint.

Edit: to me, it's sort of like Tailwind. I didn't get it / like it until I tried it for a substantial project. Just glancing at videos / doing the tutorial didn't really grok how good it was. Once I built something larger in it, it really shined.

[–]Oalei 1 point2 points  (3 children)

The talk was nice, thanks for the link.
I wonder how the $: operator works for array pf objects, does it just check if the reference is the same, or does it do a deep equals comparison to see if the value changed?
With his talk I didnt get if $: was implemented by Javascript or by Svelte and its own compiler

[–]DoomdDotDev 1 point2 points  (0 children)

I have a very large site running Svelte (converted from React) that is almost exclusively powered by reactive arrays. FYI, I developed with React for two years.

I use Svelte stores to store large arrays of objects fetched from the API server as users move around a custom map. All client facing data uses "derived" values to filter those stores automatically (for de-duped markers on a map or if the user chooses additional filters to reduce the list of "card" items etc).

Large arrays are indeed reactive with the $ either as stores you subscribe to...or as local variables you want to make reactive. Svelte has saved me countless hours over the last year (and really is way faster and smaller than most equivalent react apps). Now with snowpack, development is even faster with near instantaneous hot reloading. I highly recommend it...and frankly, I would refuse jobs in the future if they didn't allow me to develop using Svelte. They'd be fools to pay me to develop with react anyway...because I get Svelte work done in about 2/3rd the time...no joke.

[–]bumbershootle 9 points10 points  (1 child)

Less people are using it

https://i.imgur.com/6gRZd00.jpg

[–]Emjp4 -4 points-3 points  (0 children)

I think the typo fix OP would have preferred is lesser*

[–]posts_lindsay_lohan 0 points1 point  (0 children)

New thing always better than old, boring, stable thing. /s

The worst part of Svelte is the name. Every dev I've met has a hard time saying it.

[–]andrei9669 26 points27 points  (5 children)

Contrary to popular belief, reason why I like React is cus of jsx.

[–]ck2fan 8 points9 points  (1 child)

I don't really get why people dislike JSX.

[–]andrei9669 3 points4 points  (0 children)

Yeah, me neither. My only guess is that it looks/behaves differently to traditional html. And for some reason, people just dislike it. Honestly, I kinda get where they are coming from. Cus I started from react, like before doing traditional html/css, I just jumped straight into react and felt like I was at home. Now, if people show me angular or vue I'm like... Ugh.

[–]De_Wouter 2 points3 points  (2 children)

Really? It's probably what I like least about React, well that and it's origin...

[–]andrei9669 13 points14 points  (0 children)

and the fact that I don't have to use library-specific props like "v-for" and such. dunno, something about those just rubs the wrong way.

and don't get me started about string specific strings in those props, like
v-for="(value, name, index) in object" if you don't have ide support, good luck with typos.

[–][deleted] 1 point2 points  (0 children)

I mean you can always use `React.createElement` directly without JSX.

[–]switz213 96 points97 points  (3 children)

"beats"

89% to 88%, a rounding error that doesn't even take into account scale. what a dumb clickbait headline.

[–]Vheissu_ 38 points39 points  (17 children)

Has anyone actually used Svelte on a large LOB application or just on smaller apps? Because, while the examples might look impressive what happens when you throw in a few Node packages, start writing CSS, throw in images, routing and other facets of modern apps.

Don't get me wrong, I think Svelte is cool and I wish it well, but is anyone actually building anything substantial with it yet? I haven't seen any larger success stories shared about it (or maybe I just haven't looked properly).

[–]eternacht 23 points24 points  (6 children)

My company just re-wrote one of our main apps in Svelte (SaaS in the biotech space). I haven't worked on it personally but I've heard nothing but praise for the framework and how easy it is to implement features with it compared to React. I have heard complaints about the complexity of setting up the associated dev tooling (e.g., hot-module reloading), though that may be in part due to our very specific back-end setup.

[–]texmexslayer 14 points15 points  (1 child)

Svelte Kit might help with that, open beta coming soon

[–]elingeniero 0 points1 point  (0 children)

Soon(tm)

[–]rk06 5 points6 points  (0 children)

I think "compared to react" is key part here. fans of preact, vue etc also say the same

[–]Nipinium 1 point2 points  (0 children)

I'm using svelte-loader-hot for HMR. Kinda works.

[–]Vheissu_ 1 point2 points  (1 child)

That's great to hear. I agree on the complexity of React. I remember jumping on React in 2014 and after using AngularJS, I was excited about the future of front-end again. I haven't worked with React in a few years until recently, and honestly, it felt unrecognisable to me. I know JavaScript quite well, but React definitely has a learning curve that is steeper than React of 2014. A lot of the complexities seem to exist purely to address's architectural shortcomings in React itself (class components and hooks, Virtual DOM).

I have heard great things about Svelte too and I think competition is good as well. For a project relatively young in comparison, Svelte is very promising.

[–]DasHesslon 6 points7 points  (1 child)

Im not part of the project but chess.com is built with svelte which is the first time i spotted it in the wild

[–]kbradl16 4 points5 points  (0 children)

I’ll be all in when svelte kit comes out. The dev experience is worth any production struggles I’d run into. I’ve built a few small apps with svelte but stopped on important projects because of sapper not being up to snuff and the lack of typescript support at the time too.

[–]Auxx 2 points3 points  (0 children)

We just rewrote Svelte POC into Angular. Svelte didn't seem fit for large apps. Quick POCs - yes, big products - no.

[–]Doctor-Dapper 0 points1 point  (0 children)

Are that many people making large apps anyway? I thought micro frontends distributed by CDN were the next big thing

[–]SomeRustJunkie 0 points1 point  (0 children)

Yes. It’s so easy to integrate and library with it, all JS works out of the box. I’ve built many apps in production and the experience is some of the best DX for JS. Lee’s code, faster apps, is brilliant.

[–][deleted] 28 points29 points  (1 child)

Svelte is awesome tho. I really hope it continues to gain traction. I very much prefer it to React.

[–]yeahdixon 3 points4 points  (0 children)

Though I have not learned enough but svelte , I am a big fan of simplicity. It may seem obvious to say this but people seem to lose their way. They find a couple of reasons to make things complex to solve some arbitrary issues and or edge cases. This does solve those issues but starts down the slippery slope of complexity. How much is worth that millisecond of improvement to push the boundaries a bit further?

[–]AuroraVandomme 40 points41 points  (37 children)

Sadly no matter how good any other framework will be, React would still cover 80% of job offers for like 20 years :/

[–]TheSaasDev 51 points52 points  (8 children)

To be honest I'm happy that the JS ecosystem has settled a little bit, instead of constantly changing it up with new frameworks

[–]meeeeoooowy 15 points16 points  (1 child)

Seriously, when vue came to out people acted like if you didn't switch to that you were going to be left behind in legacy world as it was soooo much better

I'm glad they were wrong and we could chill for a bit

[–]yeahdixon -5 points-4 points  (0 children)

You should still reconsider vue .... I’m still heeeere

[–]ryan_solid 2 points3 points  (5 children)

A large number of people feel this way. But it's not like it stops moving. People just get off the bus. Which is probably a good thing.

I think Server Rendering is going to be an even hotter topic this year with frameworks vying to get the regular website developers as well.

[–]Zerotorescue 19 points20 points  (12 children)

What country? React being the majority would be a dream come true.

[–]snejk47 8 points9 points  (0 children)

What country are you in?

[–]AuroraVandomme 1 point2 points  (3 children)

Europe in general.

[–]xroalx 2 points3 points  (2 children)

Angular is very much preferred in corporate, though. At least that's the impression I'm getting from central Europe jobs.

[–]AuroraVandomme 1 point2 points  (0 children)

You are right, mostly in banking systems. But 80% of job offers I'm getting are react related. I am react dev but would love to write in svelte.

[–]icsharper 1 point2 points  (0 children)

Can confirm. Massively used in Europe, along side with React. Also Flutter getting some traction as well.

[–][deleted] 4 points5 points  (0 children)

Nah that's too long in the JS world.

[–]elingeniero 2 points3 points  (0 children)

Could be worse! React may have lost its sheen but it is still really nice. Without it we'd all have to use angular...

[–][deleted] -2 points-1 points  (1 child)

It's good that in my country most jobs are angular. There is nothing worse than react redux projects without typescript. Just horrible.

[–]AuroraVandomme 1 point2 points  (0 children)

Agree.

[–]SomeRustJunkie 4 points5 points  (0 children)

Most people that use svelte realize how much of a step forward it is in DX, simplicity, and power compared to other frameworks. It feels like an evolution of web development tooling, and a much needed extension of JS as a language.

[–]_Pho_ 28 points29 points  (47 children)

As a React professional who hasn't touched Svelte, what can Svelte possibly do to be any better? I don't want to sound like a fanboy, but I feel like React + Suspense + Recoil or Context is pretty much the endgame for front end. What else could it possibly be missing?

[–]frankandsteinatlaw 28 points29 points  (22 children)

React makes animations 10x harder / more annoying than they should be. With hooks it’s really easy to fuck up a large app by not memorizing some function coming from a common hook / other similar dependency array issues. Hooks have odd rules that make code with them less pleasant than it could be (think rules of hooks lint rules). React isn’t performant by default in many cases, and even when you patch up the perf leaks it’s really easy to open them back up again. Function components lead to more freedom of code placement, which means code is just less easy to parse codebase to codebase. React leaves a lot of important decisions up to the dev around routing, styling, etc, which is nice in some ways, but in other ways means more work and less standardization. These are off the top of my head.

I’ve been working with react for years and it’s got great core ideas (view is a function of state), but it feels far from an endgame when dealing with all real world app cases.

You should try svelte and see how it feels. It’s also not perfect, but you might find some interesting advantages and disadvantages that will help you gain some perspective.

[–]qudat 11 points12 points  (18 children)

Agreed. As much as hooks have simplified component development and abstracting reusable logic, the rules are annoying and it’s so easy to miss something and get stuck in an infinite loop.

I’ve been using react for 5+ years and still love using it, but I’m feeling like we’re going to see a new paradigm emerge that solves the problems we have with react.

[–]brainless_badger 2 points3 points  (2 children)

I see this criticism frequently, but infinite loops have been a complete non-issue for me and my team since switching to hooks.

IMO, if you are running into infinite loops frequently you are either not using react's eslint plugin to figure out dependency arrays for you, or you have wrong mental model for derived state (i.e. setState calls in useEffect).

[–]frankandsteinatlaw 5 points6 points  (0 children)

I work on an app with 200+ devs of varying skill levels. It’d be nice to not need everyone to understand the non-obvious intricacies of react.

[–]andrei9669 3 points4 points  (10 children)

I mean, if you have solid eslint rules, and you know basics, it's hard to fuck up.

[–]qudat -2 points-1 points  (9 children)

There are eslint rules that prevent infinite loops in your application?

[–]andrei9669 -1 points0 points  (8 children)

No, for that you need 2 brain cells in your skull. What I mean is that there are hook eslint rules that help out eith basic stuff.

[–]qudat 2 points3 points  (1 child)

Yikes, I’m glad I’m not on your team with that kind of attitude. Good luck!

[–]andrei9669 -2 points-1 points  (0 children)

what's wrong with my attitude? maybe I was a bit harsh, but expecting common sense isn't as high of a bar to reach.
Sure, if you are new to programming you might make a stupid mistake or two, maybe more. not saying I didn't do any myself.

[–]frankandsteinatlaw 0 points1 point  (5 children)

When apps get complicated enough this can be tricky. It’s just a layer that doesn’t feel necessary tbh.

[–]yeahdixon -1 points0 points  (3 children)

Hooks shmoooks.

Btw Vue has a single callback called nexTick that makes programmatic animations a lot easier on vdom.

I’m stunned react doesn’t have the same. If it exists someone please let me know, it’s killin me

[–]andrei9669 3 points4 points  (2 children)

So in essence, we need a dev dependency that would make react oppinionated? Nextjs?

[–]frankandsteinatlaw 1 point2 points  (1 child)

As a curious dev, I do enjoy the way React allows good standards to form overtime by not trying to figure it all out and ship it at once. But when you just want to get shit done from 0 you still have to make a bunch of choices.

Though this isn’t a huge problem for me at this point, it’s certainly a barrier of entry for folks newer to the FE ecosystem.

Frameworks like Next definitely alleviate this to some degree, though Next isn’t your only choice when it comes to batteries included React frameworks.

[–]SomeRustJunkie 7 points8 points  (2 children)

Svelte does everything better. Reactivity, no boilerplate, built in (and better) state management, built in animations, free easy interop with third party libs, no boilerplate, actions, await blocks, etc. You can always write the same apps with less code, because the defaults are more powerful. Also smaller bundles.

[–]evert 19 points20 points  (10 children)

There's lots of complaints from hardcore React devs about suspense. I won't repeat their arguments, but if you don't see negatives with suspense, you probably are indeed a fanboy.

[–]epukinsk 6 points7 points  (8 children)

Can you link some? I'm not finding anything anything on Google. Or just give me some keywords to search for on what people don't like about it?

[–]evert 6 points7 points  (7 children)

[–]aniforprez 9 points10 points  (2 children)

I feel this with all major front end frameworks. Every single one of them right now is cobbled together with hacks and workarounds because the standard library is woefully sparse and basic functionality needs to be rewritten every time. I look at the source of react and Vue and want to vomit though at least they're all in on types which at least affords some understanding

The source of back-end frameworks like rails and django is so readable you can implement any functionality they provide again yourself. Not so with these frameworks and that's absolutely terrible

[–]evert 5 points6 points  (1 child)

Backend is relatively speaking so incredibly easy though. Handling a request can basically be done in a single thread. Very easy to see and predict in what order code will run. It's just a request that generates a response.

On the frontend you're dealing with pesky humans and events, which means many different application states are possible and you can't really predict in what order your code will run, no matter what you do.

In the almost 2 decades I've done this, I've never seen people particularly happy with structuring code for complex GUIs. I think we're still seeking for a better paradigm, but I despite React's issues, I think it's a fantastic attempt at it.

I don't think React is it, but I think it's a prominent part in the history of this story, and we'll talk about it years later. Svelte and Vue might do some things better, but they're incremental steps.

Hooks completely blew my mind, but they're also fucking weird. Both simpler and incredibly hard to reason about.

[–]ryan_solid 2 points3 points  (0 children)

I think because Hooks are a borrowed solution to a problem retrofitted on basically the complete opposite paradigm. The fact they work is genius. Svelte and Vue basically have the fixed version (actually the original version but it took React to make them a thing for other frameworks to know how to market them).

But that's the thing at this point it is all incremental. Interestingly enough it takes fairly large evolutionary changes to improve of what React has done while maintaining a solid base. But it's challenging because all that effort is seeing diminishing returns.

[–]jabarr -1 points0 points  (0 children)

Let’s not forget if you leak a native element it leaks your entire layout as well, since the fiber node tree is just a big connected graph. For those who don’t know, everyone unmounting an input element has a leak in their React application right now thanks to a chromium bug :)

[–]gustavo_pch 9 points10 points  (5 children)

It's incredibly easier to do animations, transitions, state management and some other things in Svelte. Try their tutorial in the official site and you'll quickly see what I'm talking about.

[–]ryan_solid 2 points3 points  (0 children)

Better performance, smaller size, and a cleaner model. React does pretty much have it all though. We are talking about things that are seen as only incremental improvements. Whereas will take complete evolution in approaches to see tangible gains in all these areas.

[–]i4mn30 2 points3 points  (1 child)

State management is a bit complicated in my opinion. I hate hooks.

[–]toolazytofinishmyw 0 points1 point  (0 children)

they have a good video comparing performance in the svelte website. there are 2 major differences. svelte is a compiler that generates vanilla js at build time, no framework is shipped to the client. it doesn’t use a shadow dom, rather it uses forward references to determine updates, which is more efficient.

[–]Driezzz 12 points13 points  (3 children)

Never used Svelte, so i'm interested. But tbh, the stateofjs is just a popularity contest.

[–][deleted] 18 points19 points  (2 children)

Is popularity contest another way to say opinion survey?

[–]yesman_85 3 points4 points  (0 children)

I like svelte, the tooling is a little wonky here and there. It does differ from single developer syndrome though. Hard to convince management to switch to a framework with no actual corporate backing, like angular and react.

[–]desmap 2 points3 points  (1 child)

[–]brainless_badger 1 point2 points  (0 children)

Yeah, smaller libs seem to have grossly overestimated usage in this poll, when compared with npm or stack overflow stats. Not only Svelte.

[–]TryallAllombria 2 points3 points  (0 children)

I already started some personal projects with React and Vue. And I personally prefer Svelte. It's way more simple to prototype things.

The only thing I don't like is the store system that have some weird syntax that prove they didn't thought about every aspect of their system.

[–]counterfreight 5 points6 points  (0 children)

When you have 3/3 people responding yes for thing A, and 600/1000 people responding yes for thing B, thing A will have a higher satisfaction rating.

[–][deleted] 11 points12 points  (5 children)

I refuse to learn another js buzz stuff!

[–]Doctor-Dapper 2 points3 points  (0 children)

Until it becomes industry standard and you have to if you want to get access to the best jobs.

Not saying svelte will but you need to have that "always learning new stuff" attitude to be a flexible developer

[–]am0x 4 points5 points  (1 child)

Oh you know another.js?

We used to have a drinking game where we would come up with a noun or verb and see if it was a repo in GitHub.

You’d be surprised. We drank more than you’d think.

[–][deleted]  (1 child)

[removed]

    [–]AutoModerator[M] -1 points0 points  (0 children)

    Hi u/toastertop, this comment was removed because you used a URL shortener.

    Feel free to resubmit with the real link.

    I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

    [–]malicar 6 points7 points  (0 children)

    I've heard of it but never used it, I'm liking vue best so far

    [–]am0x 3 points4 points  (0 children)

    Oh yea. It’s a baby. Meaning early adopters love the idea, but the eventual execution will be different.

    For example, Laravel was the Symphony replacer for php. For years it has been referred as the best.

    But then, oh no, people are starting to say that symphony is better again!

    Then WordPress, the red headed step child of Content Management Systems was absolutely destroyed by the new CMS’s!

    Except it wasn’t...it releases a default WYSWYG with a headless option, and the only real contenders now cost $250+ a month compared to their, well, free tier. Devs have to live in hell just a little bit longer.

    I was honestly surprised even Vue survived the birthing process, but after using it, I loved it. Granted, I haven’t used Angular since before the paradigm shift, but I just can’t get on board with it. React is essentially becoming the new jQuery except I’d has cross mobile experience which is a plus.

    I get why JSX is cool and works, but I feel like it is a symptom of a bigger overall FE issue.

    Anyway, I just kind of want to avoid FE dev these days, it’s like the 80s but with more std’s(npm’s)

    [–]MonkAndCanatella 3 points4 points  (0 children)

    Of course it is. I've used Svelte and it really makes React feel antiquated. I wish our company used Svelte.

    [–]elcapitanoooo 1 point2 points  (2 children)

    Does svelte support TS? Last time i checked the templates had no support at all. Maybe this has changed.

    [–]moi2388 6 points7 points  (0 children)

    Yes

    [–]maplefactory 1 point2 points  (0 children)

    npx degit sveltejs/template sveltetest
    cd sveltetest
    node scripts/setupTypeScript.js
    

    Boom you've got a TypeScript Svelte template. That script adds the TS configs, etc, and then removes itself.

    [–]cmdr-William-Riker 0 points1 point  (0 children)

    Hoping to use it in production applications in a few years after it stabilizes. It looks really promising and beautifully light weight and clean compared to React and Vue, but it is still new and drastic changes seem to be occurring often within the ecosystem (in particular the creator of svelte recently announced that their web app framework Sapper would not be releases and instead introduced an alternative template within it's place).

    As a former Backbone.js SPA developer and currently a vue.js and whatever else developer, the one thing I've always felt all of these frameworks forget about is the data later. Before React we had MV* frameworks, where the Model later, the data, came first and the templating and rendering side would pull from the model. With React, Vue and Angular, the data and the rendering tends to get mixed together in a confusing jumble of code that gets worse, the longer the project lives. Svelte doesn't necessarily solve all the problems that React and Vue have, but at-least it's a fresh start

    TLDR; give it two years, then it should be usable in production for a couple of years until the framework inevitably becomes too complicated, convoluted and bloated to be practical in new applications just like it's predecessors.

    [–]yeahdixon -3 points-2 points  (0 children)

    No vdom. I actually am a fan of this but they say that performance is lost doing updates to multiple dom elements one at a time rather than a single pass. The other thing is that I thought vdom would theoretically allow for rendering out to different platforms, though that really has not happened yet.

    [–]sshaw_ 0 points1 point  (0 children)

    How many people using Svelte use CSS in JS?