TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Switching From React To Vue.js

185 点作者 anthonygore将近 8 年前

28 条评论

__BrianDGLS__将近 8 年前
I have built applications using React and most recently Vue2.<p>Both are very very similar and if you are familiar with one you will be able to pick up the other quite easily.<p>In regards to webpages both are capable of doing the same things and fit the same uses cases.<p>That said however if I was to start a greenfield application today, I would choose React. The reason for this is that react is better known, it is easier to find solutions for, and it has more mature guidelines for things like project structure and best practices.<p>Vue is good competition for React and it will certainly help keep it on it&#x27;s toes. However in regards to longevity, I feel React will be around a lot longer than Vue. React has the full support of facebook and is being used by other major vendors. Vue is also used by some big sites, however it has no official backing that I know of and is maintained by a &quot;Benevolent dictator for life&quot;.<p>In a year or two I predict that I will see another article with a title along the lines of &quot;Switching From React To &lt;insert new hotness here&gt;&quot;. It is very unlikely in my opinion that I will see a &quot;Switching From Vue To &lt;insert new hotness here&gt;&quot; article.
评论 #14434190 未加载
评论 #14434566 未加载
评论 #14434416 未加载
评论 #14434399 未加载
Blixs将近 8 年前
I have (some) experience with both React and Vue 2 and definitely prefer the later. Vue is very minimalistic but unlike React provides a lot of functionality out of the box. Stuff like the router, the computed properties, automatic change detection, HTML templates, scoped css, animations, ... . But what&#x27;s more important is the fact it does all these things in an extremely elegant and unobtrusive way. The computed properties are an often overlooked but good example of this. You simply declare an object property that is dependent upon other properties and voila, that&#x27;s it. It&#x27;s there in your component together with the rest of your data for you to use in your template. It gets memoized, it gets change detection, it just works (TM). No need for Redux, Reselect, selector functions or any of those things. I love the simplicity of this approach. And this is just an example, but this very minimalistic approach applies to everything that Vue offers.
评论 #14433872 未加载
评论 #14435251 未加载
评论 #14435252 未加载
k__将近 8 年前
Things you&#x27;re sacrificing when going away from React:<p>1. Stability. FB uses it for their main product, which is probably the biggest web app of them all, they pay many devs to work fulltime on it. People coming from Angular, who had to migrate all those breaking changes over the years know the struggle.<p>2. Options like React-Native, React-VR and co. React enables your devs to acquire a whole new range of possibilities. It isn&#x27;t just a web framework.
评论 #14434138 未加载
评论 #14435052 未加载
评论 #14434257 未加载
评论 #14436019 未加载
评论 #14433978 未加载
评论 #14434221 未加载
twii将近 8 年前
Working with React for almost 3 years now. Came from Angular, Bootstrap, jQuery, etc.. Done small and very large projects with it. It scales better than anything I&#x27;ve used before. It&#x27;s amazingly reliable and robust.<p>Looking at Vue I cannot think of 1 single benefit I gain by switching. It doesn&#x27;t even come close to what React is capable of imao. I really have no clue why people are pushing this at all.. Are there any examples of large projects that switched from React to Vue without suffering a loss?
评论 #14435242 未加载
评论 #14434211 未加载
评论 #14437437 未加载
评论 #14439132 未加载
chrislgrigg将近 8 年前
I think it&#x27;s important for any comment or post touting the superiority of Vue to also provide insight into the author&#x27;s experience with and feeings about React. You very rarely hear from devs who were loving React, tried Vue anyway, and came away believers. This leads me to wonder whether it&#x27;s not so much that Vue is &quot;better,&quot; it&#x27;s more that it operates in paradigms that are intuitive to some individuals and teams in ways that React might not be. I don&#x27;t see that as a hit against it or anyone but as a very satisfied React, it does make me take every glowing Vue writeup with a grain of salt.
评论 #14435215 未加载
elnygren将近 8 年前
Vue and React both seem a little too heavy in boilerplate. It&#x27;s also interesting that Vue seems to think that mutable state is a good thing (well, vanilla React does have mutable state too...).<p>For the boilerplate (and large bundle size!) problem we have <a href="http:&#x2F;&#x2F;markojs.com" rel="nofollow">http:&#x2F;&#x2F;markojs.com</a> that looks very interesting.<p>However, I think what we really might want is something closer to ClojureScript&#x27;s re-frame (<a href="https:&#x2F;&#x2F;github.com&#x2F;Day8&#x2F;re-frame" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Day8&#x2F;re-frame</a>) and Reagent. However, Clojure and it&#x27;s tools aren&#x27;t really that great for beginners&#x2F;juniors and&#x2F;or people with little experience in FP and lisps.<p>Maybe in the near future we&#x27;ll see a little bit more FP style JS solutions pop up?
评论 #14434538 未加载
评论 #14434275 未加载
kimjongman将近 8 年前
Our company migrated to vue.js, 4 months ago. Our complex app is messy with JSX, router, and new dev can&#x27;t keep up with code. Now we start every new app with Vue.js. The gap between junior dev and senior dev comes closer. They can collaborate with less bugs, less problems and less time to develop.
评论 #14433917 未加载
otto_ortega将近 8 年前
I have no doubt VueJS will be the most popular framework in a couple of years, right now the adoption rate is not as fast as it could be because people have already invested in React&#x2F;Angular so switching so soon looks like a downside, but people just getting started and that have zero investment in any of the 3 frameworks will go for VueJS without a doubt, because is much more easy to learn and equally or even more powerful.<p>That was my case, I spent several years sticking to jQuery and waiting for the wave of &quot;a new JS framework out every x months&quot; was over, and after researching which framework to learn, VueJS was a clear winner.<p>The syntax is way more simple and elegant, and as soon as Weex is stable it will be able to power mobile apps too!
jaequery将近 8 年前
There is a bit of React kool-aid in here, makes me really wonder if any of them have actually tried using Vue because the benefits and improvements you will see with Vue are immediately noticed.<p>To be frank, the OP actually did a poor job of presenting Vue here because it only mentioned the similarities, which doesn&#x27;t do any good for Vue. It did not get into areas where Vue is better than React, which is what most would be interested in hearing.<p>If you ever put React and Vue.js side by side and compare, it is almost a no brainer to switch. How it handles bindings, the way they got Redux done right, and the single file component style, are all improvements over React IMO. I&#x27;d jokingly say if React were to keep improving and evolving for the next couple years, it may possibly look like Vue.js as of today.
评论 #14434905 未加载
评论 #14434906 未加载
mpolichette将近 8 年前
Do people like Vue because it&#x27;s more declarative than react? Is it mostly angular devs switching and getting the best of react but still having directives?<p>I like the control react gives me without the black box &#x27;compiler&#x27; which seems like it makes a bunch more choices for you.<p>I&#x27;m probably biased, someone cmv?
评论 #14433923 未加载
评论 #14434219 未加载
Kiro将近 8 年前
The far biggest problem with Vue for me is the template language. Once you&#x27;ve used JSX you just don&#x27;t go back to Angular style templates.
评论 #14434571 未加载
评论 #14434522 未加载
评论 #14434530 未加载
louisgeo将近 8 年前
At our company we built single-page apps using Vuejs. It&#x27;s very simple to pick up and easy to merge with existing templates and code (as it looks and feels a lot like standard HTML).<p>it takes less than a day for a dev to be up and running with Vuejs, where React is a bit more tedious to get started with.
yunyu将近 8 年前
The major problem with this tutorial is that it doesn&#x27;t cover single file components (<a href="https:&#x2F;&#x2F;vuejs.org&#x2F;v2&#x2F;guide&#x2F;single-file-components.html" rel="nofollow">https:&#x2F;&#x2F;vuejs.org&#x2F;v2&#x2F;guide&#x2F;single-file-components.html</a>) at all, which are superior to (and preferred to) implementing string based render functions (which rely on a runtime template compiler). Indeed, the Vue NPM package doesn&#x27;t even provide the runtime template compiler by default. Stuff like what the article promotes are great for development if you just want to include a &lt;script&gt; file, but are clunkier than the way that you&#x27;re actually supposed to do things.
评论 #14433928 未加载
评论 #14433793 未加载
steve_taylor将近 8 年前
I remember a couple of years ago when people were posting about switching from Angular to React. Now it&#x27;s React to Vue. I&#x27;m going to be honest and concede that Vue may well be better than React. But having used React productively for a couple of years now, I don&#x27;t really see much point in throwing out something that works well in favour of something else that also works well. Back when it was &quot;why we switched from Angular to React&quot;, it was easy to understand because Angular 1 is awful. But React isn&#x27;t awful at all and I don&#x27;t really see what I&#x27;m going to gain by switching to Vue.
TekMol将近 8 年前
What are good examples of popular websites (not behind a login) that make use of Vue or React?<p>I ask because I keep reading about it, all programmers seem to use it, but I just don&#x27;t come across websites that use it. Is it only used for backend dashboards? Or do all Vue&#x2F;React sites fail to gain traction for some reason?
评论 #14433817 未加载
评论 #14434343 未加载
评论 #14433863 未加载
评论 #14433841 未加载
评论 #14433843 未加载
评论 #14434811 未加载
评论 #14433820 未加载
评论 #14434078 未加载
fnayr将近 8 年前
I&#x27;m currently making a mobile f2p game in Unity. I previously had created a Cocoa app for the game item creation&#x2F; db management. Since we changed the architecture of the game pretty heavily, I needed to rewrite the tool. I chose Electron + Vue over Cocoa. Despite having very little web dev&#x2F;JS experience, I was able to make a fully functioning app in under 3 months that syncs with a server and has multi user editing. Huge fan of Vue. Haven&#x27;t had the pleasure&#x2F;displeasure of React so can&#x27;t really compare.
fareesh将近 8 年前
What is the state of isomorphic &#x2F; server side rendering for Vue and React? Is it a straightforward thing to setup?
评论 #14434556 未加载
评论 #14434557 未加载
geordee将近 8 年前
I&#x27;ve always felt that React is a constantly churning ecosystem. The patterns keep changing too fast for me to settle down or catch up. That way Vue.js has done an amazing job. Sort of reminded me of Rails. Today I&#x27;m happy with Vue.js for my small to medium applications. Keeps things simple and beautiful.
danmaz74将近 8 年前
&gt; ... If message is passed as a prop to any child components, Vue knows that they depend on this will be automatically re-rendered as well. That’s why there’s no need for a shouldComponentUpdate method on Vue components.<p>I think that React does the same? If a component&#x27;s props and state don&#x27;t change, shouldComponentUpdate doesn&#x27;t get called at all IIRC. shouldComponentUpdate, instead, is useful when a state or prop <i>was</i> changed, but it&#x27;s possible to quickly detect that the change <i>won&#x27;t</i> require a DOM update anyway.
评论 #14433924 未加载
nomnombunty将近 8 年前
When I switched from Ember to react what I missed the most was the two ways binding, the computed properties and the router. From dabbling in Vue.js it seems to have incorporated the best of both worlds. I read over some of the technical implementation and it seems pretty sane. It seems too good to be true and I am honestly wondering what is the catch. Everything I have read about vue has been very positive so far. I am curious what are some of the cons of using vue
grabcocque将近 8 年前
It&#x27;s been eighteen months guys, time to rewrite all our front end code from scratch!
评论 #14434861 未加载
forgottenacc57将近 8 年前
The things touted as benefits sound like disadvantages.
theSpaceOctopus将近 8 年前
I&#x27;m curious as to why some people refer to Vue as &quot;the new hotness&quot;.<p>I understand the concept but Vue was realeased in February 2014, which seems pretty ancient in JavaScript years.<p>Wasn&#x27;t React released only a year prior? Well, it&#x27;s been around since 2011 but it was open sourced in 2013.<p>Either way, Vue has been around and in use for a little while now.
SimeVidas将近 8 年前
I dunno. I wouldn’t call React lightweight.
moonforeshot将近 8 年前
you can use mobx to make react &#x27;vue-like&#x27;
codazoda将近 8 年前
I stopped reading at &quot;both are fast and light weight&quot; because I don&#x27;t find react to be &quot;light weight&quot;. React is 275K (nearly a quarter of a meg) when it is minified and gzipped. 750K when it is not minified&#x2F;gziped.<p>We&#x27;re talking about a web page UI here. It should be tiny for users with slow connections. React seems big to me and I can&#x27;t justify it except in very large applications.<p>As such, I struggle to find the reason React is so popular. Perhaps I&#x27;m a bit old school. People say it&#x27;s easy to reason about, but I don&#x27;t find that to be true in real world large applications with a lot of developers working on them.<p>Still, I&#x27;m trying to like react, but these things are a struggle for me.
评论 #14434783 未加载
评论 #14434755 未加载
评论 #14434727 未加载
msmm将近 8 年前
Why would anybody do that? Maybe only when you charge by hour it makes sense because making something more complicated than Todo list is a struggle.
评论 #14433846 未加载
jorgec将近 8 年前
I don&#x27;t get it. Lets say that you have a well formed team, then you have a designer. A designer is who does the UI but know or care so little about programming. With React, the UI is practically JSX that very few people know (in comparison with html) and what we will get instead?, the result is the same html that it tries to avoid.
评论 #14434501 未加载
评论 #14435220 未加载
评论 #14434025 未加载