Skip to content

How typesafe can a remote be with Typescript? #20

Closed
@echarles

Description

@echarles

Update from @ScriptedAlchemy - https://www.npmjs.com/package/@module-federation/typescript has been released

I can see a disadvantage using remotes libraries vs the classical libraries where e.g. typescript can be used to enforce strong types. The current typescript example defines a generic app2/Button which is similar defining a any type.

declare module "app2/Button" {
const Button: React.ComponentType;
export default Button;
}

As the remote var does not have type, I don't see a way to benefit from the app2 types in app1. Any idea on this?

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions