-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Port windows fork of Pressable to win32 #9132
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistency between platforms is 👍
Running "yarn lint:fix" should resolve CI errors. If you plan to do long term RNW dev, the eslint extension for VSCode is a must. |
how will we stay consistent with changes? Can we instead make a common file that's exported from the platform-specific files? |
For staying in sync with upstream, it looks like react-native-platform-override should take care of it. Notice the For instead making a common file that's exported, I haven't seen that done by other win32 components here. My guess is it's easier to keep track of overrides that way, and theoretically anytime windows needs to make a change bc of an upstream change, the same tooling should tell us that win32 needs a change. |
(Somehow missed this message till now) Thanks! I'll update with both of those things. |
EDIT: Looks like I have most of my issues with this PR fixed, but I still am not getting hover events :( . I'm not sure how to attach a debugger in this repo properly or if I need a devmain enlisted machine for things to behave properly. I understand the windows team is out for the holidays, so I'll pick this up and figure out who to bug to answer my questions when people are more available :D |
New year, new ping! Would someone help me understand why the lint check is failing? The types it's complaining about definitely exist.. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Looks like its complaining about some of the Key events not being on view? That type exists on the windows fork of CoreEventTypes, but not any win32 fork of that file. |
Right, I did fork the CoreEvent types to win32 as well with my last commit (which includes Am I correct to assume that react-native-win32 doesn't also inherit overrides from react-native-windows, so any overrides from Core you want to do would need to be done twice? |
Yes, any overrides need to be done for win32 and windows separately. Did you add the Key types to view.win32.js too? Just adding the types to CoreEventTypes wouldn't do anything unless they were added to view. |
Ah, that's probably it. Looking at it, I probably want to use EDIT: Actually, I'll copy the overrides from |
I added key types to View.win32.js, and also forked ViewPropTypes.win32.js, but I'm still seeing the same errors. I'm not sure why flow doesn't think the types exists. I think I've overridden everything properly.. |
@Saadnajmi looking at the error, I think the Flow type checker might be using the non |
Looks like that was it! Thank you =) |
* Port windows Pressable override to win32 * Change files * Add override * lint fix * More overrides, more windows comments * Change files * fix overrides * Add win32 to HoverState * Overrride types maybe? * Add keyboarding types to View.win32.js * override ViewPropTypes.win32.js * fix flowconfig
* Port windows Pressable override to win32 * Change files * Add override * lint fix * More overrides, more windows comments * Change files * fix overrides * Add win32 to HoverState * Overrride types maybe? * Add keyboarding types to View.win32.js * override ViewPropTypes.win32.js * fix flowconfig
* Port windows Pressable override to win32 * Change files * Add override * lint fix * More overrides, more windows comments * Change files * fix overrides * Add win32 to HoverState * Overrride types maybe? * Add keyboarding types to View.win32.js * override ViewPropTypes.win32.js * fix flowconfig
* Port windows Pressable override to win32 * Change files * Add override * lint fix * More overrides, more windows comments * Change files * fix overrides * Add win32 to HoverState * Overrride types maybe? * Add keyboarding types to View.win32.js * override ViewPropTypes.win32.js * fix flowconfig
* Port windows fork of Pressable to win32 (#9132) * Port windows Pressable override to win32 * Change files * Add override * lint fix * More overrides, more windows comments * Change files * fix overrides * Add win32 to HoverState * Overrride types maybe? * Add keyboarding types to View.win32.js * override ViewPropTypes.win32.js * fix flowconfig * Update overrides * yarn lint:fix
* Port windows fork of Pressable to win32 (#9132) * Port windows Pressable override to win32 * Change files * Add override * lint fix * More overrides, more windows comments * Change files * fix overrides * Add win32 to HoverState * Overrride types maybe? * Add keyboarding types to View.win32.js * override ViewPropTypes.win32.js * fix flowconfig * update overrides * fix changefiles * yarn lift:fix * update overrides * fix lint error
* Port windows fork of Pressable to win32 (#9132) * Port windows Pressable override to win32 * Change files * Add override * lint fix * More overrides, more windows comments * Change files * fix overrides * Add win32 to HoverState * Overrride types maybe? * Add keyboarding types to View.win32.js * override ViewPropTypes.win32.js * fix flowconfig * redo overrides from windows fork * yarn lint:fix * update overrides * fix lint issue
* Port windows fork of Pressable to win32 (#9132) * Port windows Pressable override to win32 * Change files * Add override * lint fix * More overrides, more windows comments * Change files * fix overrides * Add win32 to HoverState * Overrride types maybe? * Add keyboarding types to View.win32.js * override ViewPropTypes.win32.js * fix flowconfig * redo overrides from windows fork * yarn lint:fix + some lines I forgot to copy * move to other path * validate-overrides * yarn lint:fix again * forgot some props * move one more file * lint:fix once more
Description
Type of Change
Why
Copy the windows port of Pressable to win32. This port adds extra desktop functionality like keyboard focus state and mouse hover state support. This is primarily so that FluentUI React Native can use Pressable downstream, and remove it's own copy of Pressability (microsoft/fluentui-react-native#743).
What
What changes were made to the codebase to solve the bug, add the functionality, etc. that you specified above.
I simply wholesale copied
Pressable.windows.js
toPressable.win32.js
, along with the PressableExample page in rn-tester. I also added two lines to the test to test that onHoverIn/onHoverOut are indeed registered.Screenshots
Testing
Added test pages for Pressable, which is also a copy of the windows one.
Microsoft Reviewers: Open in CodeFlow