dart-archive / dev_compiler

DEPRECATED - Moved to main SDK
https://github.com/dart-lang/sdk/tree/master/pkg/dev_compiler
Other
133 stars 27 forks source link

TypeScript output #391

Open jmesserly opened 8 years ago

jmesserly commented 8 years ago

This has been on our radar for a while, but I don't see an issue to discuss it, so here it is.

The goal would be to have a TypeScript output mode, in addition to the current ES6 (and work-in-progress Closure Compiler).

CC @ochafik who is working on the Closure Compiler backend.

b-strauss commented 8 years ago

Would a full TypeScript output even be needed? Maybe ES5/Closure output plus the TypeScript definition files for it would be enough.

jmesserly commented 8 years ago

good point. .d.ts files definitely would cover some of the use cases.

Pajn commented 8 years ago

Definition files and JS would be better than actual TS files as TS misses a good module system for importing out of project TS files but do have infrastructure for using JS modules with definition files.

b-strauss commented 8 years ago

@Pajn I don't think this would be an issue. TypeScript now has ES6 modules. The old module system is deprecated, so TypeScript modules are basically ES6 modules with types. I successfully imported some pure third-party modules in my app.

I think the problem with TypeScript in general is the different type system. I have no idea how someone would, for example, represent named constructors in TypeScript.

Pajn commented 8 years ago

Importing the files is possible yes, but you will have to provide all dependencies (or type definitions) for the modules you are importing as all files that is necessary for compilation needs to be listed in the files array.