Live data from Hacker News

Vue.js vs. React

vuejs.org

71–80 of 486 posts

Re: Vue.js vs. React

#71
post #57
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…

Something worth noting is that both Angular and Vue are far more script-embed-directly-into-page friendly (mostly due to templating) compared to React. Almost all React users get it from NPM, while I would expect that the proportion of Angular or Vue users who get them from NPM is lower. I've seen a lot of projects for those two run without any build system (and anecdotally, I'm pretty sure I'm not the only one who's…

I think this would be very likely. For instance, we are still using a bower install of angular due to rails asset pipeline that is committed into repo. Our tens builds per day that would be fetching fresh are not fetching angular for that reason.

Re: Vue.js vs. React

#72
post #40
post #5

Earlier quoted context omitted.

You can do the same with react. Unfortunately with either library you are going to want it for any serious project.

This whole "React is complicated" is a strawman. How is JSX more complicated than any template language? How are Vue components any simpler than React components?

In vue you have forma free reactive data without using shouldcomponentupate. Components are updated when data change and only for the data they binding. You have also local context while react have a global context. Props are reactive ... And many others feature

Re: Vue.js vs. React

#73
post #11

Vue is good for simple things. But it do not shines for complex apps and sometime makes it even harder than it should be. React can appears complicated when beginning, but it pays off on complex apps.

This is the impression I get, but I've not got any Vue experience to back it up so it's literally just based on first impressions. I completely agree that React can feel like overkill for simple stuff, but really shines as the apps get more complex - complexity feels a lot more manageable. For example, I built this in-browser Illustrator-inspired site/app using React and couldn't have imagined doing it without (in te…

> please visit this site using some recent version of [browser that sends all your data to Google]

slowclap

If using a JS framework means you don't have time to test your website in more than one browser, I'll happily continue writing plain JS (or better yet, no JS).

Re: Vue.js vs. React

#74
So Vue is based on the same Virtual DOM as Elm, or its own implementation? Do non-react tools in this arena still have react-like lifecycle hooks, or different ways of handling "on mount" behavior, for example?

Re: Vue.js vs. React

#75

This discussion might just get a lot of light just cause of Facebook rejecting the licensing issue.

Absolutely. I just checked and vue.js uses the MIT license which would seem to be much more startup (and investor) friendly than the React license.

Re: Vue.js vs. React

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

Here in NYC I have yet to see a job posting asking about Vue. It's all either React or maintaining an older Angular app.

Re: Vue.js vs. React

#77
post #56

For what it's worth, I tried Vue first and ended up moving to React and it just seems to click better with me. More/better libraries too. Nothing on the Vue side of things is as good as Material UI.

Vue is heavily dominated by Chinese, there is a ton of MD implementations, but hard to judge. One solid MD implementation in vue is https://vuetifyjs.com/ which is not Chinese.

I've used this one a bit actually. Seems alright, but the performance isn't great. It's a bit laggy even relative to Angular material 1

Re: Vue.js vs. React

#78
post #19

I've used both. What makes me pick Vue in the end is the fact that there is no compiler needed, no jsx and all the non-sense that goes with that. If you want a full blown huge application to last years, then go Angular... Although who knows if Angular will be there in 5 or so years. There is no perfect library/framework but I love Vue because Vue does exactly what it says on the tin.

I've never seen a SPA last "years" without some eventual rewrite or major change. The only sites I see last year are serveres rendered ones or very simple ones.

Re: Vue.js vs. React

#79

What's with the hate for JSX? I think handling HTML as data makes much more sense and is much more convenient than dealing with dumb templates or weird DSLs like Vue's or Angular's.

JSX is closer to JS than HTML, which means it annoying to write in some cases. Quick, what does this render as?

  Link 1 |
  Link 2 | 
  Link 3
It's not

  Link 1 | Link 2 | Link 3
as you'd expect - instead, the whitespace after the pipe character is eaten by JSX. This is because HTML is whitespace sensitive, but JS is not, and so to allow indentation, JSX trims whitespace.

Here's another -

  
    { Object.entries(definitions).map(([term, definition]) => (
       { term }
       { definition }
    )}
  
This does not work - instead, you need to return an array, but the result is ugly - the commas are part of JS, not HTML, and don't appear in the output, but reading this quickly it's hard to see that (the difference is the braces surrounding the block).

  
    { Object.entries(definitions).map(([term, definition]) => ([
       { term },
       { definition },
    ])}
  
Vue's 'weird DSL' is HTML (the same is not quite true for Angular's). What you see is exactly what you get. Having a DSL also means you can define your own syntax. Things that are verbose (due to historical reasons in JS), such as iterating over an object, can be made simple -

  
    
      {{ term }}
      {{ definition }}
    
  

Re: Vue.js vs. React

#80
post #68

Earlier quoted context omitted.

This is the impression I get, but I've not got any Vue experience to back it up so it's literally just based on first impressions. I completely agree that React can feel like overkill for simple stuff, but really shines as the apps get more complex - complexity feels a lot more manageable. For example, I built this in-browser Illustrator-inspired site/app using React and couldn't have imagined doing it without (in te…

I’m curious, how did you manage to build a website that claims to work in Chrome, but not in Chromium? In Safari, but not in Firefox? And worst of all, it actually obviously works in Chromium and Firefox, but you just check the UA. Works: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36 Doesn’t work: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, lik…

Ultimately this was a client project with a fixed budget and timeline so a decision had to be made between extending browser support and adding more features.

Given the target audience (graphic designers, the vast majority of whom are on Mac and will use Safari or Chrome, as I validated from stats on other sites I've built), the decision was made to focus work on the type tester on those browsers.

The rest of the site should still be accessible with any browser, but we decided it was better to not show the type tester at all than have a broken experience (which was the situation with Firefox).

Anyway, hopefully that justifies it somewhat - I think it was the right decision all things factored in. There's a lot of CSS trickery/hackery to make the type tester work (native support for advanced typography stuff is poor) so making it x-browser wasn't easy. The messaging to users of other browsers could probably be improved though :)

Post reply on HN