The current transpilation target set in front/tsconfig.json
is ECMAScript 5. The benefit of using ECMAScript 5 is that compatibility with older browsers is better, however, for this we give up on performance and many modern features (such as the let
and const
keyword). Since we already use ECMAScript 6 as the module, all these features have to be transpiled into ES5 code, which can introduce several issues. For example, I was working on a custom element for the frontend, and eventhough the TypeScript compiled, the target JavaScript was not valid and gave errors when ran in a browser.
If we look at the caniuse.com matrix for ECMAScript, we see it is supported by the following major browsers:
- Chrome 51 or higher (2016)
- Edge 15 or higher (2017)
- Safari 10 or higher (2016)
- Firefox 54 or higher (2017)
- Opera 38 or higher (2016)
- Some other minor/mobile browsers...
The total support percentage is 98.34%. The notable exception is that ECMAScript 6 is not fully supported by Internet Explorer.
type/enhancement