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

Interaction with import reflection #23

Open
lucacasonato opened this issue Dec 4, 2022 · 0 comments
Open

Interaction with import reflection #23

lucacasonato opened this issue Dec 4, 2022 · 0 comments

Comments

@lucacasonato
Copy link
Member

Prefix: we are strongly considering to make import reflection an instance reflection instead of source reflection, like discussed at the November 2022 TC39 meeting. This issue assumes this change has happened.

There is a very fortunate interaction between the import ... from <ident> syntax this proposal introduces, and import reflection. It would allow users to ergonomically import and re-export whole entire module namespaces - a need that is currently very obvious from Deno's deps.ts convention.

Example:

// deps.js
import module a from "a";

export { a };

// main.js
import { a } from "./deps.js";
import { foo } from a;

Essentially, Module instances created by import module could be statically known and traced, just like module declarations. As such it should be possible to import from these modules with the import ... from <ident>; syntax.

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

No branches or pull requests

1 participant