Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax import/export elision rules for separate compilation #2550

Merged
merged 10 commits into from Mar 31, 2015

Conversation

vladima
Copy link
Contributor

@vladima vladima commented Mar 30, 2015

This PR adds a new compiler option: separateCompilation that should be used when we compile one file at a time. In this mode when some name is not resolved (and thus is unknownSymbol) we conservatively assume that this name can possibly refer to a value and do not elide imports/exportes that use this name.
Also I've added transpile function that can be used i.e. from es6-module-loader to get the emit result for one file

// Parse
var inputFileName = fileName || "module.ts";
var sourceFile = ts.createSourceFile(inputFileName, input, options.target);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

u do not need the ts

@mhegazy
Copy link
Contributor

mhegazy commented Mar 31, 2015

looks good. We just need a unit test.

@mhegazy
Copy link
Contributor

mhegazy commented Mar 31, 2015

thanks! 👍

vladima added a commit that referenced this pull request Mar 31, 2015
Relax import/export elision rules for separate compilation
@vladima vladima merged commit f239bbc into master Mar 31, 2015
@vladima vladima deleted the separateCompilation branch March 31, 2015 21:51
@Ciantic
Copy link

Ciantic commented May 3, 2015

I just tried Visual Studio Code, it can't emit single files on save. Is this required for it to be able to do it? The Atom-Typescript can do it on save, which is a huge plus, but it doesn't use TSC for that.

Edit Just noticed this is "merged", somehow I saw this as open.

@mhegazy
Copy link
Contributor

mhegazy commented May 3, 2015

Compile on save is not supported yet. I would recommend starting the compiler with --watch; this should give you the same effect. Also I wopd recommend using tsconfig with this setting to get consistent experience between the ide and command line and run the compiler from the folder with tsconfig.json as:

tsc --watch

Also pinging @jrieken from vs code to comment on compile on save.

@Ciantic
Copy link

Ciantic commented May 4, 2015

I think @jrieken could comment on VS Code at #2499 since I mistakenly came to this merge request thinking it was single module transpilation merge, which it was not.

@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants