-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Update RN packages and fix Flow errors #2094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…, and flow-bin@0.47, and fix Flow errors
There was still a couple Flow errors that were popping up when using this react-navigation on a stock React Native 0.46 app, and they had to with unused suppressions in StackRouter-test.js. I removed those suppressions and identified they were only necessary because of a mismatch between the Jest version in package.json (v20) and the Flow typedef version for Jest (v17). I updated the typedef with flow-typed, as well as updating Jest to the latest version, and I was able to remove the suppression. |
const subAction = route.index !== undefined && route.index !== 0 // if the child screen is a StackRouter then always navigate to its first screen (see #1914) | ||
? NavigationActions.navigate({ routeName: route.routes[0].routeName }) | ||
: undefined; | ||
let subAction = undefined; |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Now that a new version has been released correcting the single Flow 0.47 error, I've updated the version of Would appreciate a review! @matthamil, @satya164? |
LGTM. cc @skevy |
Can we get this merged soon please? The failed tests reflect eslint errors that are outside the scope of this PR: |
Another ping here! Could somebody accept this PR please? |
@skevy has independently implemented most of the changes in this PR, so I'm going to close it. My goal with this PR was to help maintain a version of react-navigation that works with the latest RN release without any Flow errors. I think it's a pretty negative experience for a user today to get Flow errors when installing this package on a clean RN starter app. Unfortunately, neither the latest version of the react-navigation npm package, nor what's in master on this repo, are currently able to evaluate with no Flow errors on a fresh copy of RN. The issues with the npm package is that it is far too old, and the issue with master is that it is using new Flow features that aren't compatible with the version of Flow RN 0.46 declares in its .flowconfig. react-navigation uses Flow 0.49, but RN 0.46 declares Flow 0.47 in its .flowconfig. I am willing to try and help with this if @skevy sees this as a worthy goal, and is willing to review and accept PRs. That said, my assumption for now is going to be that you are tracking towards a new npm release that will be Flow-error-free in concert with a future version of react-native (hopefully RN 0.47, which I assume will have Flow 0.49). |
Good job @Ashoat! Would be so nice to get these errors fixed : ) But when looking at this now, this PR could be split into a few smaller PRs. Currently a commit like this 094a9cc is rather hard to review and combines to unrelated changes. Maintainers likes small and focused PRs. Would really to see some new PRs for this and hopefully some of the new maintainers have time to review it. |
I'm going to go back through this PR soon. In a quick pass, everything looks good. Assigning myself to this PR. |
Great to see some attention here! @matthamil: This PR is unfortunately out-of-date, and would not apply cleanly to today's version of this repo, which is why I closed it. I can try to put up a new version later today, probably as a separate PR. I'd avoid reviewing until then. @skovhus: Fair feedback. I'll see if I can break down my commits a bit better, though it's worth noting that the result of |
Okay, #2619 is the new PR. |
@matthamil, #2619 is ready for a look! I can't seem to assign reviews in this repo, so would be awesome if you could self-assign. |
react-native -> 0.46.1
react -> 16.0.0-alpha.12
flow-bin -> 0.47
Flow 0.47 has stronger opinions about passing parameters to functions that are defined not to accept them, so I had to fix several Flow errors that popped up. In some cases the type definition needed to be corrected, in some cases the functions didn't list parameters they could take, and in some cases extraneous parameters were being passed.