[bug] Not possible to fully disable caching using Babel api
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 5.6k
- Forks
- 696
- Avg merge
- 8m
- Merged PRs (30d)
- 7
Description
Is there a way to fully disable React Native Packager caching?
We have a very small application that is only used for showing the assets. All assets files are imported automatically from special directory using babel-plugin-codegen. The problem is that these imports do not regenerate on files change. It seems that Babel just doesn't support partial caching. So, the solution is to rebuild the whole app every time it reloads in Simulator.
Unfortunately methods described in Babel docs don’t work for some reason with Metro Bundler. This is our babel.config.js
module.exports = function (api) {
api.cache.never()
return {
presets: ['module:metro-react-native-babel-preset'],
plugins: ['macros']
}
}
and these are our dependencies (project is created with react-native init yesterday)
"react-native": "0.62.2"
"metro-react-native-babel-preset": "^0.58.0",
Thanks for your help in advance!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied babel.config.js and the Metro React Native Babel preset at react-native 0.62.2. Reproduce the asset-import refresh problem in the Simulator, then trace how Metro and the Babel API handle api.cache.never(). Done should be a confirmed explanation and a documented or tested way to disable caching fully, if supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100