ES6 & ES7 in the browser
Friday, April 29, 2016
ES6 and ES7 support in Chromium provides JavaScript developers with many sought-after features common in other programming languages, but previously missing from the web. These features include ways to simplify common programming patterns, make code easier to write, and customize low-level JavaScript behavior. Classes, for example, allow developers to easily write object-oriented programs and safely extend built-in JavaScript objects. Arrow functions, default parameters, and array convenience methods make common idioms simpler to program and reduce the need to copy and paste boilerplate code between projects. It can be difficult to reason about JavaScript’s asynchronous execution flow and nested callbacks, so ES6 introduces promises, iterators, and generators to simplify asynchronous code, make control flow more expressive, and make writing bug-free code easier. Powerful features like proxies and well-known symbols also give advanced developers the ability to customize language behavior to better match their application’s needs.
In order for websites to take full advantage of these new JavaScript features, multiple browsers must support the latest specifications. Fortunately, cross-browser support has rapidly improved in the past few months. The latest development versions of all modern browsers now support more than 90% of ES6, with polyfills and transpilation available to add support to older browsers as well. Adoption will continue to expand over the coming months, given that the ability to load JavaScript modules from HTML was recently standardized with the <script type="module"> tag. Chromium has already started implementing this new tag, and module support will be available soon, making it even easier to write and ship websites with ES6 and ES7 code.
For more details on the JavaScript standards process, features still under discussion such as proper tail calls, and a deeper dive into the technical side of spec conformance, visit the V8 blog. Check back soon to hear more about upcoming JavaScript features and continued performance optimizations.
Posted by Seth Thompson, Product Manager and ECMAScript ESsayist