Search code examples
typescriptnpmrxjssemantic-versioning

Does updating a package dependency by a major version require a major version bump of the package itself?


I'm currently investigating the possibilities for upgrading an RxJS dependency from v5.5 to v6 in this package of mine. This is a relatively small npm package and after reading the migration guide I don't anticipate any problems implementing the new version.

The thing is I'm curious whether or not the new version of my package itself should be a new major version. I have always taken for granted the statement that as long as a piece of software retains the same public interface, changes to the implementation can be published with a minor or patch version bump.

Although my package interface should be able to remain unchanged, in this case I'm dealing with RxJS being a dependency that is also certainly used by anyone that uses my package. And because of the incompatibilities between the RxJS versions I'm switching between I would suspect a major version bump to be more appropriate. How do I reason about this topic?


Solution

  • And because of the incompatibilities between the RxJS versions I'm switching between I would suspect a major version bump to be more appropriate

    This is mostly legit and would be better to bump as major. You can consider 2 cases of RxJS as dep

    1. direct dependency : if consumer application relies on v5, can break between your lib (as it carries 2 different version of rx instance) so it could be major.
    2. peer dependency : now your lib will ask consumer application install v6 instead of v5, it also falls back to major (as consumer need to bump their version of rx)

    so in my packages (i.e https://github.com/kwonoj/rx-sandbox/releases/tag/v1.0.0) I called it for major bump for exact those reason.

    If your lib have proper interop ensures working on v5 & v6 both, then it's definitely not major.