Replies: 1 comment 2 replies
-
As of right now I don't think typescript has a way of loading types remotely. Here's an issue that discusses it: microsoft/TypeScript#28985 @frehner has explored creating an open source tool that would automatically keep types up-to-date without having to republish npm packages and then upgrade all dependencies. However, I don't think such a tool exists yet. If someone knows of one, please share! |
Beta Was this translation helpful? Give feedback.
2 replies
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
The new version of create-single-spa outputs type definition and this is great to be used in another typescript micro.
If a microA depends on the utility micro (i mean literally in the package.json), the typescript definition will be automatically discovered, but you add an explicit relation between the two micro, and when you release the utils you need to update the dependency in the microA. If we have a separate deploy and a SystemJS based import, the dependency is only on types, not the implementation, because the actual code is loaded dynamically at runtime.
Is there a smart way to depends only on external exported types and not on the actual implementation? like having a separate package for the external micro interface and another for the implementation, so that the microA must be updated only if that interface changes. Have you ever considered creating such a setup, even if the maintenance of the package is more difficult, the management of the entire application will improve i think. It's like the application of the dependency inversion principle applied to a package.
Beta Was this translation helpful? Give feedback.
All reactions