官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 凌云县| 巢湖市| 扬州市| 通山县| 合江县| 扎囊县| 彩票| 伊金霍洛旗| 赫章县| 阿坝| 保亭| 屏边| 高雄县| 竹北市| 达尔| 门头沟区| 慈利县| 栖霞市| 明光市| 葵青区| 平昌县| 镇平县| 彰武县| 彰化县| 仁化县| 木兰县| 高陵县| 沂南县| 嘉义市| 三明市| 玛曲县| 永新县| 咸丰县| 许昌县| 和平区| 资阳市| 平山县| 昭觉县| 周至县| 吉木萨尔县| 依兰县|