Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #4357 - Allow resolver to delay resolutions for nested dependencies #4372

Merged
merged 4 commits into from
Sep 11, 2017

Conversation

kaylie-alexa
Copy link
Member

@kaylie-alexa kaylie-alexa commented Sep 9, 2017

Summary
Fix for #4357.

The issue is that when a dependency (dep A) defined in resolutions (includes dep A, dep B) depends on another resolution (dep B), then it expects to match its own nested dep B to the top level resolution dep B. So the first part of this fix is "don't run resolutions map check when it's in flat mode", which is what threw the invariant warning. Second part of the fix is that we still want that nested dependency (dep B) of a resolution (dep A) to be resolved correctly. --flat mode solves this by collapsing all versions after the resolver is done. For resolutions, I'm adding a delay queue for requests with resolutions but no manifests found yet so that they will be resolved later.

Test plan
Added tests in resolutions

@kaylie-alexa kaylie-alexa changed the title Fix #4357 - Allow packages to delay resolutions for nested dependencies Fix #4357 - Allow resolver to delay resolutions for nested dependencies Sep 9, 2017
@buildsize
Copy link

buildsize bot commented Sep 9, 2017

This change will increase the build size from 9.51 MB to 9.51 MB, an increase of 560 bytes (0%)

File name Previous Size New Size Change
yarn-[version].noarch.rpm 819.53 KB 819.51 KB -21 bytes (0%)
yarn-[version].js 3.62 MB 3.62 MB 195 bytes (0%)
yarn-legacy-[version].js 3.67 MB 3.67 MB 323 bytes (0%)
yarn-v[version].tar.gz 823.66 KB 823.67 KB 15 bytes (0%)
yarn_[version]all.deb 626.38 KB 626.43 KB 48 bytes (0%)

@BYK BYK self-assigned this Sep 11, 2017
Copy link
Member

@BYK BYK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@BYK BYK merged commit c76a8bb into master Sep 11, 2017
@BYK BYK deleted the fix-nested-resolutions branch September 11, 2017 19:56
@BYK BYK added this to the 1.0.2 milestone Sep 12, 2017
joaolucasl pushed a commit to joaolucasl/yarn that referenced this pull request Oct 27, 2017
…npkg#4372)

**Summary**
Fix for yarnpkg#4357.

The issue is that when a dependency (dep A) defined in resolutions (includes dep A, dep B) depends on another resolution (dep B), then it expects to match its own nested dep B to the top level resolution dep B. So the first part of this fix is "don't run resolutions map check when it's in flat mode", which is what threw the invariant warning. Second part of the fix is that we still want that nested dependency (dep B) of a resolution (dep A) to be resolved correctly. `--flat` mode solves this by [collapsing all versions](https://github.com/yarnpkg/yarn/blob/master/src/cli/commands/install.js#L558) after the resolver is done. For resolutions, I'm adding a delay queue for requests with resolutions but no manifests found yet so that they will be resolved later.

**Test plan**
Added tests in resolutions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants