victory icon indicating copy to clipboard operation
victory copied to clipboard

Remove carets from internal versions

Open tuncaulubilge opened this issue 1 year ago • 2 comments

Removes flexible versions from all the packages to address issue: https://github.com/FormidableLabs/victory/issues/2338

Flexible versions with carets or tilde are causing issues when installing older versions of victory

tuncaulubilge avatar Aug 12 '22 08:08 tuncaulubilge

Hi @tuncaulubilge – thank you for putting this together! One concern with pinning everything across all packages is that if an end-user is installing packages individually, and happens to install different patch versions of two separate packages – they won't be able to share victory-core packages as intended, due to the inflexibility of version pinning.

However, that's not really a concern for the main victory and victory-native packages, since those just expose all of the individual packages. What do you think about just pinning all of the package dependencies in victory and victory-native (and not the sub-packages, like victory-area etc)? Would that make sense for your use-case?

gksander avatar Aug 15 '22 13:08 gksander

Hi @gksander , if we don't use pinned versions in sub-packages (such as victory-area), we would have resolution conflicts, and potentially end up with multiple versions of another sub-package.

Let's assume victory pins to version 35.0.0 of victory-area and victory-bar, but version 35.0.0 of victory-area depends on version ^35.0.0 of victory-bar (with the caret). We could end up with multiple versions of victory-bar installed, as ^35.0.0 would resolve 35.1.2. Yarn v1 is not smart enough to resolve both 35.0.0 and ^35.0.0 to 35.0.0

As for your concern for end-users installing packages individually, we can address the problem by utilising peerDependencies. Each sub-package should define a peer dependency to the exact same version of the victory core package, so it'd throw an error during install if you are installing two separate versions. To implement this, we might need to update the changesets script to regularly change the version of the peer dependency.

tuncaulubilge avatar Aug 15 '22 13:08 tuncaulubilge