22 ms·
Vue.js vs. React
- pasta 9y agoMy #1: download vue(.min).js and you are ready to go. No packagemanager, bundler and what not needed.
- nightski 9y agoYou can do the same with react. Unfortunately with either library you are going to want it for any serious project.
- deleted 9y ago[deleted]
- esistgut 9y agoExactly. I would rather see the community focusing on a standard workflow like ember-cli and angular-cli.
- mmcnl 9y agocreate-react-app and vue-cli are both good tools.
- k__ 9y agoThis 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?
- yunyu 9y agoYou can't write JSX without a template compiler (how ergonomic is it to hand write a render function?). It's painful to write React components with just a script embed (this might not be important to you, but it's important for newbies coming from jQuery), while Vue lets you get away with HTML attributes and Vue.extend(). Lastly, Vue's style scoping is superior to anything React has to offer.
- k__ 9y agoHu? You can write JSX with just script embed.
- yunyu 9y ago..How? You'd just get a syntax error. Embedding a runtime babel compiler isn't mentioned in the docs at all (though I guess it would work albeit killing load performance, but it's not something that you would expect newbies to know, especially if it's not in the docs).
- ng12 9y agoWhat kind of webapp are you writing where adding a compilation step adds too much complexity? I get if you're writing an application that's 95% static with a few moving pieces, but otherwise that argument doesn't hold much weight for me.
- musashizak 9y agoIn 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
- nightski 9y agoThis actually scares me because I have extensive experience in knockoutjs. It also used a reactive system. The problem was once the UI became sufficiently complicated performance would suffer greatly. If you had a lot of computed properties changing a piece of data could result in a lot of UI thrashing as each of these are recomputed. I'm not sure how Vue solves this problem, or even if it does but overall the architecture was inadequate.
- deleted 9y ago[deleted]
- mmcnl 9y agoThat usually only works well for really small components. Once you're serious about your web app, you'll end up using the whole developmnet Webpack environment in short time anyway.
- andrew_wc_brown 9y agoMithrilJS
- porsager 9y agoOh if only mentioning mithrils name would be enough to explain it's benefit I think a lot more people would be using it, but we need to do a bit better than that. Mithril is one of the few libraries that really embraces JavaScript and the beauty of a clean abstraction and lean API. There's no heavy learning curve, just learn a couple of method signatures, and you're ready to go. Once you need to do something advanced or use a third party library mithril won't be in your way! I still haven't seen anyone happily go back to react or vue for that matter after experiencing mithril. https://mithril.js.org https://mithril.js.org
- tropshop 9y agoI left mithril for domvm. It has a smaller focus and less magic. https://github.com/leeoniya/domvm https://github.com/leeoniya/domvm
- mycat 9y agoVue.js is like perl. Too many ways to do a single thing
- erichdongubler 9y agoOut of curiousity, examples?
- k__ 9y agoThey bait newbies with their easy data-binding and switch them to components later.
- ktRolster 9y agoThat's a good thing.
- adriancooney 9y agoThis is exactly my concern with Vue, the API is huge! One of React's strongest points is the tiny API.
- holydude 9y agoI would go with react just because it is more popular. Unless you are someone with free hand picking a technology that is more widespread (hence more in demand) is in this era the wise choice to make.
- hobofan 9y agoThe demand for both React and Vue.js is growing tremendously. There isn't really a wrong choice to make here. (I would also say the same goes for picking programming languages, as long as it's one of the top ~15, and you stay somewhat flexible.)
- azr79 9y agoThere is way more demand for Angular and react than there is for Vue
- sudders 9y agoGo for Ember: - Proven tech - No licensing issues - Solid community - Community driven, no company calling the shots
- fny 9y agoI was a huge Ember evangelist until I started trying to onboard other devs into my project. It took months for people to figure out which way was up. In comparison, other devs picked up Vue in a week or so.
- lossolo 9y agoExact same problem here. I've written ~20k LOC non trivial web app in Ember and getting someone into the project that didn't had prior experience in Ember was really tough. Then we were thinking about Vue too and like in your example, that person picked up Vue in around a week also.
- soneca 9y agoInteresting, because my company chosen Ember precisely because it would start a hiring wave of new developers, often junior ones. Mostly because of Ember's "convention over configuration". I dont see much of this problem, including myself as one of these just hired jr devs.
- fny 9y agoThe projects I work typically have very fast turn around times (2-4 months), so I don't have the time to teach a dev use a framework, and I definitely don't have the time to onboard junior developers. I need a framework where any experienced JavaScript developer can pick up the project and deliver working product in a week. With Ember/Angular/React+Redux, I have to hunt for a developer that specializes in that particular framework. With Vue, the hiring pool is vastly larger.
- jacquesc 9y agoSame here. Going back to some large ember projects I built just 2-3yrs ago, it's almost impossible to comprehend. Also, it's impossible to upgrade to the latest version of Ember due to the amount of churn they went through from 1.x to 2.x
- coolvd1312 9y agoThis discussion might just get a lot of light just cause of Facebook rejecting the licensing issue.
- Chirael 9y agoAbsolutely. 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.
- kiwee 9y agoVue 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.
- tomduncalf 9y agoThis 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 terms of making managing state and reasoning about things easy as the app grows more complex): http://f37foundry.com http://f37foundry.com (the type tester on the desktop homepage, apologies for limited browser support!). Curious if you could do that sort of complex app with Vue.
- amirouche 9y agowhat seems overkill in reactjs?
- tomduncalf 9y agoI mean for the simple use cases like adding some validation to a form or a simple widget on a site. But in my experience, these projects usually grow to the point where you are glad you went with React. Personally I'm a huge fan and build things with it I couldn't have imagined doing a few years ago, so I hope all this patent stuff gets resolved/blows over.
- inthewoods 9y agoWhat is complex about the site?
- tomduncalf 9y agoManaging the state and rendering of all the text items as the user manipulates them (this is on the desktop "type tester" homepage, not mobile) - essentially trying to build a "desktop-class" (to some degree!) experience à la Adobe Illustrator. The rest of the site is pretty basic granted. Maybe it's not a great example, but it's the sort of thing that could have easily become unmaintainable in the old days as features were added quickly, but React and the component model (and MobX) made it much more manageable even as I hacked things in last minute ;)
- hammerandtongs 9y agoHow 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 https://github.com/vuejs/vuex/tree/dev/examples/counter
- meagher 9y agoUsing Vuex has a lot less overhead than Redux and async is super! It's fairly easy to keep modular. Here's a medium size store for a project I worked on: https://github.com/tmm/notational/tree/master/src/store https://github.com/tmm/notational/tree/master/src/store
- hammerandtongs 9y agoThanks, that looks pretty reasonable.
- mariusandra 9y agoIf you use something like Kea (https://kea.js.org 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.
- Tade0 9y agoDo you happen to know whether there's an equivalent for NgRx?
- hammerandtongs 9y agoYou've done a nice job with kea. The examples are pretty clear. Somehow the selection of verbs and structure is more readable for me in the vuex example but I'm not sure you could do much about that. I won't be using this as it definitely sets off my library-depth spidey sense. The multiple libraries it abstracts would all change versions over time and lead my applications to be even more brittle. Vuex being mainline with Vuejs is a major plus as I look at its long term stability, though whether it insists on vuejs I need to look into.
- keyle 9y agoI'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.
- noir_lord 9y ago> If you want a full blown huge application to last years, then go Angular. After what they did with Angular 1 -> 2 not a chance. At least with Vue you can swap it out a lot more easily if it does go away in 3 years.
- ergo14 9y agoRight now a great option with "forward-compatible" applications would be to go Polymer.
- noir_lord 9y agoI saw a talk on Polymer about 2 years ago where it was the next big thing, here we are two years later and it doesn't seem to have progressed at all - I do get that it is the future I just don't think it's one that's quite ready yet.
- ergo14 9y agoYou mean it hasn't catch on with the community or it hasn't progressed as a technology?
- noir_lord 9y agoThe former, no idea on the latter. I tend not to pay serious attention to technologies until they are popular and have been used for a while (I always adopt on the back side of the hype/productivity curve, since I'm not completely a front end developer).
- kennysmoothx 9y agoI used React for a few years and it was great and powerful, there were many things however that I disliked.. Particularly I was not a fan of JSX. I liked React but I did not feel comfortable using it. When I first saw VueJS I had a hard time understanding how it would be any better than React, that is until I saw single file components. https://vuejs.org/images/vue-component.png https://vuejs.org/images/vue-component.png I fell in love with the eloquence of being able to separate my HTML, JS, Styles for a single component.. it seemed /right/ to me.. In any case, I've been using VueJS ever since for my new projects moving forward and I'm very happy with it. It has everything I would ever need from React but in what I feel is a more polished and thought-out way. Just my two cents :)
- meagher 9y agoCompletely agree! Single-file components are more natural to how I think about the web. It's worth noting that Vue also supports render functions with JSX (https://vuejs.org/v2/guide/render-function.html https://vuejs.org/v2/guide/render-function.html).
- wolco 9y agoOne of the reasons I moved to vue was the template section allowed normal html. Saved me so much time styling. I do like jsx for simple things but always felt it bogged down the design piece having to convert even if its just the class to className
- masklinn 9y ago> I used React for a few years and it was great and powerful, there were many things however that I disliked.. Particularly I was not a fan of JSX. JSX is no more than sugar for vdom function calls. You can use React without JSX, and you can use Vue with JSX. > When I first saw VueJS I had a hard time understanding how it would be any better than React, that is until I saw single file components. > I fell in love with the eloquence of being able to separate my HTML, JS, Styles for a single component.. it seemed /right/ to me.. You… can do that just fine in React? The logic and "template" are in the same file in the first place, and there are solutions like styled-components, csjs or react-styl if you also want the JS.
- JoshMnem 9y agoElm is also promising: http://www.oreilly.com/web-platform/free/files/why-elm.pdf http://www.oreilly.com/web-platform/free/files/why-elm.pdf
- Rotareti 9y agoI'm using react and like its functional approaches. I started implementing libraries such as immutablejs, recompose and ramda. I also make use of pure functional components exclusively. Then I had a look at Elm and I realized that, with all the libraries I have put together, I created my own crippled frankenstein'ish version of Elm. I think I really should give Elm a try!
- grav 9y agoAgree that Elm is a good all-in-one solution for SPAs. You should also give ClojureScript with the simple React-wrapper Reagent a spin. All the functional stuff is built into the language, like Elm, albeit without the types, which both has its pros and cons.
- baybal2 9y agoIt surprises me how this "vue vs react" gets to the first line for the 10th time in one or another form
- hn_throwaway_99 9y agoIt's because of the recent decision by Apache Software Foundation to prohibit using Facebook's "BSD+patent" license in their projects. Many people are now on the hunt for alternatives because of the licensing issue.
- seattle_spring 9y agoLet me guess-- you're going to argue that "shills" are behind the quick rise?
- baybal2 9y agoTell why should I?
- baybal2 9y agoAngular - has appeal for "corporate apps," well, because of Angular 1.* React - has influence wherever Facebook has influence Vue - took off in China as FB did not bother to proselytize developers there
- a13n 9y agoYou'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&package=angular&from=2016-01-01&to=2017-08-19 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. Interestingly, this share has grown in August compared to both last month (July) and beginning of year (January). While this thread and the license thread might indicate that React is dying, it's not. It's growing. If Vue is going to be what React is today, it has quite a long way to go.
- throwaway13337 9y agoFrom 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.
- a13n 9y agoSo 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.
- msoad 9y agoIs there a compiler for Vue components to web components? I'm worried about forward compability of all this React components I'm building
- steinuil 9y agoWhat'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.
- mediumdeviation 9y agoJSX is closer to JS than HTML, which means it annoying to write in some cases. Quick, what does this render as? <a href="...">Link 1</a> | <a href="...">Link 2</a> | <a href="...">Link 3</a> 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 - <dl> { Object.entries(definitions).map(([term, definition]) => ( <dt>{ term }</dt> <dd>{ definition }</dd> )} </dl> 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). <dl> { Object.entries(definitions).map(([term, definition]) => ([ <dt>{ term }</dt>, <dd>{ definition }</dd>, ])} </dl> 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 - <dl> <template v-for="(definition, term) in definitions"> <dt>{{ term }}</dt> <dd>{{ definition }}</dd> </template> </dl>
- steinuil 9y agoGood point about the whitespace, but I'd still rather have the templates inside my code than separate the two, mentally parsing two separate languages with different syntax and stitching them together is a lot more mental overhead IMO.
- jaequery 9y agoi assure you, you will get over that phase real quickly. you will come to appreciate how nicer it is to write your code this way. because the same thing happened to me.
- jrs95 9y agoFor 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.
- highace 9y agohttp://www.muse-ui.org/ http://www.muse-ui.org/
- jrs95 9y agoI don't know how I missed this one, but it actually looks great. A lot of others I've looked at either has performance issues or doesn't really conform to MD very well. At least from the demo site, that doesn't appear to be an issue here.
- ziggzagg 9y agoVue 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/ https://vuetifyjs.com/ which is not Chinese.
- jrs95 9y agoI'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
- okramcivokram 9y agoThere's also http://vuematerial.io http://vuematerial.io
- equasar 9y agoVuetify is better IMO: http://vuetifyjs.com http://vuetifyjs.com
- iwebdevfromhome 9y agoIf the licensing is an issue with React, then what about Preact?
- jvvw 9y agoFor anybody looking into vue.js for the first time, I highly recommend starting with Laracasts series of screencasts which I found much more helpful than the information on the vue.js site itself when I was getting to grips to with it: https://laracasts.com/series/learn-vue-2-step-by-step https://laracasts.com/series/learn-vue-2-step-by-step
- jvvw 9y agoFor anybody looking into vue.js for the first time, I highly recommend starting with Laracasts series of screencasts which I found much more helpful than the information on the vue.js site itself when I was getting to grips to with it: https://laracasts.com/series/learn-vue-2-step-by-step https://laracasts.com/series/learn-vue-2-step-by-step
- hellofunk 9y agoSo 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?
- hanley 9y agoI'm not very familiar with React, but Vue does have lifecycle hooks that work well: https://vuejs.org/v2/guide/instance.html#Instance-Lifecycle-Hooks https://vuejs.org/v2/guide/instance.html#Instance-Lifecycle-...
- jaequery 9y agoi sense there may be a flood of react devs switching to vuejs. once their react projects are finished. honestly react devs are missing out on how great the vue experience is. it didnt take me too long to see how much better vue is.
- growtofill 9y agoI would say that experience-defining tools are webpack-dev-server with hot reload, ability to use modern ES features and type definitions via TypeScript or Babel+Flow. These are available for both Vue and React. Is there something on top of that available for Vue?
- jaequery 9y agohttps://nuxtjs.org/ https://nuxtjs.org/. here you get all of that out of the box
- jameslk 9y agoThese 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 used React in very large projects, where these features have been fairly critical. React's licensing is odd but not odd enough for me to ditch it. I'd really hate to see the community churn once again on frontend libraries, but that's JavaScript for you I guess.
- jaequery 9y agoi 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.
- mateuszf 9y ago> i was in the same boat as you regards to syntax but in 10 mins you will grasp everything about vuejs. Not sure about the original poster, but I prefer react/jsx not because it's simpler, but it's more powerful - it's a simple extension to a full programming language. You can do whatever you want with it.
- jaequery 9y agoperhaps you might be thinking that you can't run raw js with vue? well you get js and more. it's just less coding and boilerplate if anything. vue also optimizes your reactive codes and is faster in many cases. react can get pretty slow and heavy if you don't know what you are doing and trying to debug those situations can get pretty hairy. otoh, i've not seen any similar issues with vue. what vue does with the bindings is really neat.
- dmitriid 9y ago
- spion 9y agoTo 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/ https://jsfiddle.net/j2sxgat2/2/ Its a generic spinner component that waits on a promise then passes off the fetched data to any other custom jsx. It can also take onFulfill and onReject handlers to run code when the promise resolves. The concrete example shown in the fiddle renders a select list with the options received after waiting for a response from the "server". An onFulfill handler pre-selects the first option once data arrives. The observable selected item is also used from outside the spinner component. With React+mobx and JSX its all simple functions/closures (some of them returning jsx), lexical scope and components. With Vue I'm not sure where to start - I assume I would need to register a custom component for the inner content and use slots?
- al2o3cr 9y agoor introduce new and weird concepts to replace things that are easy, familiar and often better designed in the host language. Oddly, that's exactly how I feel about the "{condition_expression && template_evaluation}" idiom in JSX.
- spion 9y agoPersonally I prefer the ternary operator in those cases, however I think do expressions will fix most of the if/else awkward stuff: https://babeljs.io/docs/plugins/transform-do-expressions/ https://babeljs.io/docs/plugins/transform-do-expressions/
- gunn 9y agoCan that actually help react look better here? I'm currently imagining: { do { if (condition_expression) { template_evaluation } }}
- 9y ago
- DonnyV 9y agoA lot of people don't know about RactiveJS https://ractive.js.org/ https://ractive.js.org/. Which I think is better and easier to use then most.
- codehaks 9y agoI used both react and Vue, and I would always choose Vue.js over react. beside all the features Vue has, its the documentation that I really like. it makes you want to read more and more.
- ergo14 9y agoAnother option that is interesting right now is Polymer 2.x if you haven't tried it recently, give it a shot. https://vuejs.org/v2/guide/comparison.html#Polymer https://vuejs.org/v2/guide/comparison.html#Polymer There are some similarities shared between polymer and react/vue (personally only used react and angular 1.x before). I've built applications with it using polyfills and things worked just fine with legacy applications on IE10 + jquery interacting with web components. Performance is nice, there is more and more adoption from giant enterprises like Netflix, IBM, GE, Gannett, Electronics Arts, CocaCola, ING, BBVA. Webcomponents.org has over 1k components to choose from and is growing. Now with `lit-html` arriving soon we might see alternative to JSX if someone wants that, polymer-redux or polymer-uniflow is available as an option too. https://hnpwa.com/ https://hnpwa.com/ - one of fastest Hacker News implementations is based on Polymer - and that is even without SSR. SvelteJS also seems nice, although it seems one-man project for now :( On Polymer end I hope that on the summit next week they will announce proper NPM support finally and I miss that.
- kevmo314 9y agoHaving 1k components sort of seems like a bug rather than a feature. How does that avoid becoming left-pad hell again and how would you expect any sort of quality control out of that?
- ergo14 9y agoNot really (I'm not even sure of a feature of "what" would it be?)- it is not like you have to use any of that - you could make same criticism for NPM, pypi etc. Webcomponents.org is just a repository, nothing more. If you want quality then you just use components backed by reputable authors - I guess that is the universal rule for development in general.
- kevmo314 9y agoThat's sort of my point. Having ten different implementations of, for example, a data table, each using its own variant of what button template it prefers seems like exactly the kind of hole npm dug itself into. That doesn't seem very desirable for a UI framework that is shipped to clients and demands polish. Sure, you don't have to use it, but it's the main selling point of polymer. It seems nice in theory but npm also seemed nice in theory.
- Kiro 9y agoI'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 here, especially working with stateless functional components. If you're serious about Vue you should adhere to unidirectional bindings, components and use Vuex. The best thing about Vue.js for me is the single file components. It's such a nice feeling to know that everything affecting a certain component is right before your eyes. That's also the reason I started adapting CSS-in-JS in my React components. The biggest problem for me with Vue.js is the template DSL. You often think "how do I do this complicated tree render in Vue's template syntax? In JSX I would just use JavaScript". For me, that was the best upgrade going from Angular to React and it feels like a step backwards when using Vue.js.
- LrnByTeach 9y agoVery Nice summary > I've built semi-large applications in both Vue.js and React. I like both but prefer React. > If you're serious about Vue you should adhere to unidirectional bindings, components and use Vuex. > The best thing about Vue.js for me is the single file components. It's such a nice feeling to know that everything affecting a certain component is right before your eyes. >The biggest problem for me with Vue.js is the template DSL. You end up with the "how do I do this complicated tree render in Vue's template syntax?
- yunyu 9y agoVue 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-846f4fbbf07f 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 :)
- Kiro 9y agoThanks! 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.
- vladimir-y 9y agoVue.js is going to win because simplicity and easier bootstrapping matter. In the same time Vue.js is powerful enough for building the complex and scalable apps.
- scottmf 9y agoCRA or Next.js make bootstrapping incredibly simple, and they're production ready.
- vladimir-y 9y agoBootstrapping matters more for the сurious and not very experienced individuals, think like Vue is a new jQuery.
- scottmf 9y agoIt's not uncommon to have Node installed, and it's to easy install if you don't. But if you find value in dropping in a CDN link, you can use React and Babel that way too.
- vladimir-y 9y agoI'm not writing about my personal preferences, this was the key point: > think like Vue is a new jQuery
- danielharrison 9y agoOnboarding green devs into anything more than a simple Vue app is a lot more complex than a React app of similar complexity, from my experience. The simplicity of the nested, inception style architecture of React makes it super easy to onboard and up-ramp.
- zmmmmm 9y agoCouldn't disagree more. Or perhaps, more accurately, I think the scenario you are referring to isn't the one that matters. It's not about taking a massively existing complex application written using one of VueJS or React and onboarding someone completely green into it. Adoption is about "how easily can I incrementally adopt this technology into my legacy app". And the problem is that React is nearly unusable without switching entirely over to a Webpack / transpiler system and learning JSX, which makes it almost a non-starter for someone who isn't planning a major rewrite of their legacy app front end. By contrast VueJS "just works" after dropping a simple JS bundle into a page and the first templates you write are barely distinguishable from regular HTML. You can start by just enhancing the odd page element here and there, and slowly build up to a fully based VueJS app.
- deleted 9y ago[deleted]
- zpr 9y agoOne of the biggest things React has going for it, other than being maintained by Facebook and having a much larger community, is React Native. You can learn one web framework and now also make compelling, real native apps. To me those are both deal makers. Surprised I haven't seen this mentioned more in the thread.
- krirken 9y agoI agree, there are many competitors to React for targeting the DOM, but there is much less competition for targeting Native. I hope to see more JSX-to-Native engines pop up soon to solve that problem.
- XCSme 9y agoOr you can just compile any HTML5 mobile app using Cordova and in 99% of the cases your users won't notice any performance difference between native-app and HTML5 app.
- jdiaz5513 9y agoMaybe for extremely simple webapps that might be true, but for any non-trivial Cordova+React based app you can't come anywhere close to the UX you can get with React Native without some extreme engineering effort. I'd much rather eat the cost to port the HTML5 app to React Native instead. Yes, the users DO notice. Inability to have the same level of control over soft keyboard behavior is one of the top problems with Cordova, IMO. Source: wrote & maintained a Cordova+React app on iOS/Android for 3 yrs.
- XCSme 9y agoYeah, you are right, I was mostly referring to the performance part. If you need native UI elements or native UI interaction it's harder to do that in a HTML5 app. I mostly worked on games, where the UI is custom and there are very few similarities to the UI of the OS, so it worked pretty good.
- rjvir 9y agoYup, the marginal convenience advantages to web apps are so minimal compared to the ability to write legitimate native mobile apps. Vue.js and Angular are complete non-starters for me since they don't have native counterparts.
- pier25 9y agoWe 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 one problem. There is no official React router and we hated using the unofficial react-router for a number of reasons. A lot of people end up using MobX too. With Vue there is no need to resort to third parties for your essential blocks. It provides an official router and store called Vuex, which IMO blows Redux out of the water when combined with Vue's reactive data. Vue docs are probably one of the best I've used. They provide technical docs, plus excellent narrative docs (guides) for all their projects (Vue, Router, Vuex, templates, etc). I won't say that Vue is perfect, but we would never go back to React. If you don't like Vue but want to get out of React, check out Marko, the UI library by Ebay. It's better in every way than Vue or React except that the community and ecosystem are almost non existent. http://markojs.com/ http://markojs.com/
- TheCoelacanth 9y ago> 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. <div> {listOfThings.map(thing => thing.isX ? <X thing={thing} /> <Y thing={thing} /> )} </div>
- pier25 9y agoAnd you think that's easier to read and write compared to any templating language of the last 15 years? Btw you missed :
- donpinkus 9y agoIt's slightly less easy to read than <li ng-each={myList}>...</li> But it means you don't have to learn a library's HTML API. Or when you want to loop through myList, but exclude a few particular items... you know how to write that in JS, but have no idea what to do in the mark up language. You could create a filteredList, but it's often not ideal
- chj 9y agoI checked React, didn't like JSX, then I find out about vue, and after an hour or two into its guide, I am completely hooked. Especially love the fact that you don't need a compiler, or a node installation. Although single file component looks very nice, I don't want to "bring in a whole jungle just to have a banana".
- baxtr 9y agoThe single best argument for vue is that we should not support large internet monopolies. vue is so awesome even more so once you realize that it is basically driven by a single person
- shams93 9y agoI don't know why inferno isn't more popular, I use a lot of html5 apis so for what I'm working on inferno is more useful to me than react or Vue. I'm doing webaudio so react native doesn't help me. Also inferno doesn't require me to enter into a patent agreement with Facebook and yet I get all the benefits of react from using inferno. Now if I were needing to use native APIs then I might need react native but then you have to balance that need with the potential license issues
- colordrops 9y agoI know this is about Vue vs React, but a lot of the things people are saying they like about Vue can be found in Google's Polymer. It's very simple to comprehend and you can make single file components. And it's based on W3C standard web components so you won't be building yourself into future obsolescence. With Polymer 2 components are now built using classes, so your code is clear and 100% native JS. Lastly, the goal of the Polymer team is to get rid of Polymer by advancing web standards, and with 2.0 you can see they are definitely following this approach as Polymer doesn't add much to web components other than ease of use functionality such as template binding and cross browser shims.
- mStreamTeam 9y agoI've used polymer and I wasn't impressed. I found it was much slower than Vue and the docs left a lot to be desired.
- colordrops 9y agoWhat was slow about it? Depending on how you use template binding, it should be as fast as anything else.
- Andrex 9y agoIt's possible he was using Polymer v1, which was pretty slow. Polymer v2 in a web browser that supports Web Components v1 should be pretty fast, though. But that was only released last May.
- octalmage 9y agoIt was very slow to first paint around 1.0 which made me use something else. But it's become so much faster since then.
- Xeoncross 9y agoI use material design. Angular and React have the best MD libs as of a month ago. I also make mobile apps. Angular and React have the best native apps as of a month ago. I use old devices. React and Vue are the most responsive. Large companies use React on desktop and mobile. React it is.
- _nalply 9y agoI 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 <video> 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.
- yunyu 9y agoOne of the biggest selling points for single file components is styling (with optional scoping): https://vue-loader.vuejs.org/en/features/scoped-css.html 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.
- _nalply 9y agoVue components are second class citizens compared to HTML elements, because you don't style them, you pass them props. This idea with stylable components is for a different framework, perhaps.
- jaequery 9y agowhat? vue does all that. i don't think the op tried vue at all, lol.
- davidw 9y agoNot 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.
- saganus 9y agoMaybe a bit off-topic, but not so much IMO. Everyone talks about react, angular and vue.js. How about Polymer? What are your experiences with it, if any? I'm no expert in either technology, but Polymer seems much more lean, needs no build process as far as I know, and is quite flexible. Why wouldn't it be an option to replace react/angular/vue? Any thoughts?
- ergo14 9y agoIt is an option to replace other frameworks - I've built an SPA with it, it was very clean and natural feeling to me. Building Polymer components is very similar to building Angualar 1.5 `component()`s or react components (or actually any component system for that matter). New elements are true DOM nodes which is quite an advantage in my opinion. You can add redux/uniflow on top of that or some vdom lib like preact too if you need that - I wonder what will come out of `lit-html` that is supposed to be vdom alternative. One interesting thing one should understand that applications view components that are not meant to reusable should NOT use Shadow DOM (just regular DOM)- this way you can use bootstrap or whatever else to provide "traditional" styling of your application. BTW I think right now Polymer also requires a build process - because 2.0 is written in ES6 so that means building to support older browsers like IE10/11.
- idibidiart 9y agoI have to many points associated with this handle. I'd like a 100 or so shaved off React is for CS-savvy programmers. Vue is for those who like to think of themselves as programmers.
- kraf 9y agoI 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.
- mrtracy 9y agoAs someone who has been maintaining a growing React/Redux app for a while now, this one has kept me up at night. The main arguments in favor of Vue.js revolve around the idea that it is easier for new developers to understand; that people can pick it up and immediately be productive, with React/Redux being much harder to understand. As someone who wants to onboard new developers onto my project, it makes me wonder if I need to look into a switch, if not for my current project then for the next one. A lot of the commonly touted differences are either a wash, or are only benefits for very small applications with perhaps a single developer. These would be Templates vs. JSX (This is a wash, they're the same thing, but this maybe even favors JSX for large applications), running Vue.js without a build system (you will want a build system regardless for any production application), "Two-way data binding" (Fools gold, will cause horrors if you ever use watches, you will end up hoisting almost all of your data to Vuex anyway in a production application) and "Single-file components" (Really skeptical that this will make a difference in development vs. any other organizational strategy). I can expand on any of these, but they've already been discussed to death. + Where I think Vue.js is actually superior to React: Vue.js is quite opinionated and clear on where to put both data and computed properties. That's basically it, but it's a huge difference. React itself is very hand-wavy about where to put data and how to interact with it; it basically leaves the problem for someone else to solve. Even Redux, which is designed specifically to store application data, has a weird interface to connect your data to the React application and has no opinion on where to put computed properties. React-router suffers from this same problem as well; you basically end up looking for blog posts on Medium to figure out how to construct an actual SPA out of these components. This is a gigantic failing of the React ecosystem, and I think this represents almost 100% of the perception (or perhaps even reality) that developers understand Vue.js better than React. + Where I think React/Redux is still better The React ecosystem takes a lot of inspiration from functional programming; it prefers "immutability" and pure functions whenever possible, and I think this becomes increasingly valuable as your application grows; not just for enormous applications, but even for medium-sized applications. Even if you're exercising maximum discipline with Vue by hoisting your state to Vuex, you've still got many opportunities to create difficult bugs based on the mutable state. Are you sure you're not referencing mutated state in one your actions? Does one of your components hold onto mutable state in order to do a custom transition or animation? If you're using watchers, you're really risking some dangerous bugs here. Now, I know you probably won't do something silly like this, but as your development team grows and you can't code review everything going in anymore; can you vouch for everyone on your team not to make a subtle mistake with a mutable reference? React/Redux also enables a few very useful patterns that Vue/Vuex doesn't offer at all. For example, the famous optimistic application is nearly a first-class use case for Redux, but would be quite difficult to implement in Vue. This doesn't matter for small applications; it does matter for large applications. Will it matter for your medium application? The same thing about Isomorphic rendering; Redux was built with this squarely in mind. It won't matter for your small app; are you planning for your app to be small forever? Finally, because it is all Javascript, I think React/Redux has a much better ecosystem of tooling. That includes both linters and transpilers; for example, writing Vue in typescript isn't especially natural, but it works great with React/Redux. When considering my own purposes, effectiveness with Typescript is one of React/Redux's greatest advantages. In summary, I would still maintain that React/Redux is better for medium to large applications than Vue, due to its commitment to pure JS and the inspiration it takes from functional programming. However, I definitely see the appeal of Vue.js, and I wish that the React ecosystem would take a note on how to provide clear opinions for developers.
- mshenfield 9y agoThe conciliatory tone is refreshing - as a community it doesn't have to be a "Vue vs. React" death match. Both are reasonable approaches that incorporate some pretty dope technology in slightly different ways.
- IgorPartola 9y agoI happily used Angular 1 for a few things. When it became clear that Angular 2 was the party line, I looked at it and unfortunately found an overengineered framework chasing what React was. I looked at React, but without a cohesive framework, that ecosystem is just a bit too much of a mess. A gazillion starter app templates that can't quite agree and always seem a little out of date with the fast moving components. JSX is just ugly. At least to me. I regularly use Django templates, so the clean leap to Handlebars-style templates feels very natural to me. Redux is straight up unapproachable to someone new to the concepts, but at the same time it feels like it simply reinvents events and event handlers. Vue was a revelation. It is simple, cohesive and I feel productive.
- bennyp101 9y agoI'm currently investigating Vue to see how it compares to the current React code I have. So far I'm liking it. The main things that I like so far; * Single file components - I actually really like this, I find it much easier on my brain to have everything related to a component in the same file. * The router and data modules - having the router and Vuex as "official" parts of the ecosystem (as opposed to in React where they are "adopted") means that everything just clicks. * Styling - when I first started out with React, it was a pain to find a nice way to do CSS - do you use modules? Just have files that you import? Inline? Having it automatically scope the styling to the component if wanted, or using modules if thats your thing - is so much nicer than having to think about it. I just add <style lang="scss" scoped> and I don't have to worry. The only downside I have at the moment, is having to learn the "v-" bindings (which is what put me off Angular when it first came out) but I think that it is something I can live with. Although you can use JSX and have a render method so I might try that and see how that flows for me.
- erdle 9y agoThese are the threads that are often to the most frustrating to picking anything...
- obilgic 9y agoIn React, everything is just JavaScript. Not only are HTML structures expressed via JSX, the recent trends also tend to put CSS management inside JavaScript as well. for me this is the deal breaker, just JS should be enough.
- tomelders 9y agoUgh. Vue.js is just Angular 1.
- conradfr 9y agoIn a way VueJS is "React for those who liked Angular1". I've done many Angular apps. I've done a bit of React (with Reflux & Browserify). I tried moving to React/Redux/Webpack but it's not an easy task to grasp the whole thing. Webpack itself was close to make me throw the towel on side projects. I tried VueJS because of a job interview and quite liked it and got productive really fast thanks to good documentation and my previous experience in angular & React. Professionally I wouldn't mind any of those but for side projects it will be VueJS from now on. As a side note I don't get why all the boilerplates always mix backend and frontend code and dependencies. If you're not interested in a node backend and learning it's overwhelming. The worst thing is that boilerplates you find are always outdated (router, hot-reloading etc) and worst of all mingling server and client deps so if you're not interested in a node backend you have to
- buchanaf 9y agoI feel like a broken record, but definitely take a look at create-react-app if you haven't already. Its extremely well documented and takes care of managing the 20+ dev dependencies that are typically associated with a project.
- phatbyte 9y agoIf I was reading your post 3 months ago, I would completely agree with you. But learning React/Redux and Webpack is not that hard at all, just focus on one and move on to the next. WebPack is dead easy IMO, Redux is just an design concept, but it's easy to implement as well. I think sometimes developers over hype technology and make it sound incredibly hard, when in fact is just isn't.
- sheeshkebab 9y agoVue feels like a framework written by AngularJs developers. It's not "better React", it's more like better angularjs. Html templates are a major turn off for me there, and using JSX is not optimal.
- taphangum 9y agoIf anyone is interested in more Vue talk and some back and forth, check out the VueJS subreddit here: https://www.reddit.com/r/vuejs https://www.reddit.com/r/vuejs. It's probably the most active VueJS community online.
- coding123 9y agoActually my major complaint of React is the state of state. There seems to be no common knowledge about how to do this right. I just joined a team that has two React projects that development started about two months ago (I just joined like a week ago). There is a a large component that I am working on that is completely bound to Redux. There are major state update issues and the team had opted to assign IDs and data to the DOM elements and use those to look up state in the redux store before modifying it. On top of all that, the application is completely unable to handle 2 instances of any component they wrote. I am trying to re-write some of it to encapsulate the state in at the component level. It's pretty awful compared to the Angular (not AngularJS) app I recently rolled off of. Edit : Also wanted to add, while I think a lot of people really don't like JSX, I actually do like it but I think someone could take that aspect and come up with a better state management system outside of redux and friends. I think something along the lines of Angular (not AngularJS) with JSX would be great.
- mmcnl 9y ago> There are major state update issues and the team had opted to assign IDs and data to the DOM elements and use those to look up state in the redux store before modifying it. This sounds awful and seems like an anti-pattern. I don't think this anything to do with React (other than perhapps that React gives you the freedom to do things wrong). Your devs don't have a proper understanding how React (or Vue) works. Define state model, define view, modify/interact with state, let React modify view. That way you'll never need dirty hacks like fetching state from Redux by using the DOM ID.
- blumomo 9y agoIn this thread people are fighting about their _opinions_ why they use Vue.js or React. And why X is really better than Y. In reality these programmers don't want to have the feeling they might have made the wrong choice when they used X instead of Y. The idea that they might have taken the poorer choice hurts so much that they need to defend their decision so heavily while in reality taking ReactJS or Vue.js is like ordering pizza or pasta. You usually don't want to have both at the same time. So you need to explain why pizza is better than pasta tonight. Only that you usually have to stick longer around with Vue.js or ReactJS once chosen. Enjoy your choice and solve real problems, but stop fighting about it, programmers. Pasta and pizza will always both win.
- frogfuzion 9y agoThis should be the top comment. This sort of "debate" has happened since the dawn of programming and will continue to happen until AI programs for us. The reality is it is all shite! Just get your job done.
- tigershark 9y agoYou can't compare react and vue with pizza and pasta. Pizza and pasta are two finished products, while react and vue are two different ways of building the same product. Your comparison doesn't make sense at all to me.
- nartubio 9y agoSay you're about to cook pizza or pasta, you use flour and tomato for both. Comparison not 100% off IMO.
- tigershark 9y agoNo. 1000 times no. For the pizza base you use flour, water, salt and yeast. For fresh pasta most of the time you use flour and eggs. The process moreover is completely different. You NEVER use tomato for making the fresh pasta or the pizza base. You may use tomato as a condiment for pasta and pizza. This comparison is even more wrong than comparing apples and oranges. But I expect that unlike me you never cooked pizza and fresh pasta if you can't see the obvious difference.
- bluepnume 9y agoFor me, the best thing about jsx is the fact that it's so easy to create different implementations of `React.createElement` to solve different problems outside of the scope of React itself. Want a render function that uses jsx but returns a string, a DOM tree, or something entirely different? Totally possible! I didn't like jsx at first, but the fact that it's so decoupled from React itself counts extremely in its favor, in my view. For example, for one of my libraries I wanted a really simple way to allow people to include custom templates. I started with string-based templates, but quickly realized that this was inflexible for any kind of event binding or later dom mutations. Achieving that was super easy with jsx -- I just implemented a custom jsx function which directly outputs DOM elements. Step 1: implement a jsxDom function [^1] which takes (name, props, children) (e.g. https://github.com/krakenjs/xcomponent/blob/master/.babelrc#L11 https://github.com/krakenjs/xcomponent/blob/master/.babelrc#...) Step 2: point babel to my jsxDom function (e.g. https://github.com/krakenjs/xcomponent/blob/master/src/lib/dom.js#L938-L1015 https://github.com/krakenjs/xcomponent/blob/master/src/lib/d...) This even allowed some cool hacks like including iframes directly in the jsx, to sandbox sections of the page (since the library is geared towards creating components to be embedded on 3rd party sites): containerTemplate({ jsxDom }) { return ( <iframe> <style> p { margin-top: 40px; } </style> <p>I can be sure the styles in this iframe won't affect the parent page</p> </iframe> ) }
- crisopolis 9y agoI'm curious Vue.js has always had this comparison guide. Why re-post it now?
- xxxmaster 9y agoThis part of the documentation is pretty unchanged for the last 6 months I think, how come it gained so much attention today? We've been using Vue instead of Angular 2 and we are pretty happy with our everyday work. So +1 for the VueJS team.
- tycho01 9y agoDunno if it's just me, but I read these Vue articles and all I see is a bunch of hypocrites with an identity crisis, criticizing React for fragmentation, Angular for having 'one Right Way'. So they're better than React for offering one Right Way, then they're better than Angular for offering fragmentation? I mean, jeez, pick one stance and stick with it.
- dcsan 9y agoit seems odd that vuex is part of core but there isn't a default way to do get/post requests. http://jrmeyer.github.io/tutorial/2016/02/01/TensorFlow-Tutorial.html http://jrmeyer.github.io/tutorial/2016/02/01/TensorFlow-Tuto...