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.

SimenB
SimenB approved these changes Sep 30, 2021
Copy link
Collaborator

@SimenB SimenB left a comment

seems reasonable 👍

Loading

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

@codecov-commenter codecov-commenter commented Sep 30, 2021

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.

Loading

@SimenB SimenB merged commit c3b0946 into facebook:main Sep 30, 2021
30 checks passed
Loading
@SimenB
Copy link
Collaborator

@SimenB 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?

Loading

@motiz88
Copy link
Contributor Author

@motiz88 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!

Loading

@SimenB
Copy link
Collaborator

@SimenB SimenB commented Oct 1, 2021

Cool, thanks!

Loading

@github-actions
Copy link

@github-actions 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.

Loading

@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
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants