Request: `import type *` (wildcard type-imports)
Open
feature request
- Dominant language
- Rust
- Stars
- 22.3k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
One can write `import * as D from "./dep"`, and then use `D.SomeType`
throughout the rest of the module, as a convenient way to import many
types while preserving namespacing.
However, this has runtime effects, and forces the contents of the
dependency module to be bundled with the dependent module, even though
they may never be used. Currently, we must explode the wildcard import
to `import type {Lots, Of, Types} from "./dep"` in order to reduce the
bundle size; in addition to being inconvenient, this loses the benefits
of namespacing.
A form `import type * as D from "./dep"` with the evident semantics
would be a great, simple addition.
Contributor guide
Assessment
This issue has not been assessed yet.