leongersen / noUiSlider

noUiSlider is a lightweight, ARIA-accessible JavaScript range slider with multi-touch and keyboard support. It is fully GPU animated: no reflows, so it is fast; even on older devices. It also fits wonderfully in responsive designs and has no dependencies.
https://refreshless.com/nouislider/
MIT License
5.66k stars 659 forks source link

Feat: export all type definitions #1147

Closed RikuVan closed 3 years ago

RikuVan commented 3 years ago

This PR exports all type definitions. This may allow libraries that wrap the nouislider in, for example, a library-specific wrapper to use these. I don't think there are any particular risks in doing so.

I did consider putting these in a separate file since they do take up a lot of space but perhaps you want to keep things in one file, so I left that alone.

leongersen commented 3 years ago

I'm not sure I want to export all internal types, given the backward compatiblity implications that would have for future changes.

RikuVan commented 3 years ago

It is a little hard for me to know where to draw the line in terms of what to expose. Really I see the risks the other way. In the best scenario, the types change and and if I had done something with those internal types, it is useful to me that they break--alerting me to api changes. In the worst scenario my copied versions go out of sync.

But I might be naive about the expectations of other devs and the sorts of issues you will get. Not a big deal if this seems like it might lead to problems down the road; fine to close this and perhaps I can return with a more modest proposal for exporting certain types if it becomes more clear to me where the line is between those needed outside of the library and those that should remain internal.

leongersen commented 3 years ago

I'm closing this for now. I'm open to exporting more types that are externally useful, but I don't want to export all internal types.