Skip to content

Interaction with import reflection #23

@lucacasonato

Description

@lucacasonato

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions