Skip to content

(horrible idea?) support some kind of workflow using both TypeScript (specifically, compile-time type checking) and traceur #232

Closed
@jamesmanning

Description

@jamesmanning

Currently if I want to use ES6 features and async/await I have to use traceur instead of TypeScript. Now, those are on the roadmap for TypeScript 2.0, but for argument's sake, I think it's reasonable to say that traceur (or something similar) will be 'ahead of' TypeScript WRT ECMAScript features, simply because that project intentionally adds support for things even before they're "locked down" in the spec, while TypeScript (AFAICT from some of the github issues) chooses to wait until the spec is finalized (a perfectly reasonable engineering decision).

Since traceur supports type declarations, one possible workflow would be for TypeScript to be used in a workflow to do the type checking. In this scenario, TypeScript wouldn't need "full" support for new features it doesn't support (let, const, template literals, etc), but instead could be used in a 'sanity checking' way - it wouldn't need to "transpile" down to ES5, just provide type checking. There could either be no output created, or the output could be the same as the input, or the output would be the input with type declarations removed.

It seems like in the future, there could even be a fork of TypeScript that didn't have any transpile support, but simply provided type checking (leveraging that traceur supports the type declarations), and left transpiling to traceur (or similar). I don't know enough about the existing TypeScript compiler to know if this would actually be a significant savings or not, since the parsing and type checking might have enough complexity required such that the transpiling part ends up being a relatively small part of the overall code. If that's the case, then such a fork would likely not have significant savings over the current approach and wouldn't be worth the effort.

In any case, if there's some possible way to get the TypeScript-like type-checking tooling on "javascript.next" without having to wait for TypeScript to implement support (for ES6 + async/await currently, but more generally "future ES features"), that would be awesome. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeclinedThe issue was declined as something which matches the TypeScript visionOut of ScopeThis idea sits outside of the TypeScript language design constraintsSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions