Do all dependencies of an addon must ship stable types before addon can?

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:

  1. use the type from that addon to define your Tooltip’s @attr type (if available)
  2. Define the type yourself locally as closely to their type as possible
  3. 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!

Hello @kyled500,

Thanks for your helpful response!

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.

We have a tracking issue here: Road to TypeScript · Issue #2053 · ember-bootstrap/ember-bootstrap · GitHub

Best Jeldrik

1 Like