I have an addon (Ember Bootstrap), which depends on several other addons. I plan publishing types for it. I was wondering if dependencies not shipping stable types yet, are a potential blocker.
Do all dependencies of my addon must ship stable types before I can ship them with my addon? Can I ship types for the dependencies in my addon?
I primarily looking at addons providing components, helpers and modifiers used by my addon. I’m talking about classic dependencies. Not peer dependencies.
I assume dependencies shipping stable types to be a prerequisite before my addon can ship stable types. If I would ship types for another addon, I fear it likely causes conflicts. E.g. if that addon starts shipping types itself. Or if another addon also starts shipping types for the same addon as it also depends on it. But I’m not a Typescript expert and wanted to double check that assumption.
You do not need to wait for your dependencies to ship types. You will only want to define types for the components in your addon. If for example, your Tooltip component needs to pass something to ember-popper-modifier, you can:
use the type from that addon to define your Tooltip’s @attr type (if available)
Define the type yourself locally as closely to their type as possible
Use any or a less stringent type for the timebeing (ie. rather than ENUM, just use string). Then when they deploy types, if done carefully, your users shouldn’t have to change anything.
Thank you for your work on Ember-bootstrap, we use it across our applications. I actually just was looking to see if you had types yet the other day. Looking forward to it!
We started the migration of Ember Bootstrap to TypeScript. Initial preparation work is done. We can now migrate component by component. If you or a colleague has time, contributing by converting 1-2 components is highly appreciated.