From 2c89abaa551086b283de8d91c551730e3a0f825e Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Wed, 10 Jun 2020 11:51:22 -0700 Subject: [PATCH] flow: Use path-based imports instead of Haste. Part of the RN v0.60 -> v0.61 changes to the template app [1], corresponding to facebook/react-native@bf8d91868 and a correction in facebook/react-native@732ded7f7. This must happen at or after the main upgrade commit because the former declares that it depends on facebook/react-native#25100, which landed in facebook/react-native@69d1ed731 and was released in v0.61.0. [1]: https://react-native-community.github.io/upgrade-helper/?from=0.60.6&to=0.61.5 --- .flowconfig | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/.flowconfig b/.flowconfig index 4a1de0ba0ba..66f64573327 100644 --- a/.flowconfig +++ b/.flowconfig @@ -2,14 +2,6 @@ ; We fork some components by platform .*/*[.]android.js -; Ignore unexpected extra "@providesModule" -.*/node_modules/.*/node_modules/fbjs/.* - -; Ignore duplicate module providers -; For RN Apps installed via npm, "Libraries" folder is inside -; "node_modules/react-native" but in the source repo it is in the root -node_modules/react-native/Libraries/react-native/React.js - ; Ignore polyfills node_modules/react-native/Libraries/polyfills/.* @@ -97,28 +89,11 @@ esproposal.nullish_coalescing=enable # The main warning is "Unused suppression comment". include_warnings=true - -module.system=haste -module.system.haste.use_name_reducers=true -# get basename -module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1' -# strip .js or .js.flow suffix -module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1' -# strip .ios suffix -module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1' -module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1' -module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1' -module.system.haste.paths.blacklist=.*/__tests__/.* -module.system.haste.paths.blacklist=.*/__mocks__/.* -module.system.haste.paths.whitelist=/node_modules/react-native/Libraries/.* -module.system.haste.paths.whitelist=/node_modules/react-native/RNTester/.* -module.system.haste.paths.whitelist=/node_modules/react-native/IntegrationTests/.* -module.system.haste.paths.blacklist=/node_modules/react-native/Libraries/react-native/react-native-implementation.js -module.system.haste.paths.blacklist=/node_modules/react-native/Libraries/Animated/src/polyfills/.* - munge_underscores=true -module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' +module.name_mapper='^react-native$' -> '/node_modules/react-native/Libraries/react-native/react-native-implementation' +module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1' +module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' suppress_type=$FlowIssue suppress_type=$FlowFixMe