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(jest-haste-map): Add computeDependencies to cache path #11916

Merged
merged 1 commit into from
Sep 30, 2021

Conversation

motiz88
Copy link
Contributor

@motiz88 motiz88 commented Sep 30, 2021

Summary

#6667 added the computeDependencies option, which affects the contents of the Haste map, but doesn't change the cache path. If two jest-haste-map instances are created with identical options except for computeDependencies, the one with computeDependencies: true could end up attempting to reuse cached data where the dependencies are missing.

Here we add the value of computeDependencies to the cache path.

Test plan

Added a unit test.

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

seems reasonable 👍

@motiz88 motiz88 force-pushed the compute-dependencies-in-cache-key branch from 83705af to ec6c7db Compare September 30, 2021 10:47
@motiz88 motiz88 marked this pull request as ready for review September 30, 2021 10:47
@codecov-commenter
Copy link

Codecov Report

Merging #11916 (ec6c7db) into main (ba55fe7) will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #11916      +/-   ##
==========================================
+ Coverage   68.74%   68.76%   +0.01%     
==========================================
  Files         322      322              
  Lines       16591    16591              
  Branches     4787     4787              
==========================================
+ Hits        11406    11408       +2     
+ Misses       5152     5151       -1     
+ Partials       33       32       -1     
Impacted Files Coverage Δ
packages/jest-haste-map/src/index.ts 88.42% <ø> (+0.49%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ba55fe7...ec6c7db. Read the comment docs.

@SimenB SimenB merged commit c3b0946 into jestjs:main Sep 30, 2021
@SimenB
Copy link
Member

SimenB commented Sep 30, 2021

@motiz88 is this something you need a release of now, or is it fine to wait until whenever I make another release?

@motiz88
Copy link
Contributor Author

motiz88 commented Sep 30, 2021

@SimenB No rush - this has no significant effect on Metro in open source, and internally we're currently using a fork that adds hooks for some other FB-internal systems. I'll keep sending PRs for stuff we can upstream. Thanks for the speedy review!

@SimenB
Copy link
Member

SimenB commented Oct 1, 2021

Cool, thanks!

@github-actions
Copy link

github-actions bot commented Nov 1, 2021

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants