-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Apply --reset-cache
argument to bundle
command
#20706
Conversation
The `--reset-cache` argument was not working correctly with the `bundle` command. This ensures the `--reset-cache` arg is passed to metro. Fixes #20703
Summary: 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. <!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory. --> **Summary** <!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? --> While trying to get `react-native-windows` working against the `react-native@0.57` 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** <!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. --> 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. Pull Request resolved: #223 Differential Revision: D9377632 Pulled By: rafeca fbshipit-source-id: e67b5eeb84937daedc7e9f7b5a7d93e11e0d7edb
Looks like we need to wait for Metro to cut a new release that includes facebook/metro@387d487 before landing this. |
@hramos - there is nothing blocking this from being merged. This change will still fix an issue where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hramos is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
This pull request was closed by @rozele in 7062e5b. Once this commit is added to a release, you will see the corresponding version tag below the description at 7062e5b. If the commit has a single |
Summary: The `--reset-cache` argument was not working correctly with the `bundle` command. This ensures the `--reset-cache` arg is passed to metro. Fixes #20703 Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged. Pull Request resolved: #20706 Differential Revision: D9400548 Pulled By: hramos fbshipit-source-id: 2c7ed0226cfcdffa8cc77506500c314552baef3f
Summary: The `--reset-cache` argument was not working correctly with the `bundle` command. This ensures the `--reset-cache` arg is passed to metro. Fixes facebook#20703 Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged. Pull Request resolved: facebook#20706 Differential Revision: D9400548 Pulled By: hramos fbshipit-source-id: 2c7ed0226cfcdffa8cc77506500c314552baef3f
Summary: The `--reset-cache` argument was not working correctly with the `bundle` command. This ensures the `--reset-cache` arg is passed to metro. Fixes #20703 Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged. Pull Request resolved: facebook/react-native#20706 Differential Revision: D9400548 Pulled By: hramos fbshipit-source-id: 2c7ed0226cfcdffa8cc77506500c314552baef3f
Summary: The `--reset-cache` argument was not working correctly with the `bundle` command. This ensures the `--reset-cache` arg is passed to metro. Fixes facebook#20703 Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged. Pull Request resolved: facebook#20706 Differential Revision: D9400548 Pulled By: hramos fbshipit-source-id: 2c7ed0226cfcdffa8cc77506500c314552baef3f
The
--reset-cache
argument was not working correctly with thebundle
command. This ensures the--reset-cache
arg is passed to metro.Fixes #20703
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.
If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
Test Plan:
Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
react-native
in a node_modules folder of a test app.--reset-cache
argRelease Notes:
Help reviewers and the release process by writing your own release notes. See below for an example.
[CATEGORY] [TYPE] [LOCATION] - Message
[GENERAL][CLI][local-cli/bundle/buildBundle.js] - Apply
--reset-cache
argument tobundle
command