yarnpkg/yarn

[feature] improve resolution deduping

Open

#3778 aperta il 30 giu 2017

Vedi su GitHub
 (22 commenti) (31 reazioni) (0 assegnatari)JavaScript (2731 fork)batch import
cat-featuregood first issuehelp wantedhigh-prioritytriaged

Metriche repository

Star
 (41.514 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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

Guida contributor