Skip to content

Exported typings don't work with --target ES6 #4882

Closed

Description

@alexeagle

... because we include es6-shim.d.ts in our transitive typings.

Activity

  1. self-assigned this
    on Oct 23, 2015
  2. dsebastien commented on Oct 24, 2015

    @dsebastien

    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.

  3. brandonroberts commented on Oct 24, 2015

    @brandonroberts
    Contributor

    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.

  4. alexeagle commented on Oct 26, 2015

    @alexeagle
    ContributorAuthor

    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.ts from import {} from 'angular2/angular2' and that transitively brings in es6-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.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.

    See microsoft/TypeScript#3215 for more background on the underlying TS issue.

  5. cherrydev commented on Dec 17, 2015

    @cherrydev

    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.

  6. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    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.

  7. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions