You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why is a minor bump in my dependency causing a major bump in the parent package?
Due to the nature of peer dependencies, even a minor version increase in one can lead to a breaking change. Consequently, any such update will provoke a major version increment in the parent package.
Imagine you have a project called "my-application" that relies on two other components: "my-tool" and "my-tool-plugin". "my-tool-plugin" needs "my-tool" to work properly (this is what we call a peer dependency).
Now, suppose "my-tool" gets a new feature, and the latest version of "my-tool-plugin" starts using this new feature. You decide to update "my-tool-plugin" to this latest version, but you don't update "my-tool" to the latest version.
Because your version of "my-tool" is old and doesn't have the new feature that "my-tool-plugin" needs, "my-tool-plugin" tries to use something that doesn't exist yet in "my-tool". This causes "my-application" to break.
Therefore, when "my-tool-plugin" requires a newer version of "my-tool" to work correctly, updating "my-tool-plugin" without also updating "my-tool" leads to problems. This is why increasing the required version of a peer dependency ("my-tool" in this case) is considered a breaking change.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Due to the nature of peer dependencies, even a minor version increase in one can lead to a breaking change. Consequently, any such update will provoke a major version increment in the parent package.
Imagine you have a project called "my-application" that relies on two other components: "my-tool" and "my-tool-plugin". "my-tool-plugin" needs "my-tool" to work properly (this is what we call a peer dependency).
Now, suppose "my-tool" gets a new feature, and the latest version of "my-tool-plugin" starts using this new feature. You decide to update "my-tool-plugin" to this latest version, but you don't update "my-tool" to the latest version.
Because your version of "my-tool" is old and doesn't have the new feature that "my-tool-plugin" needs, "my-tool-plugin" tries to use something that doesn't exist yet in "my-tool". This causes "my-application" to break.
Therefore, when "my-tool-plugin" requires a newer version of "my-tool" to work correctly, updating "my-tool-plugin" without also updating "my-tool" leads to problems. This is why increasing the required version of a peer dependency ("my-tool" in this case) is considered a breaking change.
Ask any further questions in a new discussion please!
Beta Was this translation helpful? Give feedback.
All reactions