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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

How and why we moved to Vue.js

233 点作者 fodoj超过 7 年前

33 条评论

mythz超过 7 年前
Having used both React and Vue extensively. I&#x27;d say React&#x27;s great at Single Page Apps in the true sense of the word, Apps that have a single UI like an IDE:<p>- <a href="https:&#x2F;&#x2F;github.com&#x2F;ServiceStack&#x2F;Gistlyn" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ServiceStack&#x2F;Gistlyn</a><p>Vue&#x27;s nicer to use without any build tools using just vanilla JavaScript:<p>- <a href="https:&#x2F;&#x2F;github.com&#x2F;NetCoreWebApps&#x2F;Redis" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;NetCoreWebApps&#x2F;Redis</a><p>Vue&#x27;s also nicer for &quot;page-based&quot; Websites that are converted into Single Page Apps. Nuxt.js really shines here which lets you develop complete Websites using Vue&#x27;s Single File Components and takes care of routing by following a conventional page structure. Nuxt.js + Vuetify will be my goto for many traditional Website style Apps (implemented as SPAs) going forward. It imposes an opinionated convention but saves you a lot of effort having to manually configure and integrate different libraries together.<p>Vuex is more pragmatic and requires less effort&#x2F;code to use than Redux, but Redux is great when you need to access previous states, e.g. it makes it effortless to capture &quot;Snapshots&quot; of the entire current state of the App that you can send to someone else so they load your App exactly as you see it:<p>- <a href="https:&#x2F;&#x2F;github.com&#x2F;ServiceStack&#x2F;Gistlyn#snapshots" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ServiceStack&#x2F;Gistlyn#snapshots</a><p>Or when you need to sync state changes between network apps:<p>- <a href="https:&#x2F;&#x2F;github.com&#x2F;ServiceStackApps&#x2F;typescript-redux" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ServiceStackApps&#x2F;typescript-redux</a><p>But if you don&#x27;t need these features, in general Vuex&#x2F;Mobx is easier and requires less effort to develop with.
评论 #16353483 未加载
评论 #16354189 未加载
评论 #16358168 未加载
评论 #16355735 未加载
jaequery超过 7 年前
Coming from Angular, I hated seeing another framework that has conditions inside elements, like v-if, v-bind, etc.<p>Especially when I saw things like @click, @submit, etc, I said Vue is not for me.<p>However, you quickly realize it&#x27;s not like Angular where those declarations can at times be overwhelming. In Vue, there are not that many and it is actually much more simpler and even intuitive.<p>Also, when coming from React, being able to use certain things like v-model makes you not want to go back to React, and has shrunk the code and simplified it quite a bit.
评论 #16353669 未加载
navd超过 7 年前
These posts are becoming redundant. Although I do understand where the author is coming from. I think the issue is that frontend development is hard! Especially modern frontend dev. It requires an entirely different thought process than backend development and this is why I think so many people get scared and reach for the most familiar lib out there.<p>However, getting used to the React ecosystem really does have huge benefits (code clarity, minimization of bugs, ease of creating complex interactions) and I do recommend that those interested really just dive in and build something simple to see for themselves.<p>If you&#x27;re new, ignore [babel, redux, (insert buzz lib here)] and just build something. Checkout <a href="https:&#x2F;&#x2F;medium.com&#x2F;@clmyles&#x2F;react-without-npm-babel-or-webpack-1e9a6049714" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;@clmyles&#x2F;react-without-npm-babel-or-webpa...</a> on how to create something with just React.<p>All the extra libs and tools are helpful and make your job easier in most cases. But they can be phased in as you get a deeper understanding of the ecosystem.<p>The ecosystem is standardizing now. And I don&#x27;t see webpack or React going away anytime soon.
ourmandave超过 7 年前
I&#x27;d love to read the follow up article 1 year from now. And then 3 years, and 5 and 10.<p>Vue 2.0 was a complete rewrite and their &quot;long-term-support&quot; for v1 was <i>9 months</i> of security updates.<p>I&#x27;m not trying to single out Vue, but I wonder how many job posting are for someone to maintain a legacy framework code base. (Legacy meaning 6 months old.)
评论 #16353047 未加载
评论 #16353010 未加载
评论 #16353912 未加载
评论 #16353027 未加载
评论 #16386924 未加载
erokar超过 7 年前
I don&#x27;t get the Vue hype. Sure, Vue seems nice enough, but it is concepteually very similar to React, so nothing new there. The pros of React are a smaller API and JSX instead of an added templating language (the latter being a contentious issue, I know).<p>EDIT: I realize now Vue does have optional support for JSX and you are not forced to use a templating language.
评论 #16353016 未加载
评论 #16352957 未加载
评论 #16356424 未加载
评论 #16352933 未加载
评论 #16352932 未加载
评论 #16352948 未加载
评论 #16353257 未加载
评论 #16352973 未加载
评论 #16353187 未加载
jaequery超过 7 年前
In my opinion, Vue is the most elegant javascript library out there. Jquery used to take this spot for me, but Vue has superseded it .<p>Everything just makes a lot of sense without a lot of fluff added to it. It does everything React does and I&#x27;d say does a lot more using less codes.<p>When choosing a framework, simplicity, performance, and support are the main things you should look for and Vue is a hands-down winner here.
评论 #16353873 未加载
amelius超过 7 年前
I tried to use Vue.js recently, but found that there&#x27;s a huge set of idiomatic coding principles, as opposed to a small set of primitives. Which basically makes it not for me.<p>What I also disliked was how they don&#x27;t explain how to get it working without a build-environment like webpack. That makes it really a &quot;framework&quot; in the sense that it&#x27;s all-or-nothing. Again, not my style. I prefer self-contained libraries.
评论 #16352928 未加载
评论 #16356578 未加载
评论 #16387095 未加载
评论 #16353013 未加载
评论 #16353221 未加载
adventured超过 7 年前
I keep waiting on fully commiting to either Vue or React, to see which might end up dominating so I don&#x27;t have to waste a lot of time on the one that will likely end up wilting. I&#x27;ve been doing the equivalent of full-stack web development non-stop since 1995 or so. My tolerance for going with the loser has declined persistently toward zero year by year, due to two decades of randomly eating shit when going with the wrong platform&#x2F;library&#x2F;tool&#x2F;whatever (wrong, meaning, the one that loses the popularity contest and ends up practically disappearing).<p>I&#x27;ve spent a modest amount of time with both. I find myself repeatedly drawn back to Vue every time I work with the two. I like it dramatically more than React. HN seems to love Vue, I can&#x27;t decide if that&#x27;s primarily due to its underdog non-FB position. HN loves the underdog, as most forums made up of people will. Whatever the case, React is winning the popularity contest at the moment. I&#x27;m pulling for Vue.
burlesona超过 7 年前
One thing that is really great about Vue is it’s ability to just work with whatever setup you have. Sure if you’re building from scratch it’s great to have robust build tooling, but sometimes you need to write good front end code in the midst of an old app that’s in bad shape. Having used both React and Vue extensively, I’d always reach for Vue when trying to add modern UI components to a legacy app. It manages to work beautifully even when you need it to just be loaded old school via script tag and to interop with adjacent jQuery code.
评论 #16363690 未加载
Tade0超过 7 年前
We use Angular (2+) at work, but after hours my framework of choice is Vue.<p>One striking difference between these two is: I can build a Vue application from scratch mostly relying on my memory using a basic text editor if need be. The same feat is nigh impossible with Angular.<p>A decent IDE helps, but being on my second project now using this framework I still rely on examples from the first one.<p>What I wanted to say is that comparing to Vue Angular is full of unnecessary complexity.
评论 #16353506 未加载
评论 #16353312 未加载
nojvek超过 7 年前
Not sure why he&#x2F;she hates webpack or any sort of web bundler. It’s one of the most nicest things. I can use es6 modules and declare dependencies upfront.<p>Also I don’t get the hype about vue over react or any virtual dom based framework.<p>Vue just doesn’t feel like you’re dealing with functions. It’s too much spaghetti.<p>I want to be able to hot replace templates, it’s controller logic and styles without a page refresh. I also want great type checking and intelligent refactors of props and states<p>Typescript with React is a godsend.
评论 #16353561 未加载
评论 #16354830 未加载
bichiliad超过 7 年前
Honestly, I empathized a lot with this. I spent a lot of time at work writing non-frontend code, and felt pretty rusty once I moved back to it. There are a ton of fuzzy things to learn: what&#x27;s the right way to require a module? build systems are common practice now? what happened to bower? are there differentiators between node and browser libraries?<p>Worse yet, every time you search for a topic, there are dozens of conflicting community-generated articles, just because the landscape changes so quickly. I don&#x27;t think there&#x27;s a solution apart from &quot;watch what the industry is doing&quot; and &quot;be patient.&quot;
评论 #16353597 未加载
评论 #16354035 未加载
评论 #16353409 未加载
byte1918超过 7 年前
I was expecting a comparison to react or angular. Comparing jQuery to a reactive frontend framework in 2018 is just... too easy.
brwsr超过 7 年前
&gt; I’m very bad with the front-end and don’t like it. The rest of our team has the same feelings.<p>Hmmm..<p>&gt; In early 2017 we almost solved the problem with the front-end, as we hired an expert who made the whole site over using BEM block technology.<p>BEM! hahaha<p>BEM is not mandatory for a good front-end, at all.. It sounds like you actually need a good, experienced and passionate front-end developer. But if you don&#x27;t want one, I agree that Vue.js is a relatively safe choice. I only do Vue.js for smaller projects, a little bigger and I switch to React or Angular. But I always try to mind (before switching and advocating a library) that there is a fair chance that within 5 years it is deprecated already, just like jQuery.
评论 #16353437 未加载
franciscop超过 7 年前
Using tools that other people created, documented, and put up for free for anyone to use and calling them &quot;junk&quot; makes me really sad :(
评论 #16353116 未加载
baby超过 7 年前
I made a DAPP with Vue.js recently (www.davidwong.fr&#x2F;FiveMedium) and it was amazingly fun to learn and use. Things made sense while I had difficulties grasping how to use React or even follow their tutorial to do anything practical.<p>I&#x27;m definitely happy to see more and more people using Vue.js
评论 #16352978 未加载
ggregoire超过 7 年前
I&#x27;m not so familiar with Vue (coming from jQuery -&gt; Backbone -&gt; Angular 1 -&gt; React) but I know there are different ways to write components in Vue (including classes and JSX). Well, it&#x27;s the first time I saw the style they chose and it looks awful. It seems like Backbone but with everything in a single JS object. A component as a configuration file. Maybe it makes sense for Backend people? (familiarities with defining systems in json, yaml, dockerfile, etc)
Bizarro超过 7 年前
I&#x27;ve been doing React for a couple years now, but for the past couple days I&#x27;ve been watching some videos and reading up on Vuej.<p>The thing that I will always hate about Vuej (and other&#x2F;most frameworks) are templating engines (aka string code in attributes). That&#x27;s always going to be a code smell to me.<p>That said, I can see the appeal to Vuej. There&#x27;s a very gentle migration path to Vuej. It&#x27;s much more natural just to use ES5 with Vuej than with React.<p>Vuej like most &quot;frameworks&quot; is opinionated about the rest of the pieces of the puzzle - routing, state management, etc. React is very a la carte in that regards. State management is still a complete mess in the React world.<p>I&#x27;ll probably have to try a small project or two in Vuej. The tooling in VSCode seems to be decent these days.
lol768超过 7 年前
Unsure if it&#x27;s just me, but the article doesn&#x27;t seem to render the text properly: <a href="https:&#x2F;&#x2F;i.imgur.com&#x2F;donfa0W.png" rel="nofollow">https:&#x2F;&#x2F;i.imgur.com&#x2F;donfa0W.png</a><p>With that said, definitely an interesting read and reassuring to see that you don&#x27;t need a million tools to get started. I&#x27;m doing less frontend than I used to now, but I&#x27;d still like to have a play around with Vue.js at some point to try and avoid the jQuery mess you often end up with when you end up sprinkling some client-side functionality on top of a primarily server-side rendered app.
IgorPartola超过 7 年前
I feel very productive using Vue. I wish it had first class support for forms though. My home cooked concoction for that works well enough but isn’t ideal. Otherwise, it’s the best thing I’ve used in 2017.
评论 #16352931 未加载
sjellis超过 7 年前
Vue.js is due to drop support for legacy browsers in March (oddly, in a point release):<p>&quot;Will be targeting evergreen browsers only in order to leverage native ES2015 features&quot;<p><a href="https:&#x2F;&#x2F;github.com&#x2F;vuejs&#x2F;roadmap" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;vuejs&#x2F;roadmap</a><p>I sympathise a lot with the desire, but if you work with corporate or other markets where old browsers just won&#x27;t die, then Vue may not be a feasible option.
评论 #16358307 未加载
dham超过 7 年前
They&#x27;re using jQuery wrong and now reaching for a framework. If you write bad code in jQuery you&#x27;re going to write bad code in a framework. I&#x27;ve seen it a dozen times. Use event delegation and behaviors, not &quot;if window.location = &#x27;&#x27;&quot;. That&#x27;s just wrong. You can solve a ton of problems with jQuery(or plain DOM api) and mutation observers.
评论 #16353216 未加载
评论 #16353244 未加载
评论 #16352993 未加载
评论 #16353057 未加载
评论 #16354881 未加载
评论 #16355405 未加载
评论 #16352987 未加载
mythrwy超过 7 年前
`There are 284 lines of such unbearable mingle, which is absolutely impossible to grasp for anybody.`<p>284 lines of (relatively straightforward if poorly written) jQuery? Oh the horror!<p>`Want to be as cool as Kirill Shirinkin?<p>Then enroll to the training! In his articles Kirill shares only a glimpse of his true knowledge.`<p>I think I&#x27;ve seen enough but thanks for the offer.
评论 #16354857 未加载
wdhilliard超过 7 年前
Sounds like they could have solved their problem by hiring a solid Front-End Developer. Saying that you like to &quot;focus on the backend&quot; is a lot like saying you only like to do half the work. If you find it too hard to master a whole suite of software that you have ignored for 3+ years, go find someone who already has and quit treating the front end like it&#x27;s a toy
评论 #16354110 未加载
tiuPapa超过 7 年前
I am kinda new and here is one confusion I still have about frameworks like Vue or React, why do we still need Virtual DOM? Shouldn&#x27;t the browser DOM already be first enough?
评论 #16353787 未加载
评论 #16353861 未加载
评论 #16353878 未加载
mi100hael超过 7 年前
...from jQuery. Safe to say any JS framework would have been an improvement (and that&#x27;s coming from someone who has very little love for JS frameworks).
评论 #16353008 未加载
评论 #16352882 未加载
nikon超过 7 年前
That example component code is hideous. It reminds me of Backbone, and not in a good way.
luord超过 7 年前
Similar experience to mine, only I already had experience with the frontend and other frameworks.<p>Vue is just that nice to work with.
azr79超过 7 年前
Anything compared to jquery looks good, would be more reasonable to compare it to Angular, or React
nthnclrk超过 7 年前
On the front page:<p>&quot;Hire a programming mentor and learn how to do everything he knows.&quot;<p>Might be worth being a little more inclusive here.
评论 #16356263 未加载
crimsonalucard超过 7 年前
Anybody have experience with vue building something that is long term, maintainable and very complex? What is the technical dept when compared with React?<p>Are there options to incorporate type checking into vue?
kevin_thibedeau超过 7 年前
2018. The year of VueJS.
评论 #16352883 未加载
mruniverse超过 7 年前
How useful are these &quot;Why we moved to ...&quot; blog posts?