Skip to content

[feature] improve resolution deduping #3778

@bestander

Description

@bestander

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 #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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions