mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
77c535ce25575e0679d7df8d40afe4dcce1d3c1f
While optimizing per @josephsavona's suggestions in #1592, I noticed that we were clearing quite a few require cache entries. As of this PR, `Object.keys(require.cache)` holds - 1258 entries total - 67 files compiled from Forget source code (this is what `ts.createWatchCompilerHost` modifies) - 1120 babel source files (from node_modules) When working on watch mode, I'm almost always making changes to Forget source or test fixture files. It's a bit faster to just clear those entries (assuming that babel has no global state we need to invalidate). On my computer, re-running tests in watch mode (triggered by source code changes) takes: | | All tests | One test (filter) | |-- |--------|----------| | current | 4.7s | 1.8s | | this PR | 1.8s | 0.1s |
Languages
JavaScript
67.1%
TypeScript
29.4%
HTML
1.5%
CSS
1.1%
C++
0.6%
Other
0.2%