You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're using module federation and import from remote containers at run time.
To provide type safety, we use types from the packages that provide remote containers, and re-export those types through typescript module declaration, so that the types match the names of federated containers as defined in federation configuration:
// This module name is used in module federation configurationdeclare module "@my/remote-container"{// This is a type-only re-export from a package that// provides a remote container from module federationexport*from"actual-remote-container-package";}
In another file:
// This import works in real setup only at runtime,// because it refers to a remote container from module federationimport{SomeThing}from'@my/remote-container';SomeThing.foo();
With this setup knip reports both the package used to export types from under declare module as "Unused" and the import from the declared module as "Unlisted":
Reproduction url
https://codesandbox.io/p/devbox/gq2qss?file=%2Fremotes.d.ts
Description of the issue
We're using module federation and import from remote containers at run time.
To provide type safety, we use types from the packages that provide remote containers, and re-export those types through typescript module declaration, so that the types match the names of federated containers as defined in federation configuration:
In another file:
With this setup
knip
reports both the package used to export types from underdeclare module
as "Unused" and the import from the declared module as "Unlisted":The text was updated successfully, but these errors were encountered: