Open einarq opened 1 year ago
Btw, I came here via this issue: https://github.com/module-federation/module-federation-examples/issues/681#issuecomment-1244897249
We are trying to find the best way to actually postpone loading the remoteEntry, and other modules that it drags with it, until any module from this remote is actually needed. Currently MF has the unfortunate side-effect of pre-loading too much stuff it seems.
Also have this issue over on the external-remotes-plugin: https://github.com/module-federation/external-remotes-plugin/issues/6
That plugin is deprecated, right? Is "importRemote" the current recommendation? Or is the recommendation still to use the "promise new Promise" approach mentioned in the docs?
Hi @einarq! I am just seeing this issue. Sorry for the delay. importRemote
does not preserve the types from the module it imports dynamically, however it can be passed a generic type which then will be assigned to the resolved object. So you can use it like this for example importRemote<{title: string; children?:JSX.Element;}>({ url: "http://localhost:3001", scope: 'Foo', module: 'Bar' })
Does the importRemote util work with the MF typescript plugin?
Meaning, if you import a React component like this, does it also preserve any types?