Skip to content

Made the 'version' string an exported property#2245

Merged
billti merged 2 commits into
microsoft:masterfrom
billti:ExportVersion
Mar 8, 2015
Merged

Made the 'version' string an exported property#2245
billti merged 2 commits into
microsoft:masterfrom
billti:ExportVersion

Conversation

@billti

@billti billti commented Mar 7, 2015

Copy link
Copy Markdown
Member

I put this in program.ts rather than core.ts as core.ts doesn't contribute to typescript.d.ts, and this should be a publicly exported property.

Exposing a 'version' property is pretty standard in JavaScript libraries. This will be accessible as "ts.version" in both tsc.js and typescriptServices.js.

@mhegazy

mhegazy commented Mar 7, 2015

Copy link
Copy Markdown
Contributor

👍

@mhegazy

mhegazy commented Mar 7, 2015

Copy link
Copy Markdown
Contributor

It would also be great if we add a comment about the version and what means and on the services version and why it is different ".

Comment thread src/compiler/tsc.ts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do you need this namespace qualifier? You should have access to all the exports in the ts module.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't NEED it, I just LIKE it 😄

The main reason however, is that 'version' is a really common identifier throughout our code base. I just wanted to make it clear this was the top-level module property, and not some local or closure reference.

@billti

billti commented Mar 8, 2015

Copy link
Copy Markdown
Member Author

Updated with the comments per Mohamed's suggestion. I used JsDoc to ensure this is exported to the .d.ts files, as this is what most projects will be referencing when consuming these properties, and thus the comments will show in intellisense.

billti added a commit that referenced this pull request Mar 8, 2015
Made the 'version' string an exported property
@billti billti merged commit 24141f0 into microsoft:master Mar 8, 2015
@billti billti deleted the ExportVersion branch March 8, 2015 05:40
@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.

4 participants