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

chore: upgrade react-native-gesture-handler to v2 #3440

Merged
merged 6 commits into from
Feb 13, 2023

Conversation

kathaypacific
Copy link
Collaborator

Description

We mostly don't need to use this dependency directly. I think that we were using some components from there because of auto import suggestions, in this PR i updated the touchables to be used from either the Touchable component or from react native directly. Also simplified some styles along the way.

This is a good one to upgrade because it removes the dependency on RNGestureHandlerEnabledRootView which was causing conflicts while upgrading react native.

Test plan

Tested all the changes manually. Relying on CI to check the rest.

Related issues

Backwards compatibility

Y

@emerge-tools
Copy link

emerge-tools bot commented Feb 10, 2023

📏 Size Analysis

Total install size 60.3 MB | This change: ⬆️ +103.4 kB (+0.172%)

Image of diff

🗂 See size breakdown
Item Install size
main.jsbundle 🔺 57.3 kB
RNGestureHandler.framework/Code Signature 🔺 2.3 kB
➕ RNGestureHandler.framework/RNGestureHandlerPointerTracker.Objc Metadata 🔺 1.7 kB
RNGestureHandler.framework/RNGestureHandler.Objc Metadata 🔺 1.2 kB
RNGestureHandler.framework/DYLD.String Table 928 B
➕ RNGestureHandler.framework/RNGestureHandlerManager.registerViewWithGestureRecognizerAttachedIfNeeded: 914 B
➕ RNGestureHandler.framework/RNBetterSwipeGestureRecognizer.Objc Metadata 907 B
➕ RNGestureHandler.framework/RNGestureHandlerPointerTracker.extractPointerData:forTouch: 775 B
➕ RNGestureHandler.framework/RNManualActivationRecognizer.Objc Metadata 774 B
RNGestureHandler.framework/External Methods 714 B
➕ RNGestureHandler.framework/RNGestureHandlerModule.setGestureState:forHandler: 666 B
➕ RNGestureHandler.framework/RNGestureHandlerPointerTracker.touchesBegan:withEvent: 597 B
➕ RNGestureHandler.framework/RNGestureHandlerEventExtraData.forPosition:withAbsolutePosition:withNumberOfTouches:withDuration: 595 B
➕ RNGestureHandler.framework/RNGestureHandlerModule.flushOperations 593 B
➕ RNGestureHandler.framework/RNGestureHandlerPointerTracker.touchesMoved:withEvent: 581 B
➕ RNGestureHandler.framework/RNGestureHandlerPointerTracker.touchesEnded:withEvent: 576 B
➕ RNGestureHandler.framework/RNManualRecognizer.Objc Metadata 553 B
➕ RNGestureHandler.framework/RNFlingGestureHandler.eventExtraData: 506 B
➖ RNGestureHandler.framework/RNGestureHandlerManager.registerRootViewIfNeeded: 505 B
➕ RNGestureHandler.framework/RNBetterRotationRecognizer.Objc Metadata 503 B

🔎 See the full size analysis (ab529f8) merging into main (c717cb7)

@codecov
Copy link

codecov bot commented Feb 10, 2023

Codecov Report

Merging #3440 (ab529f8) into main (c717cb7) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3440   +/-   ##
=======================================
  Coverage   81.08%   81.08%           
=======================================
  Files         650      650           
  Lines       22888    22885    -3     
  Branches     4126     4126           
=======================================
- Hits        18559    18557    -2     
+ Misses       4267     4266    -1     
  Partials       62       62           
Impacted Files Coverage Δ
src/components/BottomSheet.tsx 81.81% <100.00%> (-0.54%) ⬇️
src/components/TokenBottomSheetLegacy.tsx 92.30% <100.00%> (-0.15%) ⬇️
src/fiatExchanges/FiatExchangeCurrency.tsx 73.58% <100.00%> (-0.49%) ⬇️
src/onboarding/registration/PictureInput.tsx 89.74% <100.00%> (ø)
...tions/feed/detailContent/RewardReceivedContent.tsx 93.10% <100.00%> (ø)
src/tokens/utils.ts 100.00% <0.00%> (+2.17%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c717cb7...ab529f8. Read the comment docs.

@@ -48,13 +48,6 @@ export default offRamps = () => {
await waitForElementId('RNWebView')
await expect(element(by.text('Bidali'))).toBeVisible()
})

// TODO(tomm) debug why this is failing on Android
it(':ios: Then should not be able to spend CELO', async () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed this test because it was failing and i don't think it works as intended - i was surprised to find that it's not straighforward to test if a button is disabled using detox because detox only has access to native elements (not JS ones). wix/Detox#3203

this was previously passing because celoRadioButton returns a native element which doesn't have any property called enabled. i think that e2e tests are better for testing flows rather than display state, so i didn't feel too bad about moving this test into the FiatExchangeCurrency unit test. wdyt @MuckT ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Moving this to a unit test is the right choice in my opinion. Anything we can test on a lower test level we should. LGTM!

Copy link
Member

@jeanregisser jeanregisser left a comment

Choose a reason for hiding this comment

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

Awesome! 👍
I'm curious what @MuckT thinks about the e2e test case.

@kathaypacific kathaypacific enabled auto-merge (squash) February 13, 2023 08:54
@kathaypacific kathaypacific merged commit 048099c into main Feb 13, 2023
@kathaypacific kathaypacific deleted the kathy/upgrade-gesture branch February 13, 2023 12:02
satish-ravi added a commit that referenced this pull request Mar 1, 2023
### Description

This was added to fix a vulnerability
(#418). This package is
sub-dependency of react-native-gesture-hander@v1. Since upgrading v2
(#3440), this is no longer
needed.

### Test plan

CI

### Related issues

N/A

### Backwards compatibility

Yes

Co-authored-by: Tom McGuire <[email protected]>
@valora-inc valora-inc deleted a comment from linear bot Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants