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

Everything is a module #676

Closed
annevk opened this issue Mar 4, 2019 · 2 comments
Closed

Everything is a module #676

annevk opened this issue Mar 4, 2019 · 2 comments

Comments

@annevk
Copy link
Member

annevk commented Mar 4, 2019

#675 reminded me of an idea by @lukewagner that everything should be a module, somehow, so it'd be easier to use from WebAssembly. If that came to pass we'd probably need more granular [SecureContext] and [Exposed] annotations.

It might also make sens that inside a module we'd use [AvailableIn] rather than [Exposed] so that the latter can be reserved for truly exposing something on a global, whereas [AvailableIn] (bikeshedding welcome) would indicate where it's functional. E.g.,

[AvailableIn=Window]
module dom {
  [Exposed=Window]
  interface Node { ... };

  ...
};
@littledan
Copy link
Collaborator

littledan commented Mar 4, 2019

One interesting thing about this is that it would make it easy to access the original Node constructor, modulo import maps. Going further in this direction, some people have suggested that everything from a built-in module be deeply immutable, so you'd be able to access the original version of everything in a reliable way (c.f., @domenic 's get-originals proposal which also works in this space and previous TC39 discussion on frozen modules). #675 doesn't do this, though; I'm a bit skeptical on the frozen modules idea. cc @mattijs

@annevk
Copy link
Member Author

annevk commented Aug 3, 2021

Closing per #675 (comment).

@annevk annevk closed this as completed Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants