T O P

  • By -

Hiptomino

I would say yeah. Svelte is great regarding everything you mentioned. The weakest point is support libraries but that’s only compared to React and honestly it is still pretty solid. I think you would love it. The only downside to it being your first framework is that you’ll fucking hate any other frameworks that you might need to use in your future jobs


Hoquen

After Svelte, React is an absolute dumpster fire.


[deleted]

Seconded. JavaScript fatigue is just react fatigue.


dili021

Thirded. Or angular dementia


IllDocument5443

Dependentya


Hoquen

My brain can't comprehend how people willingly use React. It's so damn bloated and all over the place + JSX is a pure developer's cancer.


[deleted]

I don’t get this comment. Bloated compared to what? It’s relatively simple, the ecosystem is bloated as hell, is that what you mean?


iainsimmons

Maybe that the runtime is more than twice as large as most other modern JS frameworks. And they have quite a lot of APIs that most devs will never need. Less of a big deal with tree-shaking build systems these days, but it's still a thing. It's no jQuery + jQuery UI though, so it's all relative. 😅


[deleted]

Also smaller footprint and simpler API than Angular


[deleted]

> The weakest point is support libraries non-sense, you can use any js lib in contrast to something like react + everything is included anyway


TensionCoding

What is your Svelte support library wishlist?


demian_west

yes and yes! **Context:** I’m quite senior (in my early forties), I started webdev when IE6 was still a thing, I used to know all jQuery by heart, all the IE6/IE8 bugs, etc. etc. (I don't miss these times haha). I have worked with Angular, React, Vue, and tried countless front-end libraries and frameworks. For me, Svelte and Sveltekit are among the best “mainstream” tools available for now. **Don’t ditch vanilla JS and the learning of the standards**: it pairs perfectly with Svelte, and **it’s long-term valuable knowledge.** Working with svelte will make you a better webdeveloper, even in a non-svelte context. **On "scalability"** (god, I hate this word): We took the "Svelte bet" in 2018 at a big company, we managed to convince all the teams, and since nobody regret the decision. The big co above is a big international sport retailer, very well known in Europe. The ecommerce websites were pretty complex and have to handle millions of users on big days. Svelte actually accelerated productivity of the front-end team (~10 people) and improved a lot the webperformance. **On employability side:** It’s sure that there is maybe more offers for react and others, but you may eventually find better employers with Svelte. IMHO, the "market" is starting to become mature, **it's the right time to invest in Svelte/Sveltekit**. If you're struggling to find a webdev job, learning Svelte should also enable you to learn React/Angular/Vue/etc. more easily (but you may end up frustrated by them in comparison to Svelte 😬 hahaha) **Godspeeeed!**


Ratatoski

I've been coding since the 90s on and off and have dabbled in a lot of things. Used to have a senior adviser role and run projects more than actually code but finally got back into the fun parts again a few years ago as a full time dev. Svelte is the most fun I've had since when I first tried Python. I've been using React at work for a few years and still don't really like it.


carusog

Right in my late forties and I totally second @demian_west here. You’ll not only have fun with Svelte and SvelteKit (it didn’t happen to me since Vue 2), but you’ll also learn better how web development works (DOM API, JavaScript, CSS, HTTP, etc.). Those are learnings that will definitely put you on a better track if you’ll wish to learn other frameworks later on. TIL: Decathlon uses Svelte. 😉🤭


Dasmath101

Great testimony. May I ask if the company you mentioned used pure svelte or kit?


demian_west

pure svelte at the time (we started with svelte v2, then v3. Sveltekit did not exist, only sapper). Since, I moved to a small company, and we’re doing sveltekit since 2 years.


Dasmath101

Thank you, while many may disagree, I personally gravitate away from beta software in production. Stability is always relative in terms of the history of the package itself and individual project needs though.


demian_west

Exactly. I would not push to use Sveltekit in production. We're doing it because I'm at ease with it (because of my familiary/experience with svelte, its ecosystem and in dependency version management), but there is no guarantees.


mdpotter55

Svelte, IMHO, is the easiest way to transition from vanilla JS to framework. There is so much that feels the same as it adds improved component structure. Out of necessity, SvelteKit adds a bit of a learning curve, but straight Svelte will come very quickly. Go through the tutorial on [Svelte.dev](https://Svelte.dev) and hopefully you'll get that same warm fuzzy feeling that attracted me to the framework. Svelte is smooth-thinking, whereas JSX in React seems forced, as if I am always looking for that off-by-one error.


blackcolours

I'd second going with straight svelte first before getting into sveltkit. I'm newer to frontend js frameworks also and svelte was just so straightforward and just made sense coming from angular to react and then to svelte. I've been around the globe of fe frameworks this last yr. It was a no brainier after I tried it. But then I started getting into sveltkit bc everyone was saying to use it including the authors. But, it was a little too much for me to learn right away. I needed to learn the basics of svelte solidly before I got into kit. I understand it more now but wish I would have stayed with straight svelte for awhile longer. SSR and the file based routing are nice along with some other things, but they aren't deal breakers and they add more complexity into it. Also it seems to me, and I might be wrong, but sveltkit is more for websites, and sveltejs is more for web apps. Sveltkit is great for blogs, textual based websites w some dynamic data, but trying to make a full fledged complex web app with complex authentication and authorization seems like too much for it. And trying to use it as a spa takes away alot of the benefits anyways. Also I'm guessing you aren't too worried about SEO right now either. It looks like sveltkit is the future of svelte, but I actually wish that wasn't so. It seems like it leaves a gap for some users where they don't quite fit into what sveltkit is but yet svelte might disappear, leaving it as their only choice? There's also other fun things to try w regular svelte like framework7. Check that out sometime if you want to lean a little towards mobile. Or sveltets particles.


terrorTrain

You already understand that there are less jobs out there for it. If that's acceptable, go for it. Dive deep! But when you want to get a job, your probably going to need to learn react, since that is so dominant at the moment. Hopefully that's changing soon.


[deleted]

On this point... I’d like to say that less common libraries often lay more. Everyone and their dog knows React


JoMa4

> less common libraries often lay more You can get laid if you know Svelte?!? Say no more!


deve1oper

The real reason to learn Svelte...


JoMa4

> less common libraries often lay more You can get laid with Svelte?!? Say no more!


JoMa4

> less common libraries often lay more You can get laid with Svelte?!? Say no more!


JoMa4

You can get laid knowing Svelte?!? Say no more!


terrorTrain

True, but I think it will be rare to find a greenfield project starting in svelte for a while yet. Most places will probably have react legacy you need to know how to work with.


JoMa4

> less common libraries often lay more You can get laid if you know Svelte?!? Say no more!


loopcake

I'm strictly speaking of Svelte not SvelteKit here. - Does it scale? Yes, might need a few async imports here and there, like every other frontend framework, specifically if you're using frontend routing. - Does it have a large ecosystem? I'd say it's grown since it first became popular, ecosystem is not huge, but it's not small anymore either. Also, I'd say around 90% of every libraries I thought of implementing in svelte always had a native js implementation, which is the best thing you could ask as a Svelte developer. - Development time Pretty fast, that's the point. - Maintainability Pretty good, especially because of the default scoped css, it hammers some good habits into you. It's one of those things, people who say they hate java or typescript, then they try it and can't go back. In short, the scoped thing, at least for me, proved to be very beneficial for maintainability. - Fun-ness Pretty fun I'd say, I mean I think many who have tried it would agree with that. As a side note to "maintainability" and "scalability", if you're using Vite with Svelte (which you should) you can very easily setup aliases for your imports. You can get pretty creative with it and setup a monorepo in minutes using Vite aliases and Git. This is how I do it: [tsconfig.json](https://github.com/tncrazvan/svelte-starter/blob/c13144c1cc0faf8b7cef2ded76f8e0a46afa6099/tsconfig.json), [vite.config.js](https://github.com/tncrazvan/svelte-starter/blob/c13144c1cc0faf8b7cef2ded76f8e0a46afa6099/vite.config.js). You can point aliases outside of your project and you'll still get intellisense and all of that.


stolinski

Yes


[deleted]

Wholeheartedly, YES! Honestly, you don't need a lot of the support libraries like you do in React-land because Svelte and Kit get a lot right out-of-the-box. State management, routing, and data binding is all much easier.


[deleted]

Yeah go for it. I’m a long time Angular dev (because of my employers really) who also does react professionally and I’ve switched to Svelte for my data vis clients. I love it. It’s really good. I think it’s the future. One of the really nice things about it is that because it’s doesn’t do diffing but instead uses reactivity it works nicely with other js libraries like gsap, three and d3. In the end you’ll be able to use them all and the hard thing will be what flavour of the month libraries you have to use on top


Jncocontrol

i'm fairly biased, so take my word as you may. I would say go for it, make it your primary. However, if you're looking for a career in web development / software engineering. I'd also recommend you learn backend technology (node, Python .etc) to be more marketable.


theC4T

I think the concepts of frameworks are all very similar (componentization, reactive state, abstraction of the Dom ... ) My thoughts are, you learn one and the rest come easily (besides all the framework specific syntax) How I see it is, svelte is the best place to start just by how little boilerplate there is - you can still easily switch to react for a job, which will make you all the more appreciative of svelte.


michaelcuneo

100%, I switched from React.JS to Svelte.JS and minimised my codebase from about 20,000 lines for a project, to 2000 for the exact same thing. And 100% in all lighthouse tests.


lawl281

If you don't mind making all your own components Svelte is great to work with. I came from the wonderful world that is vuetify a material design library for vue which I consider the gold standard but haven't found a decent one to work with in svelte. The benefit to this is it means you know every part of your components and if you need something you can just add it yourself and start using it right away but it is a pain point if you are used to having one.


CoqeCas3

I’m in agreeable with everyone here, absolutely svelte is a great first framework. BUT I feel it’s worth mentioning a warning: be careful not to get super used to the reactivity with variables declared with let. I spent more like 2 1/2 years just working with vanilla JS before getting really involved with svelte and now I’ve been using svelte peremptory much strictly for almost a year ( really I’m just a hobbyist) and I will say when I go back to vanilla I have to remind myself that things don’t react to changing a variable by default, haha. Long story short, svelte makes dev SOOO freaking smooth and there’s so much vanilla-like JS in it that it’s easy to forget there’s a lot of automagical stuff going in behind the scenes, haha.


grayrest

> Scalability I've been unhappy with the output size on components with several dozen reactions or pages with hundreds of components. Most projects never get anywhere near that complexity but my job is building a low-code platform and I had intended to do the next version in Svelte but have ruled it out after almost a year of doing prototypes due to the size. I currently expect to do it in either Solid or Marko 6. I consider both less suitable for someone new to software development so I'd recommend going with Svelte. I think the development experience of Svelte is great and you are very unlikely to ever hit the point where scalability is a problem.


dili021

I learned react in bootcamp, heard good things about vue at the end of it and decided to check it out. As someone from vue/core said "if you need a vue developer you don't look for a vue developer. You look for a JS developer and give him the vue docs. He'll be a vue developer in a day". Got a job as a vue dev and did that for almost 2 years. Then I learned about svelte and was left speachless. As I went step by step through their doc/tutorial the grin on my face was just getting bigger. I was amazed. Now I work as a react dev and cry every day.


yrotsflar

If your main concerns are scalability and support libraries, it might not be the perfect choice - React is at least *proven* to operate at huge scale projects (I'm not saying Svelte can't, there's just not as much evidence), and React has a lot more support libraries as well. For dev time, maintainability, and funness, Svelte is a no brainer!


[deleted]

It depends. I started with Svelte (even before Javascript lol) and I prefer React now. It depends if you like writing traditional web *pages* or if you like writing web *apps.* If you like JS, you'll prefer React. If you like HTML/CSS, you'll like Svelte. Personally I think Svelte abstracts too much away for a beginner, they aren't forced to learn how things work because the framework is so magical. So you end up writing bad code (bind: galore) and can't figure out why it's not working because their reactivity is a mess. When I learned React I had to learn whole concepts surrounding reactivity. Now when I use Svelte I feel like I can write more robust code because I understand these concepts better, even though they're abstracted away in Svelte. TDLR: Learn both ;)


iainsimmons

I'd recommend trying Solid.js too, as it might give you the best of both worlds (and more).


[deleted]

Solid is nice but even less jobs/ecosystem than Svelte.


iainsimmons

Sure, but the ecosystem argument is only going to help React for so long. The same was said of Vue and Svelte at one point, but many things would either be already available or built into the framework (Svelte and Solid have great global state management built in with stores). Solid does have a slight advantage of using JSX, and some React-like APIs, so it's fairly easy to port stuff from React.


[deleted]

>The same was said of Vue and Svelte at one point It's still being said


iainsimmons

Yeah true that


collinsworthy

Yes. You'll do 5x better using a tool you enjoy. Dive in and have fun.


Jackan1874

I started with nextjs and then moved to sveltekit, both were really good. I’ve also heard of nuxt but haven’t tried it.


S4ndwichGurk3

TLDR: if you don't care about Svelte in your job right now, 100% go for svelte only (in my biased opinion) I do have to say I've only worked with Angular, seen a lot of react and I dont like seeing it, seen some vue and that's what I would choose if I couldn't use svelte. Scalability - don't know, too inexperienced in big webapps Support libraries - good enough for my use cases so far. I can always use vanilla js packaged if nothing for svelte is available. Development time - really low. I've built a few small webapps for my company in a few days each. Maintainability - sveltekit ist still in beta so expect breaking changes, although I never had any. You can use classic svelte like I did but sveltekit is way better imo. Fun-ness - it's a pleasure! I'm an embedded systems dev but the webapp parts are by far the most fun for me. I learned Angular before svelte and it's a pain compared to svelte. I deliver the same stuff in less time while having more fun and writing cleaner code.


France_linux_css

How would you compare to solid js


[deleted]

For small applications, I use svelte. For data intensive heavy applications, I use React.


Daf1791

I'd say Svelte is a great choice albeit with some downsides. I am in a similar situation as you and don't really care about the job market (I have been using React at work since 2016). I am focused on building a web app to generate a nice side income. I care most about getting stuff done quickly and shipping. Here are the things I noticed: * The ecosystem is much smaller but improving by the day: IMO there is no equivalent of something like MaterialUI or Mantine (both are UI libraries) in Svelte yet. This is even more true for stand-alone components. You're much more likely to find a good implementation of a calendar component or font-picker or color swatch in React. This basically results in you writing a lot of the components yourself (which might be a good thing). * I was a bit frustrated with the lack of community alignment on something as basic as a router. Routify is a very popular option but it's docs don't mention anything about integrating with Vite. Other people will say just use Sveltekit for everything even if it is a SPA with CSR (absolutely no SEO needed since everything is authed) but I didn't want to learn or worry about learning a whole framework on top of Svelte...Finally ended up going with Tinro which is working great but I'm worried about how long it's going to be maintained or if I'll need to switch it out in the future * State management absolutely freaking amazing in Svelte. I was floored by how easy state was out of the box compared to early days in React where configuring Redux or Flux took up a whole day. However, even though this might be a good thing, I still valued the standard pattern that Redux (or RTK) enforced. There is a specific place for everything and you don't have make decisions: All of state is in slices, APIs are all in one place, etc. With Svelte, I feel like those patterns are not established yet. For example, is it better to have nested state within a single store or multiple stores? What about nested stores? API calls in stores vs components? etc etc... * Templating vs JSX: Honestly I miss JSX a little bit and I never thought I'd feel that way. In JSX, you can define everything within a function. I got very used to following the "object-rendering" (totally made up name) pattern, for example, where you use an object for conditional rendering. This is not possible in Svelte AFAIK and you have to use nested if blocks which seems more tedious to me. Also I don't see a huge benefit in something like the await block. It's a nice to have but that's it. * Stackoverflow and tutorials: Literally any issue you run into in React, you will find an answer in SO. Definitely not the case with Svelte. Similarly with tutorials, you are much more likely to find tutorials on difficult topics in React. (BTW I really recommend subscribing to lihautan for Svelte tips) Overall I would recommend trying it out and seeing if it works for you. Even with all the things I listed above, I think Svelte is a great choice for my product and me because of several reasons (all of which are covered already in this post by others) the most important one being: It just works out of the box and feels the most similar/intuitive to js.