開源日報 每天推薦一個 GitHub 優質開源項目和一篇精選英文科技或編程文章原文,堅持閱讀《開源日報》,保持每日學習的好習慣。
今日推薦開源項目:《創心 14th》
今日推薦英文原文:《Angular in 2020 and Beyond》
開源日報第652期:《創心 14th》
今日推薦開源項目:《創心 14th》傳送門:GitHub鏈接
推薦理由:這個項目是第十四屆 D2 前端技術論壇中所用到的 PPT 合集。這次的內容包含了基礎的語言框架,工程化和最近熱門的無服務和微前端等,如果想要回顧這次會議的話自然是不容錯過,對下次會議感興趣的話也可以就此開始了解,畢竟那個樂隊看起來還有點帥。
開源日報第652期:《創心 14th》
今日推薦英文原文:《Angular in 2020 and Beyond》作者:Kalhara Perera
原文鏈接:https://medium.com/better-programming/angular-in-2020-and-beyond-b2e98543ef17
推薦理由:三大家族之一的未來發展

Angular in 2020 and Beyond

Pros, cons, and what will be next

First, let』s talk about what the benefits of Angular are, what will change, and is Angular better than React?

I』m mainly focusing on Angular』s future and what will change. Normally, to learn about Angular, I browse their repository on GitHub, which you can visit here. This is a great place to keep updated about what they』re changing in their code and which features they』re adding. You can also check for issues and be aware of them when using Angular for projects.

Weaknesses Where Angular Needs Improvement

Angular』s biggest problem is that the apps you build with it are relatively large. That means the project has a high file size. That happens because of the JavaScript bundles within them, which are because of the Angular CLI. If you compare these bundles split with the bundles you get by creating a React app, the Angular app is bigger.

At runtime, you won』t find any difference. Runtime performance is pretty good, but the loading can take longer because the app is relatively big, even for simple apps.

Secondly, the Angular app can be very complex. Angular is a complete framework. Not only that, but it is also a complete platform of features and tools. And that means learning Angular can be a bit more challenging than learning React. With React, you focus only on building components that are related to the use-case of the system. Later, React added some new features, but its core is based on building components. It』s only partly about global state management, services, and dependency injection, which we have in Angular but don』t exist in React. For an HTTP or AJAX request, you need a separate library for React, but it』s built into Angular. Routing is also the same.

This is why, when compared to React and Vue JS, Angular is a bit challenging to learn because it has more relationships built in. This also relates to the apps. That, of course, can be challenging, but this is also a huge strength because, since this is always built in, you can always rely on the features to exist, and they will perform really well. Since the same team that develops Angular』s core also works on things like form validation and routing, you can rely on these parts of the framework being up to date, following best practices, and being compatible with versions of Angular. That』s not something you can do with third-party apps used in React. If you use a routing library, it might not be updated to the latest version of React, or it might not support all the features of React. It will take some time to update third-party libraries to the same level.

Strengths Where Angular Shines

Since angular has more dependencies and components built inside, no matter what your project is, Angular has you covered. This is its biggest strength. You have many features to choose from. You have a clear set of rules, clear syntax, and typescripts to follow good practices. You have a clearly defined style guide and tons of resources and tutorials to learn Angular.

A new version of Angular is released every six months. That doesn』t mean everything changes, but the framework slowly evolves over time. That』s the core of these Angular updates. Every update is fully backward compatible, and since the first release of Angular 2, only smaller changes have happened, like small API changes. Slow but constant improvement is always good.

In the angular website, they have a blog post called 「A plan for version 8.0 and IVY,」 explaining their plans for version 8 and the future. This is worth reading, and it gives a preview of Opt-in-Ivy. Ivy is an internal Angular Renderer. A Renderer is an entity engine that takes your instructions and converts to DOM. Render is hidden, and that doesn』t change the way you can work with Angular.

When you work with Angular, you have small and high-performance apps. In the future, like 2020 and beyond, it will come with differential loading of modern JavaScript, Opt-in Ivy preview, and the angular team is working on implementing Bazel, which is a compiling tool developed by Google in the Angular CLI, which should also help with improving file size, producing smaller bundles, and may be a faster building process for an overall enhanced general developer experience. That will be available soon.

They will have smaller applications and therefore get rid of these weaknesses. Instead, they』ll have strengths: a lot of features, clear syntax, and structure. Then you have small and high-performance apps. And again, Angular team』s goal is to avert drastic API changes, but again, of course, they can see some alternative ways of creating components. And maybe, by getting rid of NG modules with IVY, that might be possible, so we could just focus on components.

Therefore, the present of Angular is already pretty good, and it』s very popular and works well. The apps are getting a bit bigger, but that』s not a big issue.
下載開源日報APP:https://openingsource.org/2579/
加入我們:https://openingsource.org/about/join/
關注我們:https://openingsource.org/about/love/