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

Pass resetCache option to jest-haste-map #223

Closed
wants to merge 1 commit into from

Conversation

rozele
Copy link
Contributor

@rozele rozele commented Aug 17, 2018

When the resetCache option is set on the bundler, it should also be passed to the DependencyGraph and jest-haste-map to clean up any cached files there.

Summary

While trying to get react-native-windows working against the [email protected] RC, I ran into a series of issues because the jest-haste-map cache was not cleaned up when the --reset-cache flag was set on the react-native CLI. Not only was the option not being passed to metro (see facebook/react-native#20706), but metro was not passing the resetCache option to the DependencyGraph and jest-haste-map.

Test plan

  1. yarn test
  2. Validated in react-native-windows, where the problem was occurring. I had a case where if my hasteImpl implementation from metro.config.js had a bug. Even after fixing the bug, the jest-haste-map was cached with missing haste modules. Only after deleting that file could I get back to a state where the fixed metro.config.js would work. After making this change, using --reset-cache from the react-native CLI could clear the haste map cache.

When the `resetCache` option is set on the bundler, it should also be passed to the `DependencyGraph` and `jest-haste-map` to clean up any cached files there.
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 17, 2018
@codecov-io
Copy link

Codecov Report

Merging #223 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #223   +/-   ##
=======================================
  Coverage   85.35%   85.35%           
=======================================
  Files         134      134           
  Lines        4391     4391           
  Branches      682      682           
=======================================
  Hits         3748     3748           
  Misses        572      572           
  Partials       71       71
Impacted Files Coverage Δ
packages/metro/src/node-haste/DependencyGraph.js 93.24% <ø> (ø) ⬆️
packages/metro/src/Bundler.js 87.5% <ø> (ø) ⬆️

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 f496be3...e167448. Read the comment docs.

@rafeca
Copy link
Contributor

rafeca commented Aug 17, 2018

Thanks! I'm landing this 👍

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

rafeca is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants