Files
flipper/desktop/patches/metro+0.59.0.patch
Michel Weststrate 89de3d4ae2 Disable require cycle warnings
Summary: The holier-than-thou warnings of metro about require cycles are annoying. Require cycles are generally speaking well handles by ESM, and cause only harm if modules themselves are stateful, which is a bad smell. But warning for every cycle is just a flooding of false positives and removes the insentive to drop actual warnings.

Reviewed By: jknoxville

Differential Revision: D21859908

fbshipit-source-id: 66ec9a619a3737ccab5b16d11be5623d1d97c9f6
2020-06-03 08:45:16 -07:00

17 lines
692 B
Diff

diff --git a/node_modules/metro/src/lib/polyfills/require.js b/node_modules/metro/src/lib/polyfills/require.js
index 8c04756..d773811 100644
--- a/node_modules/metro/src/lib/polyfills/require.js
+++ b/node_modules/metro/src/lib/polyfills/require.js
@@ -114,11 +114,6 @@ function metroRequire(moduleId) {
.map(id => (modules[id] ? modules[id].verboseName : "[unknown]")); // We want to show A -> B -> A:
cycle.push(cycle[0]);
- console.warn(
- `Require cycle: ${cycle.join(" -> ")}\n\n` +
- "Require cycles are allowed, but can result in uninitialized values. " +
- "Consider refactoring to remove the need for a cycle."
- );
}
}