Live data from Hacker News

Why we chose Vue.js over React

pixeljets.com

91–100 of 267 posts

Re: Why we chose Vue.js over React

#91
post #87

Vue JS framework is very simple yet powerful, also better in performance wise. Learning curve is very easy. You can pick the fundamentals in a day or two. Within a week you can reach intermediate level. It comes with all the basic stuff of SPA like data binding, event handling, routing, state management, components. I have been creating a video tutorials series on Vue js 2 framework. Vue.js Tutorials: http://www.yout…

what I always wanted how many Vue instances do I need for a SPA? Do I just export every javascript object and register them globally? how does Vue.JS work with DI?

Re: Why we chose Vue.js over React

#92
post #11

One of the most impressive thing about Vue.js was the ability of the framework to enter a field saturated with dozens of options, that was becoming dominated by a well-resourced oligopoly (Angular, React), and still win over developers jaded from Javascript-fatigue. The give-a-shit factor from Evan (the creator) is extremely high and was key to its success. Inspiration for anyone building a product in an established…

Basically React seemed immature, as if it wasn't thought out fully but just hacked together. Vuejs seems like what React could've been if it was thought out a Bit more. It just feels a lot more polished. Honestly I think Vue is so far ahead of the curve it isn't a surprise to see more people switch away from React.

I wouldn’t say React is “hacked together”. Perhaps you are referring to the React ecosystem? Facebook doesn’t build single-page apps with React, so naturally it doesn’t provide solutions for routing and similar concerns, so there is more churn as people are figuring this out together.

Re: Why we chose Vue.js over React

#93
post #55
post #45

Earlier quoted context omitted.

Yeah, it's possible in React do to it. But compare that to how Vue handles conditionals: HELLO Duis a turpis sed lacus dapibus elementum sed eu lectus. You specified a home query: {{location.query.home}} No home query was specified I don't know about you, but to me this code is 100% more readable than the React example you gave.

This is how I've come to write that in React, after giving up on attempting to find a consistent way to write ternaries which I would find acceptable when revisiting them (it just never happened): let Home = ({location}) => HELLO Duis a turpis sed lacus dapibus elementum sed eu lectus. {!location.query.home && No home query was specified. } {location.query.home && You specified a home query: {location.query.home} } I…

Come on people. It's so much simpler:

  return (
    
      hello
      {
        location.query.home
        ? foo
        : bar
      }
    
  )
Or just replace that with a one-liner like, and put the respective code where it belongs:

  {location.query.home ? this.renderHomeStuff() : this.renderEtcStuff()}
And simple ifs are obvious:

  
    hey
    {foo && foobar}
  
Always strive to make your render methods simpler.

Re: Why we chose Vue.js over React

#94
post #65

The arguments against JSX and React requiring many small components are very surface level and sound like "we couldn't figure out how to make it work for us so it must be impossible". 1. This was mentioned already, but, yes, you can use ternaries and boolean logic for simple conditionals (loggedIn && Logout || Login ) 2. When you need more markup, put them in an if-else statement in the same render function. render()…

After making some simple , etc custom components.... I've wondered why they don't exist in react by default, or arent the common pattern. They are very readable... maybe people just dont like the "logic" in a tag... i guess... whatever, made for some really readable code...

Turns out javascript is a quite reasonable language and already does that great.

Re: Why we chose Vue.js over React

#95
post #62
post #49

Earlier quoted context omitted.

So React showed that Angular and Ember shouldn't be used, but Vue is just shinier than React right now?

No one gets fired for using React. Vue isn't even shinier in my opinion. It makes the same templating mistakes that Angular and Backbone did.

What are those mistakes? I don't do front-end development so my knowledge is very limited with these (I know the names and a basic idea what they do)

Re: Why we chose Vue.js over React

#96
post #59

Earlier quoted context omitted.

I was never trying to put anything negative into this statement that both these bright people are Chinese-speaking. I know they both live in US (though it might be unfortunate for us that Qiang is currently doing Go programming in Capital One instead of actively developing Yii2). Yii2 and Vue.js are top notch.

I didn't so much read it as a negative, it's just that readers unfamiliar with the projects may think that "Chinese stack" means 1) code/issues are in Chinese and/or 2) the main contributor base is located in China. I've been a long time user of Yii1 and Yii2. Qiang has created 3 PHP Frameworks between 2004-2015: PRADO, Yii1, and Yii2. At one point he was on a >700 day commit streak with work on Yii2. I can't blame h…

I agree with you, and I definitely do not blame Qiang on choosing his way. I just miss him as Yii2 contributor and visionaire because that could make a real competitor to Laravel some day, in terms of community, and popularity across US and Europe. Right now Yii2 seems to move in direction of becoming a niche framework for Eastern Europe and parts of China, instead.

Re: Why we chose Vue.js over React

#97
post #56

I once wanted to use React as a virtual DOM library, nothing more. Turned out that I had to create "components" for every div I wanted to draw. Of course, this was a nuisance to the point that I had to let go of React.

You seem to be mistaken. You don't need to create components if you just want to render some divs. You can just do

    const {render} = require('react-dom');
    const {DOM} = require('react');

    render(
      DOM.div({className="something"},
        DOM.div({className="something-else"},
          'some text',
        ),
      ),
      document.getElementById('root'),
    );
Components become useful pretty quickly as your views grow in size, but even then, function components require very little extra code to use.

Re: Why we chose Vue.js over React

#98
post #65

The arguments against JSX and React requiring many small components are very surface level and sound like "we couldn't figure out how to make it work for us so it must be impossible". 1. This was mentioned already, but, yes, you can use ternaries and boolean logic for simple conditionals (loggedIn && Logout || Login ) 2. When you need more markup, put them in an if-else statement in the same render function. render()…

I think your comment just proves the point of the original post. Your examples are still not good enough for me in terms of syntax and real work with html guys (specifically, has some quirks). I've gone through these things, and the pain&negativity about Angular 1 which translates to negativity to all template engines was also mentioned in the post.

Re: Why we chose Vue.js over React

#99
post #43

I hope I don't get downvoted for asking this but is React going out of fashion already? A lot of the talk about it was "React is here to stay" or "React is as permanent as JS itself" but now this is the second or third time people seem to be going for Vue instead. What happened?

"We've been using React for a year and will continue to do so" isn't an article that gets written often, despite there being more people in that boat than switching to Vue.

React is in no way losing popularity. It's just not as interesting to write about something everyone agrees on. That said, React won't be around forever - very little ever is.

Re: Why we chose Vue.js over React

#100
post #56

I once wanted to use React as a virtual DOM library, nothing more. Turned out that I had to create "components" for every div I wanted to draw. Of course, this was a nuisance to the point that I had to let go of React.

You seem to be mistaken. You don't need to create components if you just want to render some divs. You can just do const {render} = require('react-dom'); const {DOM} = require('react'); render( DOM.div({className="something"}, DOM.div({className="something-else"}, 'some text', ), ), document.getElementById('root'), ); Components become useful pretty quickly as your views grow in size, but even then, function componen…

Interesting, I didn't know, although I can recall searching through the documentation for answers. Does calling the "render" function multiple times perform the DOM-diffing and updating?

And can I be sure that React will not perform updates behind the scenes at other moments than when calling "render"?

Post reply on HN