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

Add Deno global namespace #1748

Merged
merged 1 commit into from Feb 12, 2019
Merged

Add Deno global namespace #1748

merged 1 commit into from Feb 12, 2019

Conversation

kitsonk
Copy link
Contributor

@kitsonk kitsonk commented Feb 12, 2019

Resolves #1705

This PR adds the Deno APIs as a global namespace named Deno. For backwards compatibility, the ability to import * from "deno" is preserved. I have tried to convert every test and internal code the references the module to use the namespace instead, but because I didn't break compatibility I am not sure.

On the REPL, deno no longer exists, replaced only with Deno to align with the regular runtime.

The runtime type library includes both the namespace and module. This means it duplicates the whole type information. When we remove the functionality from the runtime, it will be a one line change to the library generator to remove the module definition from the type library.

I marked a TODO in a couple places where to remove the "deno" module, but there are additional places I know I didn't mark.

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

Radical! LGTM - no comments.

I think this warrants bumping to v0.3.0 on the next release (which I was considering doing anyway)

@ry ry merged commit a21a5ad into denoland:master Feb 12, 2019
@thgh
Copy link
Contributor

thgh commented Feb 13, 2019

How about adding a deprecation notice?

@sholladay
Copy link

IMO deno > Deno because it's not a constructor. There are at least a few exceptions to this convention at the language level, though, so not a big deal...

@kitsonk
Copy link
Contributor Author

kitsonk commented Feb 13, 2019

The convention for global namespaces in ECMAScript is to capitalise as pointed out by Burt in the main issue, which is why we did what what we did.

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.

None yet

4 participants