You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Exported typings don't work with --target ES6 #4882
I've noticed this because my build chain was TS -> ES6 -> ES5 and Angular wouldn't play nice with this. I've decided to go back to TS -> ES5 because of this and abandon my use of async/await for now; it wasn't THAT important for me anyway.
We came across this also. A temporary fix was to empty out the es6-shim.d.ts file to get it working. We are using browserify and the tsify plugin to go from TS -> ES6 -> ES5.
How should we change this? Adding a separate entry point angular2/angular2-es6.d.ts is convenient for typing, but then changing your emit would require changing your code, plus at runtime there is no such module in the bundle.
Another way would be to change angular2/angular2.d.ts to depend only on globals-es6.d.ts. Good for ES6, but then ES5 emit users (the vast majority) will need to bring es6-shim.d.ts into the compiler on their own, which means changing their tsconfig.json to reference it (or worse, finding the right spot in their build where tsc gets invoked). That means more chances for a new user to get the setup wrong.
This issue does not appear to actually be resolved. I've opened a new issue #5973 that demonstrates that es6-shim is still indirectly referenced from core.d.ts through zone.js.
angular-automatic-lock-bot commented on Sep 7, 2019
Activity
dsebastien commentedon Oct 24, 2015
I've noticed this because my build chain was TS -> ES6 -> ES5 and Angular wouldn't play nice with this. I've decided to go back to TS -> ES5 because of this and abandon my use of async/await for now; it wasn't THAT important for me anyway.
brandonroberts commentedon Oct 24, 2015
We came across this also. A temporary fix was to empty out the es6-shim.d.ts file to get it working. We are using browserify and the tsify plugin to go from TS -> ES6 -> ES5.
alexeagle commentedon Oct 26, 2015
I've started working on a change, but we need to think for a moment about how this should work.
Users currently get
angular2/angular2.d.tsfromimport {} from 'angular2/angular2'and that transitively brings ines6-shim.d.ts. Good for ES5 emit (minimal setup work) but bad for ES6 emit (duplicate declarations).( See ES6: https://github.com/angular/angular/blob/master/modules/angular2/manual_typings/globals-es6.d.ts vs ES5: https://github.com/angular/angular/blob/master/modules/angular2/manual_typings/globals.d.ts )
How should we change this? Adding a separate entry point
angular2/angular2-es6.d.tsis convenient for typing, but then changing your emit would require changing your code, plus at runtime there is no such module in the bundle.Another way would be to change
angular2/angular2.d.tsto depend only onglobals-es6.d.ts. Good for ES6, but then ES5 emit users (the vast majority) will need to bringes6-shim.d.tsinto the compiler on their own, which means changing theirtsconfig.jsonto reference it (or worse, finding the right spot in their build where tsc gets invoked). That means more chances for a new user to get the setup wrong.See microsoft/TypeScript#3215 for more background on the underlying TS issue.
cherrydev commentedon Dec 17, 2015
This issue does not appear to actually be resolved. I've opened a new issue #5973 that demonstrates that es6-shim is still indirectly referenced from core.d.ts through zone.js.
angular-automatic-lock-bot commentedon Sep 7, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.