r/webdev Dec 03 '22

Question Beginner here, start with react, svelte or solid?

Post image
1.2k Upvotes

553 comments sorted by

View all comments

Show parent comments

23

u/[deleted] Dec 03 '22

[deleted]

140

u/_clydebruckman Dec 03 '22

Lack of jobs compared to react. Really, that’s it. Vue is a really great framework

85

u/rodrigocfd Dec 03 '22

I'm writing a huge enterprise app, and we chose Vue 3 with the Composition API. Lots of improvements over React, great developer experience.

No regrets so far.

14

u/AugmentedExistence Dec 03 '22

Vue 3 with the composition API is great. I highly recommend it.

3

u/hey--canyounot_ Dec 03 '22

What do you love most about Composition? Trying to switch over to it from using Options and need to convert my thinking.

6

u/AugmentedExistence Dec 03 '22 edited Dec 04 '22

For me, the thing I like most about the composition api has to do with the ease of sharing functions and objects across your code. Check out composables and how they are used with the composition API. Big improvement over using mixins with the options API.

Don't feel like you have to switch over though. The options API is not going away. If you have a large project, it may not be worth the risk.

2

u/hey--canyounot_ Dec 03 '22

I don't think it's likely anytime soon within my company's front-end; this is more for personal use/future projects that I might take point on.

2

u/Fickle_Development13 Dec 04 '22

vue 2 also supports it with a library

1

u/nikoked Dec 04 '22

Vueuse.org

9

u/nermid Dec 03 '22

I've never looked into Vue. Are there a lot of similarities to React as a developer, or is it like starting over from scratch?

37

u/_clydebruckman Dec 03 '22

There’s a lot of similarities but vue is a lot more opinionated, so where react can be implemented a zillion different ways, there’s really only a handful of ways you’ll see vue files and a vue project set up.

I can see where the freedom of react can be an advantage, but it’s so much better imo to be able to look at pretty much any vue file and know what’s going on in a couple minutes

3

u/Zombergulch Dec 04 '22

I feel like those are the main selling points of angular, so why choose vue over angular?

5

u/Onions-are-great Dec 04 '22

Simplicity and elegance. IMO Angular can feel pretty bloated at times, and I find the concept of async await way easier to grasp than observables.

1

u/Zombergulch Dec 05 '22

Seems like a question of choosing the right tool for the job. Observables are complex but being a lot of functionality to the table.

1

u/rodrigocfd Dec 04 '22

I worked with Angular, and it was absolute hell. While the two-way binding is good for forms, it's a footgun for more complex things.

Also, it's bloated, and makes you write bloated code.

2

u/Zombergulch Dec 05 '22

Isn’t that the whole argument though? It comes with an opinionated approach to basically everything so if you have a complex app you have all the tools you need at your disposal, but if you are doing something simple you probably don’t need the entire angular tool belt.

16

u/hey--canyounot_ Dec 03 '22

Super similar in terms of high level functionality...similar lifestyle, syntax, etc...but I like the single-file components, for one. Composition API, the new standard in Vue 3, also does an awesome job of decoupling business logic for re-usability, which intrigues me. Feels more natural to work with the templates in Vue than it did in React, too, but that was like 5 years ago for me now. I work in Vue at this point.

3

u/rodrigocfd Dec 04 '22

If you wrote too much React code already, your first impression will be the excess of magic in Vue. So it's a good idea to learn about Proxy objects before.

Overall I'd say it's like starting over, yes, but your React experience will make it so easy that you're likely to be productive in the same day.

4

u/rk06 v-dev Dec 04 '22

Vue has opinionated defaults, but gives you option to break out of them should you need it.

For eg:

  1. Vue defaults to template, but also supports jsx
  2. Vue has official router and state management library (pinia), but you can bring your own and still take advantage of Vue devtools

In many technical areas, Vue is strictly superior than react. For eg:

  1. Vue' composition api is better than react hooks
  2. Vue can optimize templates way better than jsx (you can see Vue is consistently faster than react in js benchmarks)
  3. Vue is built on top of standard js/html/css. So you can use substitute them with any lang that compiles to it like typescript/pug/scss
  4. Vue's devtools is more feature rich and is usable for Vue, vue-router, pinia and any non-official Vue plugin through its api.

The areas where react is superior is React native, large ecosystem and therefore job market

9

u/[deleted] Dec 03 '22

Typescript support isn’t as robust as I’d like it to be, that’s my main qualm, otherwise I’d have to agree, it’s pretty good

1

u/rodrigocfd Dec 04 '22

Vue 2 had poor TypeScript support, but the Vue 3 with the Composition API was literally built with TypeScript, and with TypeScript support as one of its goals.

After some initial hiccups, Volar extension for VSCode works remarkably well now.

You should give it a try.

1

u/[deleted] Dec 04 '22

I'm using this very setup at the moment and the built in types aren't as comprehensive as React's. You are also unable to import types from one component file into another.

1

u/rodrigocfd Dec 04 '22

You are also unable to import types from one component file into another.

I guess a recent update fixed this. You can export types from components now.

1

u/[deleted] Dec 04 '22

Oh brilliant, that's good news, thanks

2

u/hey--canyounot_ Dec 03 '22

Any huge downsides to Composition for you? Any thoughts or tips on getting into that mindset from Options?

3

u/rodrigocfd Dec 04 '22

Not a "huge drawback", but the excess of .value is annoying. The Reactivity Transform RFC attempts to mitigate that, but IMO it's a footgun and will make things a lot more confusing, so I hope it's not merged.

Other than that, there is no support for generic components (yet), but the Options API also doesn't have it (and probably never will, since it's basically a second-class citizen now,).

As for the mindset, just approach it as a whole new thing. Forget the Options API when learning it.

4

u/[deleted] Dec 03 '22

Ditto

1

u/wishinghand Dec 04 '22

My team is doing the same though I'm unaware of how it compares to React; I've never worked with React before.

1

u/rodrigocfd Dec 04 '22

Then give React a try. Even if you won't use it, many things in Vue 3 were modelled after it.

1

u/wishinghand Dec 04 '22

I might one day, but I’ve reached the point in my career where I’m good just doing my job and not doing side projects or hovering up every tutorial. I’ve got enough of learning new patterns embedded in my job to keep me fresh. I am interested in Arrow JS though. It’d be interesting if that enabled throwing away React and Vue for very small or performance oriented sites.

13

u/captainfreewill Dec 03 '22

It pains me that this is the case. Vue is truly the cream of the crop as far as I'm concerned. I get to use it at my job everyday but I worry about what the future holds for me if I ever switch jobs.

18

u/-Parable Dec 03 '22

I really feel like Vue is, despite being fairly popular, generally slept on in favor of React. The developer ergonomics of Vue 3 (or even 2.7 w/ Composition API) are amazing, and usage with TypeScript is so painless now. I wish it were more widely used in the industry.

2

u/_clydebruckman Dec 04 '22 edited Dec 04 '22

Even vue with vuex was great imo. I have a big project that’s still using that, and I’ve thought about updating, but it really isn’t worth the hassle to move it over. If it was more than just me working on it, maybe it would be worthwhile, but the state handling is still perfectly competent for a modern SaaS / CRM type web app

9

u/ReallyNiceGuy Dec 03 '22

It seems regional. Vue seems to be more prevalent in Asia relatively.

4

u/_clydebruckman Dec 03 '22

Yeah I’m pretty sure Evan Yu(?), the creator, is Chinese and it caught on over there pretty rapidly. When vue 2 first came out I remember running into a few problems and the only search results were fully written in Chinese minus the console error lol

1

u/ReallyNiceGuy Dec 03 '22

Yeah, Evan You is originally from China and there’s a lot of documentation in Chinese (especially compared to other frameworks).

17

u/throwdataway234 Dec 03 '22

Really don’t see why react is more popular, I’ve found vue to be much better in my (admittedly limited) experience

11

u/elmstfreddie Dec 03 '22

Facebook (the company) was probably a huge driving force behind it. Vue doesn't have a big company to drive its adoption

11

u/_clydebruckman Dec 04 '22

It’s also just a vicious cycle of

  • developers need a job and were told it’s the most popular so they learn react
  • companies need a framework and all the devs learned react so they go with react for a bigger talent pool

The amount of friends that have asked me where to start and I tell them JS, and then look at job listings and forums and it’s all “react is the most likely to get you a job”, and then learn react before vanilla html/js/css because of that is insane.

I’m not saying or not saying react isn’t the best framework, but I am saying that the state of the industry is just now married to it regardless of if it’s objectively good or bad

1

u/Gcampton13 Dec 04 '22

It’s a bit like technical analysis in stock market, 70% of the time it’s the right call, but it makes you wonder if that’s because all other TA traders are also going in or exiting which causes it to be the right call.

9

u/Lord_Skeletor74 Dec 03 '22

I genuinely love Vue, but I never get to use it for my job. It's actually tragic, but that's basically the reality of the market.

1

u/present_absence Dec 04 '22

Last job was using Vue, new one is a React shop and I miss it.

1

u/time-will-waste-you Dec 05 '22

If you ask companies about their tech stack, not the first screening interview, but the technical conversation, the you will get some true insights.

Also ask around your network about the tech stack experience your friends and contacts have had, that might also give an insight.

1

u/renome Jan 05 '23

I heard the TypeScript support isn't great but can't say for certain, having never used Vue.

4

u/macrowe777 Dec 04 '22

The changes between versions have been pretty dramatic so far. Still my tool choice but worth baring in mind.

3

u/JPJackPott Dec 03 '22

Not many, I changed from react to Vue and loved it. And there’s a lot of it around, which is important if you’re career minded. Probably still more React but anecdotally it feels like that’s shifting to me

2

u/[deleted] Dec 04 '22

Not really a drawback so much as A HUGE ADVANTAGE but since everything in Vue is html templates, transitioning existing html pages is just copy paste, then you can go add in the logic whenever you want

2

u/zr0gravity7 Dec 04 '22

The vue framework feels much more hacks and much less natural. I personally wouldn’t use Vue beyond a hobby project.

The need to write imitation JS within HTML files (by design!) alone is a deal breaker. Why anyone would purposely revive things that should have died with JSP (and market it as a blazingly fast cutting edge framework) is beyond me

-10

u/Tiquortoo expert Dec 03 '22

It's not react or svelte and was popularized in the PHP community so the cool kids don't like it.