-
Notifications
You must be signed in to change notification settings - Fork 22.8k
Closed
Description
STR
mkdir d3-test && cd d3-testyarn add [email protected]- Inspect
yarn.lockto see if any packages installed more than once due to different versions. eg using:grep '^[^ ]' yarn.lock | sed 's/@.*//' | sort | uniq -d
Expected
No duplicate d3 packages of differing versions.
Actual
d3-formatis installed twice, once at version1.2.1and once at1.2.2. The older version is due to the parentd3package pinning to an exact version, whereasd3-scalepins to a version range (1).d3-selectionis installed twice, once at version1.2.0and once at1.3.0. Similar to above, the older version is due to thed3package pinning to an exact version, whereasd3-drag,d3-brush,d3-zoompin to1andd3-transitionpins to^1.1.0.
This means potentially two copies of both packages can end up in the webpack build output, bloating the size of the browser bundle.
I was going to suggest changing the d3 package's exact version pinning to use version ranges - however it appears that the status quo is intentional (#3088). It seems that if this design decision is to be kept, then either:
- the d3 repo needs to be updated regularly for new d3 sub-package releases - perhaps using something like Renovate to simplify the process?
- the sub packages need to use exact versions as well, rather than ranges (although this will presumably create even more chances of dependencies drifting and not being in sync)
Many thanks :-)
Metadata
Metadata
Assignees
Labels
No labels