Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

TypeScript Module Naming #181

Closed
guybedford opened this issue May 30, 2015 · 7 comments
Closed

TypeScript Module Naming #181

guybedford opened this issue May 30, 2015 · 7 comments

Comments

@guybedford
Copy link
Member

//cc @vladima

In order to support bundling with TypeScript, we need to tell typescript what to name the compiled ES6 modules.

For example, in Traceur we pass load.name as a parameter to the transform - https://github.com/systemjs/builder/blob/master/compilers/esm.js#L80.

This then provides the output - System.register("load name", ... where "load name" is the name we set.

This is the last critical issue to get full TypeScript support. #178 and #177 will then help to improve the experience too.

@guybedford guybedford added the bug label May 30, 2015
@vladima
Copy link
Contributor

vladima commented Jun 1, 2015

@guybedford I'll check if this change can fit into the forthcoming TypeScript release. In case if it cannot - is this issue a release blocker or ES6 module loader/SystemJS can be released without this part and I can submit it later as a PR?

@guybedford
Copy link
Member Author

@vladima thanks. Yes we can patch later certainly - it does block the full use case but will just note that bundles are not supported for TypeScript yet in the release notes.

@vladima
Copy link
Contributor

vladima commented Jun 5, 2015

@guybedford as I see SystemJS 0.17 was already released. Assuming that we can fix this issue on the TypeScript side pretty soon, what is the timeline for the next patch that can actually use this fix?

@guybedford
Copy link
Member Author

@vladima we can roll out the patches quickly now that the release is out, so in just a day or two now.

@vladima
Copy link
Contributor

vladima commented Jun 11, 2015

@guybedford a general question: how SystemJS / Builder expect transpile errors to be reported?

  • as I can see here for Traceur it re-throws the first error in the list. Is it expected behavior in general or other errors should at least be printed to console?
  • does SystemJS/Builder has the same expectations (first transpile error is raised as exception).

I would like to to apply the same error reporting policy to TypeScript scenarios to be consistent with other transpilers

@guybedford
Copy link
Member Author

The story here isn't excessively developed - we're just throwing the error from the compiler through the promise chain in a way that looks good in the browser and Node. Whatever works best within a single error object for TypeScript is great. We just had to alter this for Traceur because the error array didn't display well when thrown. There is the ability to do this differently between the browser and Node, although in future we plan on converging into a single transpiler implementation.

@guybedford
Copy link
Member Author

Released in 0.12.0. Tests tracking at #200.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants