DEV Community

Discussion on: I maintain webpack, ask me anything!

Collapse
 
markerikson profile image
Mark Erikson

Sean: can you please tell me, in great detail, exactly why React is better than Vue? :)

Collapse
 
thelarkinn profile image
Sean Larkin

Mark to me, I'll boil it down to a few things.

Ecosystem: Vue is a grass roots community driven project. They have no business incentives. Because of this, we see things like:

  • Supported router - This is maintained by the Vue team, doesn't have breaking churn, and is an incredibly nice experience.

  • Solved completed and maintained state management - Because of this it works seamlessly with a Vue app. Most of us know...a React app looks completely different then a React+Redux app. or React+StateManagementLibrary app.

  • Great interaction with community best practice build tools (like webpack). Code splitting in Vue takes one line change.

import Component from './vue-component.vue';

to

const Component = () => import('./vue-component.vue');

Its these kind of small and juicy details that screams "We give a shit about the people who use our project and they are always first when it comes to the innovation we bring".

Syntax: Single-file-components are the future of dev in my opinion. Not only are they backed by webpack to create a killer Hot Module Replacement experience out of the box, but they also allow you to write the JSX to have fluid composition if you need to. Most cases I've found that the familiar and rich system that Vue single file components provides is usually enough for me in most cases to never have to write JSX.

Tooling: The tooling behind vuejs for vscode etc is incredible.

Collapse
 
thelarkinn profile image
Sean Larkin

A feature difference that sets them apart is their eventing systems also and "dependency detection".

So instead of having to use a bunch of componentWillUpdate, Vue automatically tracks what state has changed and saves the users the cost of needed to do these kind of things in React.

See here:
Reactivity in Depth

Oh and. There is nothing you cannot do in Vue, that you can do in React.

  • JSX? Check
  • HOC? Check
  • Jest/Enzyme? Check (Enzyme => Avioriaz)
  • Context? Check

So to me it's like: If you are going to choose React as a project, just use Vue instead!

Thread Thread
 
thelarkinn profile image
Sean Larkin

UPDATE: I just realized you asked why React over Vue. lol. In which (comments below have shown me its vice versa). Sorry!

Well I can say this:

React right now is better then Vue in only one way that I can think of. It's ecosystem has a pure native solution that is pretty strongly maintained. Right now Vue has Weex and NativeScript, but I'd like to see Vue/Evan write an official Native Renderer. However that would take a lot of time, and probably not on the roadmap for vue.

Thread Thread
 
markerikson profile image
Mark Erikson

Yeah, I figured you either deliberately or accidentally misread the question :)

Collapse
 
rhymes profile image
rhymes

I love how he asked "why React is better than Vue" and you answered "why Vue is better than React" :-D

Thread Thread
 
jimschubert profile image
Jim Schubert

Easiest way to be right is to answer the question you wish was asked.