Summary:
Flow v0.176.1 has a bug when run in a non-lazy mode.
Changelog: [Internal]
Reviewed By: SamChou19815
Differential Revision: D35665720
fbshipit-source-id: a5fa691adf9ab5f5f4a67188fb3b52b4c69ee325
Summary:
Doing this patch level bump to ensure that all packages consuming `react-native` will get `7.0.3` and not lower 7.x versions.
This is because this new patch contains this fix: https://github.com/react-native-community/cli/pull/1560
(thanks NickGerleman & thymikee for your work!)
We'll have to cherry-pick this into the 0.68 branch.
While at it, I've also done a cheeky `npx yarn-deduplicate` to clean up the `yarn.lock` a bit.
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->
[General] [Changed] - Bump RN CLI to v7.0.3 to address web debugging issue
Pull Request resolved: https://github.com/facebook/react-native/pull/33156
Test Plan:
CI + some local testing via `test-manual-e2e`:
<img width="1779" alt="Screenshot 2022-02-21 at 11 40 54" src="https://user-images.githubusercontent.com/16104054/154948695-8c40bb56-87eb-4326-a740-49930994c08b.png">
Reviewed By: cortinico
Differential Revision: D34385503
Pulled By: motiz88
fbshipit-source-id: f0d8c4e0e92f83c0d819eeaa0fbec27820145968
Summary:
This diff updates the xplat flowconfigs to make existential types an error.
Changelog: [Internal]
Reviewed By: pieterv
Differential Revision: D29967838
fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d
Summary:
A future version of Flow will make the `indexed_access` option on by default. Turn it off explicitly in xplat until we're ready to deploy.
Changelog: [Internal]
Reviewed By: panagosg7
Differential Revision: D29468755
fbshipit-source-id: 1ae5bb5f57315a2dab3072cc25689c3fc72ef871
Summary:
Both new_signatures and abstract_locations are now enabled by default, so we don't need the configuration. Both options are going to be removed soon as well.
Changelog: [Internal]
Reviewed By: gkz
Differential Revision: D27319298
fbshipit-source-id: 30e6dcd2d30a45f630388998957c8db39895a8f7
Summary:
This mode re-implements parts of the types-first architecture, and is a step
toward types-first 2.0, which will greatly reduce memory usage. In this mode,
Flow finds some errors that were missed before.
Changelog: [Internal][Changed] Updated to Flow's new signatures mode for types-first
Reviewed By: panagosg7
Differential Revision: D26890348
fbshipit-source-id: 4c0bc4960a79ae2c4fa4c420bac506c9b2565beb
Summary:
The old generate-tests mode for checking generics is now defaulted to `false`, and the code path that the setting supports is getting deleted, so .flowconfigs no longer should specify that `generate-tests=false`
Changelog: [Internal]
Reviewed By: panagosg7
Differential Revision: D25958102
fbshipit-source-id: a15926f04bd8cd4337f489cddbb8e385821243bc
Summary:
The Flow team has been building a new implementation of the system that typechecks the body of generic functions and classes. This system is more sound than the previous approach and detects errors that were uncaught previously. This diff turns on the new generic system by setting generate_tests=false in the .flowconfig, and suppresses newly discovered errors.
This diff modifies and re-signs some generated modules, because syncing from www pulled in a ton of other changes that have runtime differences, and I'm not equipped to verify that the changes are safe to land.
Changelog: [Internal]
Reviewed By: panagosg7
Differential Revision: D24801184
fbshipit-source-id: bb31fe4c5a4107d183649b436a548df5ff42e217
Summary:
Types First and the various esproposal flags are on by default as of 0.135
Clean up flowconfigs that have to be in sync with the main one
Changelog: [Internal]
Reviewed By: jimmy623
Differential Revision: D24221995
fbshipit-source-id: 5da2867e2f013ad729a436ada192ecab690cb413
Summary:
Removes `fbjs` dependency from `react-native` because it is no longer referenced.
Changelog:
[General][Changed] - Removed `fbjs` dependency from `react-native`.
Reviewed By: cpojer
Differential Revision: D23358201
fbshipit-source-id: 1945590d2e7ea853434c716a151fc1058718d471
Summary:
Changelog: [Internal]
This lint is now an error by default, so we no longer need to manually specify it as such in the flowconfig
Reviewed By: gkz
Differential Revision: D23145523
fbshipit-source-id: 6c104563793fbc67c8b15b7310e96d1750d21df3
Summary:
Changelog: [Internal]
This lint is now an error by default, so we no longer need to manually specify it as such in the flowconfig. This also gets us ready to remove the lint entirely from Flow.
Reviewed By: gkz
Differential Revision: D23134689
fbshipit-source-id: 683a414bb399b823c65b7f687d25344d3e3ba980
Summary:
Changelog: [Internal]
I had to update the types-first flags in the giuthub flowconfigs because they are removed in 0.128. I updated the snapshot test as well
allow-large-files
Reviewed By: mroch
Differential Revision: D22336797
fbshipit-source-id: ebeb0c05479d2dac69a66645d042d5671453f5e8
Summary:
Flow is deprecating this config option, so we are removing it in preparation.
Changelog:
[Internal]
Reviewed By: gkz
Differential Revision: D21642915
fbshipit-source-id: cb2abff067b8702b37d5fdbdd63556f464e2a4a5
Summary:
Used the deploy_xplat.sh script.
There were a few errors after running the script, so I reverted the changes to those files and the errors went away. This is expected because the new version does not introduce errors, so these errors were caused by the deploy script.
Changelog: [Internal]
Reviewed By: samwgoldman
Differential Revision: D20070916
fbshipit-source-id: 56b8f56eab952010f44219ce1b5c4ec66a0b084a
Summary:
With the release of 0.118 Flow now checks for unsafe additions between numbers and null/void. This enables this check in xplat.
```~/fbsource/fbcode/flow/tool add-comments --bin `which flow` --comment="//flowlint-next-line unsafe-addition=off" ~/fbsource/xplat/js```
`js1 test -u __tests__/flowconfig-sync-test.js`
Changelog: [Internal]
bypass-lint
Reviewed By: nmote
Differential Revision: D19823403
fbshipit-source-id: 1f059de6c9d973cda11930f1fadb485679d4ecec
Summary:
After changes to the semantics of spread, this lint is no longer relevant and will be removed in an upcoming version of Flow.
Changelog: [Internal]
Reviewed By: jbrown215
Differential Revision: D19241147
fbshipit-source-id: 2cad93725055601f2ceaa2379ed3643f136ff69b
Summary:
Turns on the exact-by-default flag in xplat/js and gets rid of the implicit inexact object lint, which has no effect when exact-by-default is on.
Will land this on Monday along with an announcement post.
Changelog: [Internal]
Reviewed By: gkz
Differential Revision: D18863276
fbshipit-source-id: 07a31e957bea1d1e053e8fa5975fdb1b6da1bdc4
Summary:
This will ensure we don't get any more implicit inexact objects in xplat/js. Before we turn on exact-by-default we are going to make an announcement post, so this diff will hold the line until that's out.
Changelog: [Internal]
Reviewed By: gkz
Differential Revision: D18785892
fbshipit-source-id: caeb662f08b44cebe34b9e1b52bdd5842fe06176
Summary:
I'll land this once the upgrade to v0.111 is rolled out here. That release turns this flag on by default.
Changelog: [Internal] Adjust Flow configuration
Reviewed By: panagosg7
Differential Revision: D18329245
fbshipit-source-id: a9ab92fda06d546f3246dcdd066e904b5a657062
Summary:
Now that types-first is out in xplat, we can turn abstract locations on for improved recheck optimizations.
This was rolled out in www before we had the rollouts feature. This is a chance to get better data on how abstract locations actually performs.
Changelog: [Internal] Update Flow options to improve recheck speed
Reviewed By: panagosg7
Differential Revision: D18145269
fbshipit-source-id: 33941251288884ded4b0d8c9fe7df8225d3429f6
Summary:
This has been [proven in www](https://fb.workplace.com/groups/floweng/permalink/2900038803378049/). Now that xplat is on types-first, we can turn this on.
Changelog: [Internal] Update Flow options to improve recheck speed
Reviewed By: panagosg7
Differential Revision: D18144757
fbshipit-source-id: b67660206c70d7ea81057195f365b03a7198bd07
Summary:
I am importing an image from a scoped package and I expected this to be recognized by the `module.name_mapper` and treated as a `RelativeImageStub`. But since there's an `@` in the path, the string does not match the regex pattern as it is defined today. Therefore I added the possibility of a `@` in the start of the path to the regex pattern.
Example import not recognized by the name_mapper today:
```
import NicePicture from 'example-pkg/assets/nice-picture.png'
```
## Changelog
[General] [Fixed] - Make RelativeImageStub regex match images in scoped packages
Pull Request resolved: https://github.com/facebook/react-native/pull/26567
Test Plan:
* I have run `yarn flow` in the `react-native` project
* I tested that it resolves my issue with images in scoped packages in my own app's repo
Differential Revision: D17589473
Pulled By: cpojer
fbshipit-source-id: d0c18f2b36456fd974012a0605f3d9ceff0ad744
Summary: I am unsure whether there was a reason not to use an `index.js` file from the beginning. It always struck me as confusing and odd to have the main API hidden in a folder somewhere. This changes RN to use the standard `index.js` file that is common in almost all JavaScript packages.
Reviewed By: yungsters, rubennorte
Differential Revision: D17314423
fbshipit-source-id: 10eaf4fddd41e91163de7d10c0879b623dab00d7
Summary: Explicitly define the types of the getters in `react-native-implementation` so we can enable Flow's types-first mode for that file.
Reviewed By: cpojer
Differential Revision: D16937607
fbshipit-source-id: 2e4cf483043a53c5407254ffa2b3211d40211019
Summary: The types-first codemod adds a few of these, so need to sync the suppressions here with the ones in xplat/js/.flowconfig
Reviewed By: jbrown215
Differential Revision: D16690168
fbshipit-source-id: 49d3f80a4ab24badf11a9ac54abfe49670989a91
Summary:
* Adds Flow types to `error-guard.js` and propagates them via the `ErrorUtils` module.
* Fixes some call sites to account for the stricter (correct) types.
Differential Revision: D16619538
fbshipit-source-id: c006ff2736ec380763956c4b89702cf44dd4deb0
Summary:
This view will be re-used for bundle splitting so I'm changing the name to be more generic as it can be used for informing users of any loading activity.
I also cleaned up the files a bit from a class to just an object.
Reviewed By: gaearon
Differential Revision: D16281367
fbshipit-source-id: 5c2ee7790d29ccba473bd6e90737d2f0581e6291
Summary:
**Depends on https://github.com/facebook/react-native/pull/25100**
This is one of the steps unlocked by migrating RN from Haste to path-based imports. This commit sets Flow to use path-based imports by removing all of the Haste-related configuration options.
Additionally, it maps `react-native` to import from within this module to match Node's module resolution behavior. It also adds `<PROJECT_ROOT>` to the image name mapper so that the mapped name doesn't rely on Haste.
## Changelog
[General] [Changed] - Make Flow configs use path-based imports instead of Haste
Pull Request resolved: https://github.com/facebook/react-native/pull/24812
Differential Revision: D15659189
Pulled By: cpojer
fbshipit-source-id: d0efaa2884485a492dcdef8d94061129cebc2566
Summary:
See https://github.com/facebook/react-native/issues/24316 for the motivation.
By adding the .android.js and .ios.js extensions to the respective .flowconfig files, Flow is able to find files that either:
- Are required using Haste
- Are required using standard paths and have a .js extension
- Are required using standard paths and have a .platform.js subextension
[General] [Changed] - Adjusted .flowconfig to support both Haste and standard path-based requires
Pull Request resolved: https://github.com/facebook/react-native/pull/24318
Differential Revision: D14822356
Pulled By: cpojer
fbshipit-source-id: dde0c83692d6170f4a44cd3fb8ede162054157e9
Summary:
This lint setting makes deprecated $call syntax a warning instead of an error,
which is the default. This feature has been deprecated since Flow v0.75.0, and
I'm working to finally remove it, which will also remove this lint setting.
Reviewed By: dsainati1
Differential Revision: D14650366
fbshipit-source-id: 779df61be88996278ea63355517c17ec721cea7f
Summary:
This gets completely rid of this flow ignore. The flow team is using the version
aware `$FlowFixMe` now and the only instance of this used was on www dating back
to 2016: D3235864
My intention here was to slightly simplify the flowconfigs.
Reviewed By: gabelevi
Differential Revision: D14494167
fbshipit-source-id: 0fab176ce326007ac45b47691378812c74a523e6
Summary: 0.95 has a more accurate definition of JSON.stringify which could return void.
Reviewed By: dsainati1
Differential Revision: D14494286
fbshipit-source-id: 6cf9cb5889b4078548665bc66fe899a266c689ce
Summary:
* Added a default value for HMRLoadingView this will prevent errors from being thrown when `HMRClient` attempts to include it in a `web` context.
* [Web] [Added] - HMRLoadingView
Pull Request resolved: https://github.com/facebook/react-native/pull/23389
Differential Revision: D14045475
Pulled By: cpojer
fbshipit-source-id: df5c3cf3536af3b37eaf82342b6346bc25054319
Summary: Turn on xplat warnings individually rather than all at once. This makes it easier for the team to add new lints that we don't necessarily want to enable globally.
Reviewed By: panagosg7
Differential Revision: D13993571
fbshipit-source-id: 019f301f584be268fdcbf5b0540f63ce6fcd54e3
Summary: Now that Flow v0.92.1 is deployed, we can backout {D13942380}, which was a temporary fix.
Reviewed By: avikchaudhuri
Differential Revision: D13952515
fbshipit-source-id: d423379a03fff09316aa499e1152b410a1bb4178
Summary: Flow v0.92 is crashing sometimes after a save when run through Nuclide. This fixes the issue temporarily until we can push a Flow v0.92.1
Reviewed By: samwgoldman
Differential Revision: D13942380
fbshipit-source-id: f7bf2aef0aab90980bbb786d89710f399c9427d5
Summary:
This updates React Native to use latest CLI. We also create Metro configuration, because CLI looks for React Native in "node_modules" by default. Since we are running React Native from source, it will fail to find required files.
To avoid hacky logic to detect if we are running from source backed into the CLI, I decided to leverage the Metro configuration instead.
Pull Request resolved: https://github.com/facebook/react-native/pull/23052
Reviewed By: rickhanlonii
Differential Revision: D13719938
Pulled By: cpojer
fbshipit-source-id: 1f40a40b3cdbb07ccd42daf75feb457556d3e40f
Summary: Upgrades flow in xplat/js to 0.91. This diff also adds and removes suppressions.
Reviewed By: samwgoldman
Differential Revision: D13720697
fbshipit-source-id: 1bf8830ce286db92277476a2d2404cf0c0dddca2
Summary: Remove `$Subtype` and `$Supertype` utilities. Replacement was done on a best-effort basis. In many cases it sufficed to replace `$Supertype<T>` and `$Subtype<T>` with `T`, but when this was not possible `any | T` and `any & T` were used instead.
Reviewed By: jbrown215
Differential Revision: D13624765
fbshipit-source-id: 82ee9d43cfc318ed4bd2d84e0f4c5c1d8f488a9c
Summary:
These comments were confusing since we don't use flow-typed.
cc bvaughn.
I have replaced our local types by flow-typed, removed metro custom stub and deleted `flow-github` directory.
As result, createReactClass, PropTypes and Metro types won't be distributed to RN users. If you need it, you should relay on flow-typed.
Pull Request resolved: https://github.com/facebook/react-native/pull/20320
Reviewed By: TheSavior
Differential Revision: D13517157
Pulled By: rickhanlonii
fbshipit-source-id: e52c0b6114114a706f6152b2031c600e3dece0d2
Summary: This diff moves the React Native template from `local-cli/templates/HelloWorld` to `template`. Keeping it in the react-native repo will allow us to make changes to the template and version it together with react-native, instead of moving it out into a separate repo and trying to keep the template in sync with RN.
Reviewed By: TheSavior
Differential Revision: D13372949
fbshipit-source-id: e68e267b4dcf6384535d7b48fc11e297a12e9676
Summary: This is one more step to remove `fbjs` from `react-native-github`. This changes both the internal and external code to use `invariant` from zertosh instead of the copy in fbjs.
Reviewed By: yungsters
Differential Revision: D13195941
fbshipit-source-id: 73564ca1715110e7da9c7ef56dc57374d61377e0
Summary: Stop ignoring `metro` folder from RN and use their flowtypes correctly
Reviewed By: hramos
Differential Revision: D13085169
fbshipit-source-id: f285223afb7e89ac2c63e53d36be2f3645fa6761
Summary:
We don't want people requiring from this file via haste. This file is the main for the react-native yarn workspace requireable via require('react-native').
https://pxl.cl/jnWC
Reviewed By: mostafaeweda, RSNara
Differential Revision: D10444200
fbshipit-source-id: 3832857e3df01def128525f32c9735e928802b59
Summary: was using `[foo|bar]` to match `foo` or `bar` instead of `\\(foo\\|bar\\)` (ocaml/emacs regexes are the worst). this meant that the "site" part of FlowFixMe and FlowIssue suppression comments were basically not working, so a suppression in one site suppressed the other incorrectly.
Reviewed By: jbrown215
Differential Revision: D10365477
fbshipit-source-id: 1188c7378b5e6fd3090b27c1aa54480efdd09250
Summary: The controller you requested could not be found.
Reviewed By: gabelevi
Differential Revision: D9390604
fbshipit-source-id: 68ba89ba197f74322e4c85c3bfc1f334fb740852
Summary:
Most of the changes associated with this commit will not be visible on GitHub, as they concern files in the internal Facebook monorepo. The bulk of this change is the addition of a new test that runs on the internal test infrastructure. The actual script used by the test has various references to the internal test infra, but a copy is produced below with some changes that should allow it to run on open source should anyone be interested in testing this outside of Facebook.
The test has the main goal of catching common sources of FB-to-GitHub breakages, such as the OSS Flow config falling out of date (we use a different flow config than what is synced out in .flowconfig, and hence internally we rename this file to .github.flowconfig). It also checks that the packager can run on a brand new project, among other things.
```
set -e
THIS_DIR=$(pwd)
REACT_NATIVE_TEMP_DIR=$(mktemp -d /tmp/react-native-XXXXXXXX)
REACT_NATIVE_APP_TEMP_DIR=$(mktemp -d /tmp/react-native-XXXXXXXX)
OFFLINE_MIRROR=$(yarn config get yarn-offline-mirror)
function describe {
printf "\\n\\n>>>>> %s\\n\\n\\n" "$1"
}
function cleanup {
set +e
rm -rf "$REACT_NATIVE_TEMP_DIR"
rm -rf "$REACT_NATIVE_APP_TEMP_DIR"
rm "$OFFLINE_MIRROR/react-native-v1000.0.0.tgz"
set -e
}
trap cleanup EXIT
describe "Creating temporary react-native-github clone"
cp -R "react-native" "$REACT_NATIVE_TEMP_DIR"
pushd "$REACT_NATIVE_TEMP_DIR/react-native" >/dev/null
echo yarn-offline-mirror="$OFFLINE_MIRROR" > .npmrc
describe "Installing react-native node_modules from offline cache"
yarn install --mutex network --offline --frozen-lockfile --ignore-engines --ignore-scripts 2>&1
describe "Running a Flow check"
mv .github.flowconfig .flowconfig
./node_modules/.bin/flow check
describe "Running a basic packager test"
touch .watchmanconfig
node local-cli/cli.js bundle --platform android --dev true --entry-file ReactAndroid/src/androidTest/js/TestBundle.js --bundle-output ReactAndroid/src/androidTest/assets/AndroidTestBundle.js
describe "Creating package for e2e test"
yarn pack
REACT_NATIVE_PACKAGE="$(pwd)/react-native-v1000.0.0.tgz"
REACT_VERSION=$(node -p -e "require('./package.json').peerDependencies['react']")
REACT_NATIVE_HASH=$(shasum "$REACT_NATIVE_PACKAGE" | awk '{print $1;}')
REACT_NATIVE_DEPS=$(node -p -e "const deps=require('./package.json').dependencies; ' ' + Object.keys(deps).map(dep => dep + ' \"' + deps[dep] +'\"').join('\n ')")
popd >/dev/null
describe "Installing temporary RN app"
mkdir "$REACT_NATIVE_APP_TEMP_DIR/PackagerTest"
pushd "$REACT_NATIVE_APP_TEMP_DIR/PackagerTest" >/dev/null
cp "$REACT_NATIVE_PACKAGE" ./
cp "$REACT_NATIVE_PACKAGE" "$OFFLINE_MIRROR"
cp "$REACT_NATIVE_TEMP_DIR/react-native/.npmrc" ./
cp "$REACT_NATIVE_TEMP_DIR/react-native/yarn.lock" ./
cat <<LOCKFILE >> yarn.lock
react-native@1000.0.0:
version "1000.0.0"
resolved react-native-v1000.0.0.tgz#$REACT_NATIVE_HASH
dependencies:
$REACT_NATIVE_DEPS
LOCKFILE
cat > package.json <<- EndOfFile
{
"name": "packager-test",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start"
},
"dependencies": {
"react": "$REACT_VERSION",
"react-native": "1000.0.0"
}
}
EndOfFile
yarn install --mutex network --offline --frozen-lockfile --ignore-engines --ignore-scripts 2>&1
sed -e s/"HelloWorld"/PackagerTest/g "react-native/local-cli/templates/HelloWorld/app.json" > app.json
cp "react-native/local-cli/templates/HelloWorld/_buckconfig" .buckconfig
cp "react-native/local-cli/templates/HelloWorld/_flowconfig" .flowconfig
cp "react-native/local-cli/templates/HelloWorld/_watchmanconfig" .watchmanconfig
cp "react-native/local-cli/templates/HelloWorld/App.js" App.js
cp "react-native/local-cli/templates/HelloWorld/index.js" index.js
describe "Running a Flow check on a new RN app"
flow check
describe "Verifying packager can produce JS bundle for a new RN app on both platforms"
node ./node_modules/react-native/local-cli/cli.js bundle --platform ios --dev true --entry-file index.js --bundle-output ios-bundle.js
test -e ios-bundle.js
rm ios-bundle.js
node ./node_modules/react-native/local-cli/cli.js bundle --platform android --dev true --entry-file index.js --bundle-output android-bundle.js
test -e android-bundle.js
rm android-bundle.js
popd >/dev/null
```
Reviewed By: arcanis
Differential Revision: D9129463
fbshipit-source-id: a91eeaa150ae6623ee67bd758bc8a98bb31e57b8
Summary:
Adds a .github.flowconfig.android.
Also, adds the optional _ios and _android to the sites.
Reviewed By: TheSavior
Differential Revision: D9189935
fbshipit-source-id: 5274701b9425525337d5c4684ce4ffee841fef52
Summary: The controller you requested could not be found.
Reviewed By: pakoito
Differential Revision: D9174188
fbshipit-source-id: 4ec9ef5b6f802964a83b6bc0bd29db7f47b37c21
Summary:
Follow up to a9792ac4c8. I assume it's enabled for fb flow config so we can avoid future breakages if someone decide to use this syntax.
Pull Request resolved: https://github.com/facebook/react-native/pull/20516
Differential Revision: D9169244
Pulled By: TheSavior
fbshipit-source-id: 3736d2aed65a0cb4392c175f7d652594cf6a1518
Summary:
There's a couple of Flow errors in open source, following D9081343:
```
yarn run v1.6.0
$ flow check
Error --------------------------------------------------------------------- Libraries/Components/Switch/Switch.js:139:31
Experimental optional chaining (`?.`) usage. Optional chaining is an active early-stage feature proposal that may
change. You may opt in to using it anyway by putting `esproposal.optional_chaining=enable` into the `[options]` section
of your `.flowconfig`.
139| let _trackColorForFalse = trackColor?.false;
^^^^^^^^^^^^^^^^^
Error --------------------------------------------------------------------- Libraries/Components/Switch/Switch.js:140:30
Experimental optional chaining (`?.`) usage. Optional chaining is an active early-stage feature proposal that may
change. You may opt in to using it anyway by putting `esproposal.optional_chaining=enable` into the `[options]` section
of your `.flowconfig`.
140| let _trackColorForTrue = trackColor?.true;
^^^^^^^^^^^^^^^^
```
See https://circleci.com/gh/facebook/react-native/48701
We have a different Flow config for open source, .github.flowconfig, that needs to be updated to ensure Flow passes in oss.
Reviewed By: TheSavior
Differential Revision: D9141134
fbshipit-source-id: 7b546ef4c9a91bdd66472242f38a6fc8bcf86364
Summary: No new errors in this version. Just removed a bunch of unused suppressions
Reviewed By: TheSavior
Differential Revision: D8754160
fbshipit-source-id: 2f02240b6d65edecba5d9ed603c7703462547a7f
Summary:
We enforce this config locally in fbsource, lets ensure our flow strict files are run the same way in the github repo.
@public
Reviewed By: sahrens
Differential Revision: D8530133
fbshipit-source-id: 18528992ad6490826431359d5d8c6acd6710a8ae
Summary:
In this repo we have to require from fbjs/lib/invariant and issues occur when we require directly from invariant/warning. Flow doesn't complain about those requires right now because we have a transitive dependency on invariant and warning causing them to happen to be at the root of node_modules.
This change blacklists requiring directly from invariant and warning using Flow. janicduplessis opened a pull request to do this with ESLint back in 2017: https://github.com/facebook/react-native/pull/13014
Closes https://github.com/facebook/react-native/pull/19634
Reviewed By: hramos
Differential Revision: D8343060
Pulled By: TheSavior
fbshipit-source-id: 9cfc7915b2fb68a567355fc2f5edc4dfcd46f4af
Summary:
This PR removes the need for having the `providesModule` tags in all the modules in the repository.
It configures Flow, Jest and Metro to get the module names from the filenames (`Libraries/Animated/src/nodes/AnimatedInterpolation.js` => `AnimatedInterpolation`)
* Checked the Flow configuration by running flow on the project root (no errors):
```
yarn flow
```
* Checked the Jest configuration by running the tests with a clean cache:
```
yarn jest --clearCache && yarn test
```
* Checked the Metro configuration by starting the server with a clean cache and requesting some bundles:
```
yarn run start --reset-cache
curl 'localhost:8081/IntegrationTests/AccessibilityManagerTest.bundle?platform=android'
curl 'localhost:8081/Libraries/Alert/Alert.bundle?platform=ios'
```
[INTERNAL] [FEATURE] [All] - Removed providesModule from all modules and configured tools.
Closes https://github.com/facebook/react-native/pull/18995
Reviewed By: mjesun
Differential Revision: D7729509
Pulled By: rubennorte
fbshipit-source-id: 892f760a05ce1fddb088ff0cd2e97e521fb8e825
Summary:
Fixes the Flow failure due to an undefined Ast type.
Before:
```
$ npm run flow -- check
> react-native@1000.0.0 flow /Users/hramos/git/react-native
> flow "check"
Error: local-cli/__tests__/fs-mock-test.js:27
27: beforeEach(() => {
^^^^^^^^^^ beforeEach. Could not resolve name
Error: local-cli/__tests__/fs-mock-test.js:53
53: expect(content).toEqual('beep');
^^^^^^ expect. Could not resolve name
Error: local-cli/__tests__/fs-mock-test.js:88
88: expect(content).toEqual('hello, world!');
^^^^^^ expect. Could not resolve name
Error: local-cli/__tests__/fs-mock-test.js:100
100: expect(content).toEqual('hello, world!');
^^^^^^ expect. Could not resolve name
Error: node_modules/metro/src/Bundler/util.js.flow:46
46: ): Ast {
^^^ Ast. Could not resolve name
Error: node_modules/metro/src/ModuleGraph/worker/collect-dependencies.js.flow:283
283: const xp = (module.exports = (ast: Ast) =>
^^^ Ast. Could not resolve name
Error: node_modules/metro/src/assetTransformer.js.flow:29
29: ): Promise<{ast: Ast}> {
^^^ Ast. Could not resolve name
```
After
```
$ npm run flow -- check
> react-native@1000.0.0 flow /Users/hramos/git/react-native
> flow "check"
Error: local-cli/__tests__/fs-mock-test.js:27
27: beforeEach(() => {
^^^^^^^^^^ beforeEach. Could not resolve name
Error: local-cli/__tests__/fs-mock-test.js:53
53: expect(content).toEqual('beep');
^^^^^^ expect. Could not resolve name
Error: local-cli/__tests__/fs-mock-test.js:88
88: expect(content).toEqual('hello, world!');
^^^^^^ expect. Could not resolve name
Error: local-cli/__tests__/fs-mock-test.js:100
100: expect(content).toEqual('hello, world!');
^^^^^^ expect. Could not resolve name
```
[ GENERAL ] [ BUGFIX] [ .flowconfig ] - Have Flow ignore Metro node_nodules
Closes https://github.com/facebook/react-native/pull/17187
Differential Revision: D6572303
Pulled By: hramos
fbshipit-source-id: aa256b9725970fcc2a6da6578c83e7c0875e3cfd
Summary:
Metro Bundler ships with `react_native_fb` flow annotations whereas our repo is set to ignore `react_native_oss` flow issues.
For now, a hot fix is to make our repo ignore both.
Detailed discussion happens here: 87cfc05ea6 (commitcomment-24884835)
Those changes have been applied to `0.50.0-rc.0` in order to make it green.
Closes https://github.com/facebook/react-native/pull/16310
Differential Revision: D6031378
Pulled By: hramos
fbshipit-source-id: 491d866bb35bd6c30a27dbc04586b15144a8efb2
Summary:
Testing Danger support in CI. Continuation of #14964, which Circle stopped building.
Update your node modules first: `npm install`
`npm run danger pr https://github.com/facebook/react-native/pull/14951`
Verify output. This PR should trigger a WIP warning, as well as a package.json warning:
```
> react-native@1000.0.0 danger /Users/hramos/git/react-native
> node ./node_modules/.bin/danger "pr" "https://github.com/facebook/react-native/pull/14951"
{
fails: [],
warnings: [
{
message: "👷 Work In Progress - <i>Do not merge yet.</i>"
},
{
message: "🔒 Changes were made to package.json - <i>This will require a manual import. Once approved, a Facebook employee should import the PR, then run `yarn add` for any new packages.</i>"
}
],
messages: [],
markdowns: ["This PR requires attention from the facebook/react-native team."]
}
```
`npm run danger pr https://github.com/facebook/react-native/pull/14946`
Verify output. This PR should trigger a warning against the lack of a test plan (note that the PR does have a test plan, but it does not title it as such):
```
{
fails: [],
warnings: [
{
message: "📋 Test Plan - <i>This PR appears to be missing a Test Plan</i>"
}
],
messages: [],
markdowns: []
}
```
`npm run danger pr https://github.com/facebook/react-native/pull/13186`
Should warn against a missing test plan:
```
{
fails: [],
warnings: [
{
message: "📋 Test Plan - <i>This PR appears to be missing a Test Plan.</i>"
}
],
messages: [],
markdowns: ["📄 Thanks for your contribution to the docs!"]
}
```
If the author is able to issue bot commands, we reasonably assume that this is coming from an established core contributor. Their PRs will be flagged for expedited review:
`npm run danger pr https://github.com/facebook/react-native/pull/14895`
```
{
fails: [],
warnings: [
{
message: "📋 Test Plan - <i>This PR appears to be missing a Test Plan.</i>"
}
],
messages: [],
markdowns: ["This PR has been submitted by a core contributor. Notifying facebook/react-native."]
}
```
Closes https://github.com/facebook/react-native/pull/15061
Differential Revision: D5436605
Pulled By: hramos
fbshipit-source-id: 4ba9e812387d8a69893dab537af9b6cd108753cf