Page MenuHomePhabricator

[native] Update to react-native-clipboard@1.11.1
ClosedPublic

Authored by ashoat on Nov 3 2022, 7:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 24, 11:49 AM
Unknown Object (File)
Sun, Nov 24, 11:49 AM
Unknown Object (File)
Fri, Nov 22, 8:33 AM
Unknown Object (File)
Fri, Nov 22, 8:33 AM
Unknown Object (File)
Fri, Nov 22, 8:33 AM
Unknown Object (File)
Fri, Nov 22, 8:32 AM
Unknown Object (File)
Fri, Nov 22, 8:31 AM
Unknown Object (File)
Wed, Nov 20, 5:03 PM
Subscribers

Details

Summary

As part of ENG-614, I ran npx @rnx-kit/dep-check --set-version 0.69.6 on the advice of React Native Upgrade Helper. That script directed me to update react-native-clipboard.

Test Plan
  1. I ran the app on my iOS Simulator and made sure ImageModal's copy function still worked
    • This was the only use case I could find of the patch-package'd methods
  2. I made sure Clipboard.setString still worked
    • The other use cases were for this method from the original library
    • I tested one of the use cases (copy message text) to make sure the method still worked
  3. I ran through the release notes
    • Didn't see anything of note

Note that in-app paste wasn't working in the iOS Simulator, but that's not handled by this library. I think that is actually an Apple issue.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ashoat requested review of this revision.Nov 3 2022, 7:34 PM

After upgrading Expo, we might consider migrating to expo-clipboard, which has full support for images and formatted text. We would no longer need the patch.

Note that in-app paste wasn't working in the iOS Simulator, but that's not handled by this library. I think that is actually an Apple issue.

This issue is known for a long time, I encountered it when I was revamping expo-clipboard and they still haven't fixed it.

After upgrading Expo, we might consider migrating to expo-clipboard, which has full support for images and formatted text. We would no longer need the patch.

Generally open to that, but important to note that our current implementation has two advantages:

  1. Allows copy of image without needing any traffic across the React Native bridge (uses URL as identifier)
  2. Pulls image from the same cache that react-native-fast-image uses to render the image (SDWebImage)

However, worth noting that it only works on iOS today.

This revision is now accepted and ready to land.Nov 7 2022, 6:59 AM