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

Conversation

4 participants
@kitsonk
Copy link
Contributor

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.

@kitsonk kitsonk force-pushed the kitsonk:deno-namespace branch from b5decd8 to 229c911 Feb 12, 2019

@ry
Copy link
Collaborator

ry left a comment

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 approved these changes Feb 12, 2019

@ry ry merged commit a21a5ad into denoland:master Feb 12, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
license/cla Contributor License Agreement is signed.
Details
@thgh

This comment has been minimized.

Copy link
Contributor

thgh commented Feb 13, 2019

How about adding a deprecation notice?

@sholladay

This comment has been minimized.

Copy link

sholladay commented Feb 13, 2019

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

This comment has been minimized.

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.

@daiiz daiiz referenced this pull request Mar 9, 2019

Merged

migrate to deno v0.3 #2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.