堆栈选择:React vs Vue vs Angular vs Svelte

益清野
2023-12-01

As a developer, there are many choices to make when building your next application. The rise of serverless technologies allows developers to build and run applications without thinking about servers and this also allows front-end developers to create full-stack applications and build SAAS web apps.

作为开发人员,在构建下一个应用程序时有许多选择。 无服务器技术的兴起使开发人员无需考虑服务器即可构建和运行应用程序,这也使前端开发人员可以创建全栈应用程序和构建SAAS Web应用程序

In Stack Choices, we take a closer look at some technologies that can help us to build these types of applications and try to make a good decision on what to use. In the last episode, I took a look at JavaScript vs TypeScript. This time, let’s take a look at the JavaScript frameworks.

Stack Choices中 ,我们仔细研究了一些技术,这些技术可以帮助我们构建这些类型的应用程序,并尝试对使用什么做出正确的决定。 在上一集中,我看了JavaScript vs TypeScript 。 这次,让我们看一下JavaScript框架。

角度的 (Angular)

This JavaScript framework, developed by Google, has been around for a while and it’s not really the cool kid on the block inside the frontend community. The move from angular 1 (AngularJS) to Angular 2, which was so different it required complete rewrites, seems to left some scars, but times have changed and lots of progress has been made.

由Google开发的这个JavaScript框架已经存在了一段时间,并且在前端社区中并不是一个很酷的小家伙。 从angular 1(AngularJS)到Angular 2的转变非常不同,需要完全重写,似乎留下了一些伤疤,但是时代已经改变,并且已经取得了许多进展。

Updating your application to the next major version of Angular has never been easier. Since Angular 8, you can just use ng update it to update your application and its dependencies. Besides that, with the new Angular CLI, you can generate components, routes, services, and pipes with a simple command. Besides that, Angular is very stable and has support for great technologies like Typescript and Web Workers, etc. Also, the new Ivy renderer is officially released in Angular 9, which decreased payload size and has a lot of other interesting benefits.

将您的应用程序更新到Angular的下一个主要版本从未如此简单。 从Angular 8开始,您可以使用ng update it来更新应用程序及其依赖项。 除此之外,使用新的Angular CLI,您可以使用简单的命令生成组件,路由,服务和管道。 除此之外,Angular非常稳定,并支持诸如Typescript和Web Workers等伟大技术。此外,新的Ivy渲染器已在Angular 9中正式发布,这减小了有效负载大小并具有许多其他有趣的好处。

我的看法 (My opinion)

After first working with React for quite some time I joined a team that worked with Angular. I have now worked with them for over a year and although I was a bit skeptical at the beginning, I started to like Angular more and more. Some people complain about the file size or that the framework is too bloated, but I think it’s nice to have a framework that has lots of features built-in. It’s not as easy to pick up as Vue or React, and I also wouldn't choose it for smaller side-projects, but for production applications, especially those that you need to work on with multiple people, Angular is a very nice framework.

在与React一起工作了一段时间后,我加入了一个与Angular合作的团队。 我现在已经和他们一起工作了一年多,尽管一开始我有些怀疑,但我开始越来越喜欢Angular。 有人抱怨文件大小或框架过于膨胀,但是我认为拥有一个内置许多功能的框架是一件很不错的事情。 它不像Vue或React那样容易上手,对于较小的附带项目,我也不会选择它,但是对于生产应用程序,尤其是那些需要与多个人一起工作的应用程序,Angular是一个非常不错的框架。

React (React)

According to NPM trends, React is by far the most downloaded framework. Stack Overflow Trends also reveals that React receives the largest percentage. It’s easy to see why lots of people choose React for there new applications: it’s a save bet. Large companies such as Airbnb and Netflix have been using React.js for many years now, and we see that the technology is being embraced by more and more companies. The interest in React among developers is huge and that makes it a technology that will probably gain even more popularity in the upcoming years.

根据NPM趋势,React是迄今为止下载最多的框架。 堆栈溢出趋势还显示,React所占比例最大。 很容易看出为什么很多人选择React来开发新的应用程序:这是一个成功的选择。 像Airbnb和Netflix这样的大公司已经使用React.js多年了,我们看到越来越多的公司采用了该技术。 开发人员对React的兴趣是巨大的,这使其在未来几年内可能会变得越来越受欢迎。

我的看法 (My opinion)

Most popular doesn't mean it’s the best, also React has its flaws. But personally, I absolutely like working with it. I have made most of my side-projects with React, like RaterFox, Codestash, MakerMove, and more. I think it’s easy to get started with React, but when you build large applications you find yourself reaching for a lot of other libraries just to get some basic things done, like routing or global state management. These libraries usually all have there strong points and weaknesses. It’s nice to have the freedom to choose but at some point, I think it would help the developer community if we could just all go for the same thing. Instead of introducing yet another state management library or another way to implement CSS-in-JS, I think it might be beneficial to sometimes have fewer choices.

最受欢迎并不意味着它是最好的,React也有其缺陷。 但就我个人而言,我绝对喜欢使用它。 我已经使用React进行了大部分的副项目,例如RaterFoxCodestashMakerMove等。 我认为开始使用React很容易,但是当您构建大型应用程序时,您会发现自己接触了许多其他库只是为了完成一些基本的事情,例如路由或全局状态管理。 这些库通常都具有优点和缺点。 可以自由选择是一件很高兴的事情,但是在某些时候,我认为如果我们可以全力以赴,这将对开发人员社区有所帮助。 我认为与其引入另一个状态管理库或另一种实现CSS-in-JS的方法,不如有时候减少选择可能会有所帮助。

I’ve made a React boilerplate called React Milkshake that can give you a headstart with your new project. And I’m working on a React starter-kit with Nextjs to build full-stack SaaS applications. You can sign up here to get notified when it launches.

我制作了一个名为React Milkshake的React样板,可以让您从新项目中抢先一步。 我正在使用Nextjs开发一个React入门套件,以构建全栈式SaaS应用程序。 您可以在此处注册以在启动时得到通知。

Vue (Vue)

Another amazing JS framework is Vue.js. With very detailed documentation and a fairly low learning curve, Vue.js is a suitable choice when you want to experiment with a new framework as a developer.

另一个令人惊叹的JS框架是Vue.js。 Vue.js拥有非常详尽的文档和相当低的学习曲线,是您作为开发人员尝试使用新框架时的理想选择。

Because of the resemblance to React and Angular in terms of architecture, it is an easy transition from other frameworks. Loved for its small size, speed and flexibility, Vue.js delivers even better performance compared to other frontend frameworks.

由于在架构上与React和Angular相似,因此可以轻松地从其他框架过渡。 喜爱它的体积小,速度和灵活性,Vue.js甚至可以提供更好的性能相比其他前端框架。

Vue.js currently still has a much smaller market share compared to React. Due to the positive opinions from the developer community and the growth in the use of Vue, it seems likely that Vue.js will continue to develop positively.

与React相比,Vue.js目前的市场份额仍然要小得多。 由于开发人员社区的积极意见以及Vue使用的增长,Vue.js似乎将继续积极发展。

我的看法 (My opinion)

I have little personal experience with Vue, but to experiment with it I made RemoteRocket, a platform with all the remote jobs from popular remote job sites. It’s easy to pick up, especially with the Vue CLI, and I definitely recommend giving Vue a try (if you haven’t already).

我对Vue的经验很少,但是为了进行试验,我制作了RemoteRocket ,该平台包含了流行的远程作业站点中的所有远程作业。 拿起它很容易,尤其是使用Vue CLI时,我绝对建议您尝试一下Vue(如果您还没有的话)。

Card.svelte (Svelte)

The big underdog of the frontend frameworks: Svelte. It’s been around for a couple of years and in April 2019 version 3.00 was released. Svelte is a little different than React, Vue, or Angular because it compiles your code to tiny, framework-less vanilla JS. And it’s not just very performant, with no run-time dependencies, it’s also very elegant and easy to learn the framework. It’s npm downloads have more than tripled over the last year, and in the results of the 2019 State of JS survey, it showed that 44.9% of JS developers were interested in learning Svelte. Time has to tell if people will actually adopt it in production applications, so I’m curious about what the future will bring for Svelte.

前端框架的主要弱者:Svelte。 它已经存在了几年,并在2019年4月发布了3.00版。 Svelte与React,Vue或Angular稍有不同,因为它会将您的代码编译为微型,无框架的原始JS。 它不仅性能出色,没有运行时依赖性,而且还非常优雅并且易于学习。 去年,npm的下载量增加了两倍多,并且在2019年JS状态调查的结果中显示,有44.9%的JS开发人员对学习Svelte感兴趣。 时间必须告诉人们是否会在生产应用程序中真正采用它,所以我很好奇未来将为Svelte带来什么。

我的看法 (My opinion)

I personally haven’t got the time to try out Svelte, but it’s very high up on my list of technologies to explore. If you want to learn more I can recommend you this video of Rich Harris’ (the creator of Svelte) talk about Rethinking reactivity or to listen to this podcast episode of the Syntax.fm where Scott Tolinski teaches Wes Bos about Svelte. It got me really excited and I can’t wait to start trying it out myself!

我个人没有时间尝试Svelte,但是在我探索的技术列表中它的位置很高。 如果您想了解更多,我可以推荐你这个富有哈里斯(Card.svelte的创建者)谈反思React的视频或听这个的的播客节目Syntax.fm其中斯科特Tolinski教韦斯·博斯约Card.svelte。 这让我真的很兴奋,我迫不及待想自己尝试一下!

结论 (Conclusion)

Angular, React, Vue, or Svelte, these are all great frameworks. I’ve worked with all of them except Svelte. I would really love to work with Svelte, but for my plan to build the best JavaScript boilerplate for building a SAAS business, I need to go with a framework I’m very experienced with. Besides that, popularity plays an important role, and for that reason, my choice has become: React.

Angular,React,Vue或Svelte都是不错的框架。 除了Card.svelte,我已经和他们一起工作了。 我真的很想与Svelte一起工作,但是对于我的计划来构建用于构建SAAS业务的最佳JavaScript样板的计划,我需要使用一个非常有经验的框架。 除此之外,受欢迎程度起着重要作用,因此,我的选择变成了: React

If you think differently, please try to change my mind! Any other opinions? Leave them in the comments.

如果您有不同的看法,请尝试改变主意! 还有其他意见吗? 将它们留在注释中。

If you’re interested in saving time on your next project and skipping implementing authentication, payments, tests, etc. then subscribe here to follow my progress in building the SAAS starter-kit for JavaScript developers. You can also follow me on Twitter, or at www.jakeprins.com.

如果您有兴趣节省下一个项目的时间,并跳过实现身份验证,付款,测试等的步骤,请在此处订阅以跟随我为JavaScript开发人员构建SAAS入门套件的进度。 您也可以在Twitterwww.jakeprins.com 上关注我

翻译自: https://codeburst.io/stack-choices-react-vs-vue-vs-angular-vs-svelte-49aa0170c634

 类似资料: