Live data from Hacker News

Vue.js vs. React

vuejs.org

211–220 of 486 posts

Re: Vue.js vs. React

#211

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

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…

It looks way more complicated then jsx. Why invent v-if etc when JavaScript has those built in.

Re: Vue.js vs. React

#212
post #184

Earlier quoted context omitted.

> 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. You could theoretically write some template components and "avoid" javascript altogether. I wonder if anyone has actually done that? JSX isn't perfect, but I find the dirty things about it can be mitigated by keeping your componen…

Yes, there is a project called react-templates by Wix that does that. We used it, but once you start using libraries like that one or MobX, why even use React at all?

>We used it, but once you start using libraries like that one or MobX, why even use React at all?

Well, you've got a point. I can realistically see some developers preferring to piece-meal their front end solution though, or build just the parts they need themselves. I like Vue, but the API seems enormous. I get that a lot of people like that about it, though.

Re: Vue.js vs. React

#213
post #86

To me the whole idea of client-side HTML templates seems bad. They start out easy enough, but then they either limit you in power or introduce new and weird concepts to replace things that are easy, familiar and often better designed in the host language. Here is an example on which I'd love to be proven wrong: https://jsfiddle.net/j2sxgat2/2/ Its a generic spinner component that waits on a promise then passes off th…

Here is an example of that code implemented in Vue.

https://codepen.io/Kradek/pen/JyLPaL?editors=1010

I really haven't run into anything I could do in React that I couldn't do in Vue. What I mainly miss in Vue is react-native.

Re: Vue.js vs. React

#214

How are people getting along with Vuex vs Redux? It looks pretty clean and grokable in the examples and deals with async out of the gate - https://github.com/vuejs/vuex/tree/dev/examples/counter

If you use something like Kea ( https://kea.js.org ), the amount of boilerplate for Redux goes down dramatically. The syntax is actually pretty simiar to Vuex, perhaps with even less boilerplate.

Did not known about Kea, seems nice! However, there are no unit tests??

Re: Vue.js vs. React

#215
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…

> It forces you to write loops, conditionals, etc, outside of the markup you are currently writing/reading.

I don't get this complaint at all. Between map and ternary expressions, you can get both loops and conditionals in your markup, e.g.

    
      {listOfThings.map(thing => thing.isX ?
        
        
      )}
    

Re: Vue.js vs. React

#216

Earlier quoted context omitted.

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…

Fair enough. I will say, from a strategic standpoint, my hunch is that presenting your case in a less hostile manner will bring you more success.

Re: Vue.js vs. React

#217
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. You could theoretically write some template components and "avoid" javascript altogether. I wonder if anyone has actually done that? JSX isn't perfect, but I find the dirty things about it can be mitigated by keeping your componen…

I don't think I buy your defence. Sure, you can make JSX look readable - if you decompose your markup into a thousand scattered functions. But this just swaps one problem for another: indirect code, verbosity, not being able to see the component markup at a glance.

I just feel JSX is too awkward and verbose to be pleasant working.

Re: Vue.js vs. React

#218
I prefer React. I do like a lot of the ideas in Vue.js, but when it comes down to it I prefer the lower abstraction level of React.

Where React wins for me:

- Higher order components - Stateless functional components - React 16, especially the scheduler

Also I really like building the virtual DOM directly (JSX) but that doesn't seem to be very popular reading the other comments.

Re: Vue.js vs. React

#219
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…

I've been in this gig for years upon years and I still don't see what's terrible about two way binding.

Can someone actually justify it without handwaving statements like "you'll notice at scale", or red herrings like "Angular is slow"?

Re: Vue.js vs. React

#220
post #46

You'll see quotes in this thread like "The demand for both React and Vue.js is growing tremendously" thrown around. It's good to check out npm install stats to get an unopinionated comparison. https://npm-stat.com/charts.html?package=react&package=vue&p... In reality, React is downloaded roughly 4-5x more than angular and 7-8x more than Vue. In August so far, React has 75% market share among these three libs. Interes…

I think it's going to get there. The sheer number of JavaScript developers means there's always someone out there who wants to try something new, and haven't invested in learning React yet. Doesn't hurt that contributing a meaningful library for a framework comes w/ a healthy dose of internet points.

React was in the same spot a few years ago. It went from a dark horse to the default over the past two years.

Post reply on HN