d3 / d3-transition

Animated transitions for D3 selections.
https://d3js.org/d3-transition
ISC License
224 stars 64 forks source link

d3-selection should be a peer dependency. #92

Closed stof closed 4 years ago

stof commented 5 years ago

This package is adding new methods on the selection object to control transitions.

But if different versions of d3-selection end up being installed for the d3-transition dependency and for the main project, the main project would not have access to the method. A peer dependency should be used instead, to ensure that the d3-selection for which the prototype gets augmented is the project one.

There will be a BC break for users of the package: they will need to depend on d3-selection too when they depend on d3-transition (but that is likely already the case though). This would not impact projects installing the full d3 package (as the d3 package is the one depending on both packages, and it already depends on both anyway)

mbostock commented 5 years ago

Agreed. I will do this for the next major release.