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

tsconfig: using out option results in really ugly/duplicated output. #2930

Closed
niemyjski opened this issue Apr 27, 2015 · 10 comments
Closed

tsconfig: using out option results in really ugly/duplicated output. #2930

niemyjski opened this issue Apr 27, 2015 · 10 comments
Labels
Duplicate An existing issue was already created Needs Proposal This issue needs a plan that clarifies the finer details of how it could be implemented. Suggestion An idea for TypeScript

Comments

@niemyjski
Copy link

I'm using a tsconfig file in our project: https://github.com/exceptionless/Exceptionless.Javascript and I'm seeing the following behavior (Everything is in the same module, but multiple files..).

image

image

I feel that all code should be placed into the same module region when it's generated.

@DanielRosenwasser
Copy link
Member

That would be incorrect because we need to respect initialization order.

module m {
    export var x = 10;
}

var y = 20;

function f(x: number) {
    return 2 * x;
}

module m { 
    export var z = f(x + y);
}

It would be inappropriate to place the initialization of z at the same location as x given that its value relies on y, which was initialized before it.

@DanielRosenwasser DanielRosenwasser added the By Design Deprecated - use "Working as Intended" or "Design Limitation" instead label Apr 27, 2015
@niemyjski
Copy link
Author

I'm not saying you shouldn't respect the initializing order, I'm just saying it feels insane that I need to have duplicated

image

in my single module (one of those per file)... It could just place one around everything in that module file.. Please reopen this.. As you've just increased by javascript file size by N.

@mhegazy
Copy link
Contributor

mhegazy commented Apr 27, 2015

@niemyjski it is true that `var Exceptionless;

@niemyjski
Copy link
Author

I'm talking about var Exceptionless and extra function wrappers

@niemyjski
Copy link
Author

I wonder what the extra var Exceptionless; will do in existing/order browsers

@mhegazy
Copy link
Contributor

mhegazy commented Apr 27, 2015

fixing my comment. @niemyjski it is true that var Exceptionless; can be dropped. and it would make the code look cleaner. I am not sure i see the implementation cost vs the aesthetic return value .

@niemyjski
Copy link
Author

It doesn't look like code I would write... And that is what typescripts supposed to do..

image

@mhegazy mhegazy added Suggestion An idea for TypeScript and removed By Design Deprecated - use "Working as Intended" or "Design Limitation" instead labels Apr 27, 2015
@mhegazy
Copy link
Contributor

mhegazy commented Apr 27, 2015

We have maintained an axiom not to change user code when possible. the problem with merging these scopes, is we will have to rename declarations if they conflict.

@mhegazy mhegazy added the Needs Proposal This issue needs a plan that clarifies the finer details of how it could be implemented. label Apr 27, 2015
@niemyjski
Copy link
Author

But you are using my tsconfig. That has of all my dependencies so you should have all the info in the parse result to make the right decision.

@mhegazy mhegazy reopened this Apr 27, 2015
@mhegazy
Copy link
Contributor

mhegazy commented Feb 22, 2016

closing in favor of #447

@mhegazy mhegazy closed this as completed Feb 22, 2016
@mhegazy mhegazy added the Duplicate An existing issue was already created label Feb 22, 2016
@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
Duplicate An existing issue was already created Needs Proposal This issue needs a plan that clarifies the finer details of how it could be implemented. Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants