Page MenuHomePhabricator

[native] Migrate from react-native-fast-image to expo-image
ClosedPublic

Authored by ashoat on Mar 22 2023, 5:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 8, 1:37 AM
Unknown Object (File)
Fri, Mar 8, 1:37 AM
Unknown Object (File)
Thu, Mar 7, 9:01 PM
Unknown Object (File)
Thu, Mar 7, 9:01 PM
Unknown Object (File)
Feb 27 2024, 2:59 PM
Unknown Object (File)
Feb 23 2024, 10:33 AM
Unknown Object (File)
Feb 23 2024, 10:31 AM
Unknown Object (File)
Feb 23 2024, 9:11 AM
Subscribers

Details

Summary

More context in ENG-3379.

I wasn't able to get expo-image to compile alongside react-native-fast-image due to conflicting Pod dependencies on SDWebImage, so I just went with a wholesale replacement.

Test Plan

Here's how I tested:

  1. Open up iOS simulator and Android emulator
  2. Send message from iOS to Android. Confirm it renders on both sides, ideally without any transition delay on the sending side between local and remote URIs
  3. Same as 3 but from Android to iOS
  4. Make sure image copy still works on iOS (we use SDWebImage directly in patches/@react-native-clipboard+clipboard+1.11.1.patch)

I did all of these steps once with dev buils on iOS / Android, and another again with release builds for both.

Then, separately, I was able to confirm that it could render an SVG data URI on iOS / Android and in dev / release modes using this patch.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Done testing!! I think this is safe to land. I haven't tested blurhash or SVG / data URI support yet, but those are things that react-native-fast-image can't handle today anyways

Just tested and it looks like this solves rendering SVG data URIs for us!! I haven't tested other types, but PNG, JPEG, and SVG are all listed as supported in the docs. Thanks @bartek for the tip! This is way better than what I had planned to do on Android.

Just tested and it looks like this solves rendering SVG data URIs for us!! I haven't tested other types, but PNG, JPEG, and SVG are all listed as supported in the docs. Thanks @bartek for the tip! This is way better than what I had planned to do on Android.

That's great news! I'll patch this and test if it works with my decrypted image data too

It seems to work with all data URIs too!

Also, I was able to quickly set up some example blurhash (hardcoded for now) and display it while images are being decrypted.

Screenshot 2023-03-23 at 06.34.25.png (938×602 px, 459 KB)

This revision is now accepted and ready to land.Mar 22 2023, 11:10 PM