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

Declare globals explicitly in lib.deno_runtime.d.ts #2889

Closed
wants to merge 3 commits into from

Conversation

nayeemrmn
Copy link
Collaborator

@nayeemrmn nayeemrmn commented Sep 8, 2019

Fixes #2888.

I added export {}; (see comment and microsoft/TypeScript#19545). Everything global is in a declare global {} block.

@ry Not sure how I'd test this.

@kitsonk
Copy link
Contributor

kitsonk commented Sep 8, 2019

Can we hold off on this, until we restore the automatic library generation? See #2868.

Library files should not be UMD .d.ts files. They need to follow the pattern of other library files. I understand the problem, and we can address it as part of #2868, which is that we need better names for some of the namespaces we have to avoid unintentional userland collisions.

@nayeemrmn
Copy link
Collaborator Author

@kitsonk Makes sense, I agree in that case.

we need better names for some of the namespaces we have to avoid unintentional userland collisions.

As far as I can tell, these namespaces only hold local aliases used to specify the actual global stuff above. Are you sure there's no way to to properly internalise them? If not, could they all go in Deno, like a Deno.internal namespace or something? That way we keep our compatibility. https://www.typescriptlang.org/docs/handbook/declaration-files/library-structures.html#preventing-name-conflicts

@nayeemrmn nayeemrmn closed this Sep 8, 2019
@nayeemrmn
Copy link
Collaborator Author

nayeemrmn commented Sep 8, 2019

@ry Can you cherry-pick 7b333d7? That's going to bug me.

@kitsonk
Copy link
Contributor

kitsonk commented Sep 9, 2019

@nayeemrmn yeah, that might be possible too... It had crossed my mind, but I dismissed it, but it actually makes sense that both functional code and types specific to Deno exist in the Deno namespace.

@nayeemrmn nayeemrmn deleted the deno-runtime branch September 10, 2019 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non-standard namespaces other than Deno declared in lib.deno_runtime.d.ts
2 participants