ES6 as a typescript compiler option for angularjs or angular2

The compiler option for my angularjs application is given below. Should I use any other package to redirect es6 to es5 if I change the target to es6 ?

    {
      "compilerOptions": {
        "target": "es5", // Change this to es6
        "module": "commonjs",
        "sourceMap": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "removeComments": false,
        "noImplicitAny": false,
        "outDir": "./wwwroot/app/"
      },
      "exclude": [
        "node_modules",
        "wwwroot"
      ]
    }
+4
source share
3 answers

ES5 orientation is now a basic requirement

* According to ES6 compatibility table :

  • class not supported in

    • Chrome (last)
    • Android (latest version)

. . ES6, , . .. .

, , ES6, .

, ES5 , .

+3

, . ES6, , . TypeScript, , .

TypeScript , :

  • TS 2.3 2017 , / 2018 .
  • TS 2.5 2019 ' .
  • TS 2.7 .

TS :

: ES3 - :

  • IE8 - ES5

: ES5 - :

  • IE11 - ES6
  • (iOS) Safari 9 - ES6
  • Opera Mini - ES6
  • Android - ES6
  • 4 - ES6
  • Firefox ESR Edge 14. / ES6, . , .

target: ES6 (ES2015) - :

  • Safari 10.0 (iOS 10.2) Node 6.5 - (**).
  • Safari 10.0 (iOS 10.2) - .

target: ES7 (ES2016) - :

target: ES2017 - :

  • Edge ( 18) Safari/iOS 11.0 - / ES2018
  • Edge 17 Safari/iOS 11.0 - ES2018 Promise.prototype.finally, , ,
  • Edge ( 18) Safari 11.1 (iOS 11.3) - ES2018

ES2018/ESNext , . , , .

, , , , , . -, , .

+4

Evan Plaice , ( 18 ). , ES6 (ES2015). , .

+3

Source: https://habr.com/ru/post/1620108/


All Articles