- Switching to Angular(Third Edition)
- Minko Gechev
- 341字
- 2021-07-02 15:23:29
The evolution of ECMAScript
Nowadays, browser vendors are releasing new features in short iterations, and users receive updates quite often. This helps developers take advantage of bleeding-edge web technologies. ES2015 is already standardized. The implementation of the latest version of the language has already started in the major browsers. Learning the new syntax and taking advantage of it will not only increase our productivity as developers but will also prepare us for the near future when all browsers will have full support for it. This makes it essential to start using the latest syntax now.
The requirements of some projects may enforce us to support older browsers, which do not support any ES2015 features. In this case, we can directly write ECMAScript 5, which has a different syntax, but has semantics equivalent to ES2015. On the other hand, a better approach will be to take advantage of the process of transpilation. Using a transpiler in our build process allows us to take advantage of the new syntax by writing ES2015 and translating it to a target language that is supported by the browsers.
Angular has been around since 2009. Back then, the frontend of most websites was powered by ECMAScript 3—the last main release of ECMAScript before ECMAScript 5. This automatically meant that the language used for the implementation of the framework was ECMAScript 3. Taking advantage of the new version of the language requires porting of the entirety of AngularJS to ES2015.
From the beginning, Angular took into account the current state of the web by bringing the latest syntax in the framework. Angular is written with a superset of ES2016, called TypeScript, which we'll take a look at in Chapter 4, TypeScript Crash Course. The type annotations allow us to take additional performance boost because they open the door for a process called ahead-of-time (AOT) compilation, which as part of the build process, generates efficient code for change detection, rendering, and dependency injection. You can find more about AOT compilation in Chapter 9, Tooling and Development Experience.
- Vue.js快速入門與深入實(shí)戰(zhàn)
- 我的第一本算法書
- 程序員考試案例梳理、真題透解與強(qiáng)化訓(xùn)練
- ASP.NET 3.5程序設(shè)計(jì)與項(xiàng)目實(shí)踐
- PHP+MySQL網(wǎng)站開發(fā)項(xiàng)目式教程
- KnockoutJS Starter
- 零基礎(chǔ)學(xué)單片機(jī)C語言程序設(shè)計(jì)
- Learning Salesforce Einstein
- Building Android UIs with Custom Views
- Mastering Xamarin.Forms(Second Edition)
- Solutions Architect's Handbook
- 區(qū)塊鏈項(xiàng)目開發(fā)指南
- ASP.NET 4.0 Web程序設(shè)計(jì)
- 虛擬現(xiàn)實(shí)建模與編程(SketchUp+OSG開發(fā)技術(shù))
- C語言王者歸來