Hacker News new | ask | show | jobs
by yunyu 3225 days ago
People keep on saying this, but I've written complex apps with both Vue and React (using state stores) and there don't to be any apparent scaling differences. They even use the same component model (virtual DOM, props down, events up).

There are some claims that Vue uses two-way-binding which is unmaintainable, but v-model isn't true two way binding and is just syntax sugar for builtin tags: https://v1.vuejs.org/guide/forms.html With React, you would have to explicitly write the event handler/setter out, and some may prefer explicitness (but again, there's nothing stopping you from doing the same with Vue).

Vue just has some nice features (computed properties, better style scoping, etc) and different methods for inheritance/templating (but you can use ES6 classes and JSX if you want to), and like somebody else mentioned, is plug and play (yes, you can technically write React render functions without a transpiler, but do you want to?) while Vue (with the template compiler bundled) lets you write templates with HTML attributes using just a script embed.

There are a bunch of other arguments that are more nuanced (ecosystem, bus factor, etc..) but from what I've experienced, Vue is no worse at scaling than React simply because they share the same conceptual model.

2 comments

Sounds like I'll have to try it out! Definitely don't want to put all my eggs in the React basket with all the patent stuff right now so would like some experience of the alternatives.
> lets you write templates with HTML attributes

that's somewhat bothersome... does it typecheck on compile time? hope vue works on typescript-language-specs compliant plugin...

As for react, there's TSX (typescript-jsx) that works great (typechecks on props, state, etc.), but I haven't tried it with vue.

If you use single file components, there are some common compile time checks by default for the render function, but I'd argue that type checks are not as necessary as in JSX (which you can use with full type checking in Vue) due to separation being encouraged.

Type checking for props and state inside the <script> tags is fully supported: https://vuejs.org/v2/guide/typescript.html

If you want type checks for inline <template> code (which isn't suitable for anything non-trivial, you should use computed properties or methods instead), see https://github.com/DanielRosenwasser/typescript-vue-tutorial

If you are using uncompiled components (newbies using script embeds) with no build step at all, there are clearly no compile time checks. IMO this is why Vue is significantly more newbie friendly.