yarnpkg/yarn

[feature] improve resolution deduping

Open

#3778 opened on Jun 30, 2017

View on GitHub
 (22 comments) (31 reactions) (0 assignees)JavaScript (41,514 stars) (2,731 forks)batch import
cat-featuregood first issuehelp wantedhigh-prioritytriaged

Description

Do you want to request a feature or report a bug? feature

Tentative about making it into 1.0 release because I think it is an important improvement over the existing experience.

What is the current behavior?

  1. Final deduping

As described in https://github.com/yarnpkg/yarn/issues/3775 whether Yarn will download 2 different versions of left-pad depends on the order dependencies are resolved (it's alphabetic BFS).

Instead we should have a post resolution step that would try to dedupe all versions of a single package to the minimum after the dependency tree was resolved.

I started this https://github.com/yarnpkg/yarn/pull/3563/files#diff-80a032b8112ef9aa0ea41ee304a6024aR453 but never have finished.

  1. Turn off deduping

At the same time we probably could have the opposite option - force Yarn to use latest dependencies everywhere and not optimize resolution at all.

  1. Don't dedupe lockfiles on install

Another aspect - we don't want to dedupe dependencies if they are already in the lockfile because Yarn guarantees same node_modules for the same lockfile.

Please mention your node.js, yarn and operating system version. Yarn 0.27

Contributor guide