8000 Suggestion: 6to5 instead of built-in transforms · Issue #1641 · microsoft/TypeScript · GitHub
[go: up one dir, main page]

Skip to content
Suggestion: 6to5 instead of built-in transforms #1641
Closed
@jods4

Description

@jods4

This is a radical suggestion but I think it makes sense.
Today, Typescript does two different things: it provides an awesome strongly-typed experience for coding javascript applications and it transpiles your code into equivalent javascript for various targets (es3, es5, es6).

These things are not strongly related and could easily be split into two distinct parts. In fact, lots of projects already try to do the second part. Notably 6to5, which is certainly the best es6 transpiler that exists today.

My suggestion is to drop any transpiling at all, drop the target options and always emit ES6 code. Because TS tries to align with ES, the emit code would mostly just remove the type annotations. This ES6 result can then be piped into 6to5 and we'll get our final js code, compatible with the browsers that we intend to support.

Why would you do that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    By DesignDeprecated - use "Working as Intended" or "Design Limitation" instead

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0