Live data from Hacker News

Vue.js vs. React

vuejs.org

161–170 of 486 posts

Re: Vue.js vs. React

#161
post #64

Earlier quoted context omitted.

From the charts, it shows that Vue from 2016 to now well over doubled it's downloads (over 100% growth) while react's only grew by 50%. It can be deceptive when you look at charts that list totals when what you're concerned with is growth rate.

So from 2016 to 2017, React's market share grew from 74.6% to 74.9% while Vue's market share grew from 5.4% to 9.3%. A more accurate narrative would be that Vue is eating the dying Angular.

AngularJS maybe is dying but Angular is on steady growth.

Re: Vue.js vs. React

#162
I experimented a little bit with Vue. I was a little bit disappointed about two points:

1. I couldn't CSS style a Vue component. I find components very important and they should behave like HTML elements. It should be possible to write a element in Vue if that element didn't exist.

2. I find the state management Vuex somewhat an afterthought. Some people say you will know when you need state management, but I think if the integration of state management is really seamless there is no need to avoid state management even for the most simple apps. So don't listen to these people and start with Vuex straight away, even if it takes a little bit more effort.

I'm sure that there are more points for an even better solution. However for the moment Vue seems to me the simplest, the most elegant and most intuitive framework. So I will use it for my future projects.

Re: Vue.js vs. React

#163

Earlier quoted context omitted.

i was in the same boat as you regards to syntax but in 10 mins you will grasp everything about vuejs. of all the frameworks, vuejs has the simplest syntax to learn. its no where as complex as angular and way more elegant. also beats jsx in terms of making your code more cleaner and prettier. im never going back to jsx.

Which part of this is clean or pretty? Button There are some redeeming qualities compared to say, Polymer. But it's neither clean nor pretty

1) @ is just a shorthand for v-on:*, like onclick,onmouseover,on submit, etc. (ie; v-on:submit is alias ed by @submit)

@click="say_something('hello')"

new Vue({ methods: { say_something (str) { ... } } })

2) : is just a shorthand for v-bind (ie; v-bind:disabled="is_disabled()" is aliased by :disabled="is_disabled()"). and this basically allows you to run pure javascript code inside of it.

3) the only other syntax to know is, v-for and v-if, but thats pretty self explanatory i believe.

{{name}}

What is your name?

hello super user {{name}}

i like this approach more than JSX where you have several if else clauses mixed into your HTML. it's kind of like pattern matching if you like that sort of thing.

or you can simply do {{some_message()}} and just handle the logic inside the some_message() method.

Re: Vue.js vs. React

#164

I experimented a little bit with Vue. I was a little bit disappointed about two points: 1. I couldn't CSS style a Vue component. I find components very important and they should behave like HTML elements. It should be possible to write a element in Vue if that element didn't exist. 2. I find the state management Vuex somewhat an afterthought. Some people say you will know when you need state management, but I think i…

One of the biggest selling points for single file components is styling (with optional scoping): https://vue-loader.vuejs.org/en/features/scoped-css.html

If you need to override child component styles from a parent (bad idea in 99.999% of cases), /deep/ would work.

Re: Vue.js vs. React

#165
post #132

We moved away from React to Vue about 8 months ago and everyone on the team is a lot happier. First reason is we hate JSX. It forces you to write loops, conditionals, etc, outside of the markup you are currently writing/reading. It's like writing shitty PHP code without templates. It also forces you to use a lot of boilerplate like bind(), Object.keys(), etc. Another problem with React is that it only really solves o…

> First reason is we hate JSX. It forces you to write loops, conditionals, etc, outside of the markup you are currently writing/reading. It's like writing shitty PHP code without templates. here here! This has been my experience as well

*hear hear! ;)

Re: Vue.js vs. React

#166
post #84

These are the things I find to be killer features of React and it's ecosystem: - React Native (I know there's Weex but it's not production ready, nor as feature rich) - Streaming server side rendering - React Relay (GraphQL integration) - JSX by default . VueJS pushes an Angular-esque template language where I have to learn new syntax, binding concepts, directives and conditional statements. - Corporate backing I've…

> - Streaming server side rendering This feature appeared in React v16 (which is still in beta). Vue had it long before.

I wasn't aware VueJS had streaming server rendering (and I still can't find anything about it), but React has had it long before v16 via a library (https://github.com/aickin/react-dom-stream)

Re: Vue.js vs. React

#167
post #146

Earlier quoted context omitted.

Which part of this is clean or pretty? Button There are some redeeming qualities compared to say, Polymer. But it's neither clean nor pretty

You can make it cleaner: Button

Vue allows you to use Pug syntax in your templates, so this can be even simpler:

  button(:disabled='isButtonDisabled') Button
  div(:id='`list-${id}`")
  form(@submit.prevent='onSubmit')
  a(@click='doSomething')

Re: Vue.js vs. React

#168
post #156
post #108

I've built semi-large applications in both Vue.js and React. I like both but prefer React. For me Vue.js is like a light-weight Angular 1, in a good way. It's very intuitive and you can start working immediately. It does however easily end up in confusion about where the state lives with the two-way binding. I've run into a lot of implicit state changes wrecking havoc. The declarative nature of React definitely wins…

Vue removed real two-way-binding in 2.0. The v-model you commonly see is just syntax sugar. Also, here's the obligatory "Vue supports JSX" link: https://medium.com/js-dojo/using-jsx-with-vue-js-846f4fbbf07... I personally feel that JSX feels a bit "unnatural" compared to Vue's DSL, but that's a matter of opinion. It's always good to have the option :)

Thanks! That's cool and yes, it supports JSX but it's still not a first-class citizen like in React. I don't know the practical implications though since I haven't used so maybe my fear is unfounded.

Re: Vue.js vs. React

#169
Not knowing much about either one, I find 'scaling down' very appealing. I recently did some work with Angular 2, and found it very distasteful because of the big learning curve.

Re: Vue.js vs. React

#170

Earlier quoted context omitted.

This is behaviour that's harmful to the web as a whole. The loop of "everyone only uses chrome" → "I only need to support chrome with my website" → "nothing works on firefox, I'll switch ti Chrome" is harmful to the entire internet industry, and the startuo economy. It is harmful to all of us, and hurts all of our future.

I agree with with you that this is an important issue. However, your aggressive comments that ignore what the other person said may not be helping.

I am getting more aggressive because the other person completely ignores the effects on the surrounding ecosystem, and does not even consider a solution that would provide a compromise, as the "optimized for chrome and safari, ignore and use anyway" button would provide.

I see their situation, and their limits, but this is a very egocentric opinion that completely ignores the effects on the rest of society, which is an issue that's just all too common (see also monopolistic effects, or environmental effects, etc).

Post reply on HN