Skip to content
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

[flow-strict] Flow strict ScrollView; get rid of InternalScrollViewType #22301

Closed
wants to merge 3 commits into from

Conversation

thymikee
Copy link
Contributor

@thymikee thymikee commented Nov 15, 2018

Summary

Relates to #22100.

I left 2 $FlowFixMes as I was not sure how to handle generic React.Element<> and which native props can I pass to ScrollView (would be cool to document it once we got proper types there).

I also got rid of InternalScrollViewType because we have better typings in original ScrollView now.

Test Plan

Flow passes.

Changelog

[General] [Fixed] - Stricter Flow typings for ScrollView

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Tests This PR adds or edits a test case. labels Nov 15, 2018
@RSNara RSNara changed the title Flow strict ScrollView; get rid of InternalScrollViewType [flow-strict] Flow strict ScrollView; get rid of InternalScrollViewType Nov 15, 2018
Copy link
Contributor

@RSNara RSNara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

RNTester/js/RNTesterPage.js Outdated Show resolved Hide resolved
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RSNara has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@grabbou
Copy link
Contributor

grabbou commented Nov 19, 2018

@facebook-github-bot shipit

@grabbou
Copy link
Contributor

grabbou commented Nov 19, 2018

Thank you for sending this PR and to all the reviewers!

@facebook-github-bot facebook-github-bot added the Import Started This pull request has been imported. This does not imply the PR has been approved. label Nov 19, 2018
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grabbou is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@hramos
Copy link
Contributor

hramos commented Nov 19, 2018

This may require some internal work to update some internal callsites to ensure Flow check does not fail.

@thymikee
Copy link
Contributor Author

Understood. The typings around ScrollView increased significantly with this PR (by just removing the InternalScrollViewType) so I would expect some failures here and there :D. But technically that's a good thing. Hopefully it will be smooth upgrade.

@facebook-github-bot facebook-github-bot added Import Failed and removed Import Started This pull request has been imported. This does not imply the PR has been approved. labels Nov 20, 2018
@facebook-github-bot
Copy link
Contributor

I tried to merge this pull request into the Facebook internal repo but some checks failed. To unblock yourself please check the following: Does this pull request pass all open source tests on GitHub? If not please fix those. Does the code still apply cleanly on top of GitHub master? If not can please rebase. In all other cases this means some internal test failed, for example a part of a fb app won't work with this pull request. I've added the Import Failed label to this pull request so it is easy for someone at fb to find the pull request and check what failed. If you don't see anyone comment in a few days feel free to comment mentioning one of the core contributors to the project so they get a notification.

facebook-github-bot pushed a commit that referenced this pull request Dec 26, 2018
Summary:
As a part of #22301 it turned out that we need to first convert `ScrollView` to class component. As a first step to do so, here's removal of using `mixins` API, in favor of populating `_scrollResponder` field with `ScrollResponder.Mixin` (still used) methods.
Pull Request resolved: #22374

Reviewed By: TheSavior

Differential Revision: D13307775

Pulled By: RSNara

fbshipit-source-id: 16be1df8a0bf9ccc5cc32f3a017a1279f99268ed
@thymikee
Copy link
Contributor Author

Updated the diff, but didn't test it on RNTester yet. Feel free to comment on Flow typings though :)

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cpojer has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@cpojer
Copy link
Contributor

cpojer commented Jan 25, 2019

Let's see if this passes Flow internally.

@cpojer
Copy link
Contributor

cpojer commented Jan 25, 2019

Imported to see latest internal Flow errors and discussed with @thymikee. Will leave this PR for @RSNara to land.

@thymikee
Copy link
Contributor Author

@RSNara @TheSavior I've tested this on RNTester for unexpected regressions and it seems just fine. Typings also work, e.g. when you add .flowconfig to RNTester directory.

There are still open questions (e.g. whether getScrollResponder() from non-ScrollView components to return ?ScrollView as it is currently or the real ScrollView & ScrollResponder.Mixin?) so I'd like your input.

@hramos hramos added p: Facebook Partner: Facebook Partner labels Jan 31, 2019
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RSNara has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@hramos hramos added PR: Includes Test Plan and removed Component: View Import Failed Tests This PR adds or edits a test case. CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Feb 12, 2019
@react-native-bot react-native-bot added the No CLA Authors need to sign the CLA before a PR can be reviewed. label Feb 13, 2019
@pull-bot

This comment has been minimized.

@hramos hramos added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. and removed No CLA Authors need to sign the CLA before a PR can be reviewed. labels Feb 19, 2019
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RSNara has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@thymikee thymikee deleted the flow-strict/scrollview branch March 8, 2019 19:43
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @thymikee in fe533a4.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Mar 8, 2019
@facebook-github-bot facebook-github-bot added the p: Callstack Partner: Callstack label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Component: ScrollView Flow Merged This PR has been merged. p: Callstack Partner: Callstack p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants