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

[New Lib] Add expo-image to E/App #32751

Closed
roryabraham opened this issue Dec 8, 2023 · 11 comments
Closed

[New Lib] Add expo-image to E/App #32751

roryabraham opened this issue Dec 8, 2023 · 11 comments
Assignees
Labels
AutoAssignerAppLibraryReview Auto assign someone to review a new library being added to App Weekly KSv2

Comments

@roryabraham
Copy link
Contributor

In order to properly evaluate if a new library can be added to package.json, please fill out this request form. It will be automatically assigned someone from our review team that will go through and vet the library.

Note: This is only for production dependencies. While we don't want people to add packages to dev-dependencies willy-nilly, we recognize that there isn't as great of a need there to secure them.

Name of library:

expo-image

Details

  • Link to package: https://www.npmjs.com/package/expo-image

  • Problem solved by using this package:

    • It provides a major boost in performance for the loading of svg assets (i.e: most images in NewDot). See PR.
    • It allows HEIC images to be displayed on Android
    • It allows us to stop use of our "deeply nested fork" of react-native-image-manipulator. This is a fork 8 times removed from the original source code
    • It's more actively maintained than react-native-fast-image (another 3rd party library we're currently using which this will replace)
    • Supports caching headers for images across platforms (like react-native-fast-image)
  • Number of stars in GH: It's in the expo monorepo, which has 25k stars. expo-image comes strongly recommended by all our expert partners.

  • Number of monthly downloads: ~300,000

  • Number of releases in the last year: ~50, 26 stable versions

  • Level of activity in the repo: high

  • Alternatives: react-native-fast-image

  • Are security concerns brought up and addressed in the library's repo?

    difficult to answer as it's in a monorepo. Here's an example of a security-related issue, but I don't think it's really related to expo-image: [email protected] | mid/high vulnerabilities expo/expo#22404

  • How many dependencies does this lib use that will be brought into our code?

    The major dependency that will be added into our code by expo-image is the expo-modules core. It's a small (178kb unbundled) shim that wraps the app's main activity and app delegate to provide:

    • standard support for swift and kotlin in React Native
    • cross-compatibility between React Native New Arch and OldArch
    • Consistent interface for web support
  • What will the effect be on the bundle size of our code?

    We can test to double-check, but I think it will be about +715kb

@roryabraham roryabraham added Weekly KSv2 AutoAssignerAppLibraryReview Auto assign someone to review a new library being added to App labels Dec 8, 2023
Copy link

melvin-bot bot commented Dec 8, 2023

Current assignee @mountiny is eligible for the AutoAssignerAppLibraryReview assigner, not assigning anyone new.

Copy link

melvin-bot bot commented Dec 8, 2023

New Library Review

  • Are all the answers in the main description filled out properly and make sense?
  • Who maintains the library and how well is it maintained?
  • How viable are the alternatives?
  • Should we build it ourselves instead?

Once these questions are answered, start a thread in #engineering-chat, ping the @app_deployers group, and call for a vote to accept the new library. Once the vote is complete, update this issue with the outcome and procede accordingly. Here is a sample post:

Hey @app_deployers,

There is a request to add a new library to App that we need to consider. Please look at this GH and then vote :+1: or :-1: on accepting this new library or not.

GH_LINK

@roryabraham
Copy link
Contributor Author

Lots of extra context in this thread. I encourage you to read before making your decision.

@roryabraham
Copy link
Contributor Author

Didn't know how this would work. Removing @mountiny as he's already advocated for the additon of expo-image, and will re-add the label for a more impartial reviewer

@roryabraham roryabraham added AutoAssignerAppLibraryReview Auto assign someone to review a new library being added to App and removed AutoAssignerAppLibraryReview Auto assign someone to review a new library being added to App labels Dec 8, 2023
Copy link

melvin-bot bot commented Dec 8, 2023

Triggered auto assignment to @AndrewGable (AutoAssignerAppLibraryReview), see https://stackoverflowteams.com/c/expensify/questions/17737 for more details.

Copy link

melvin-bot bot commented Dec 8, 2023

New Library Review

  • Are all the answers in the main description filled out properly and make sense?
  • Who maintains the library and how well is it maintained?
  • How viable are the alternatives?
  • Should we build it ourselves instead?

Once these questions are answered, start a thread in #engineering-chat, ping the @app_deployers group, and call for a vote to accept the new library. Once the vote is complete, update this issue with the outcome and procede accordingly. Here is a sample post:

Hey @app_deployers,

There is a request to add a new library to App that we need to consider. Please look at this GH and then vote :+1: or :-1: on accepting this new library or not.

GH_LINK

@roryabraham
Copy link
Contributor Author

@AndrewGable pointed out @mrousavy's recent post on X: https://x.com/mrousavy/status/1733467869109768275?s=20

Definitely a relevant opinion from a developer we know and respect

@roryabraham
Copy link
Contributor Author

Also worth pointing out that the current plan in Video Player design doc is to use expo-av, which will have to wrap the app with the Expo Module core anyways.

I think we can agree that is the main, if not the only downside to using Expo image. To me that suggests that the main downside of expo-image is a moot point / going to happen anyways. So let's push this forward and start reaping the performance benefits

@roryabraham
Copy link
Contributor Author

We can give it 24 hours to make sure every app deployer has a chance to look and react, but it looks like we have a majority 👍🏼 on the slack post with 9 out of the 17 app deployers giving a 👍🏼

Also, point of clarification for next time - it's unclear to me whether the vote is meant to include the few ring0 people from the GitHub team that don't actively participate in the chore. If no, then the threshold for a majority would be 8 people instead of 9.

@mrousavy
Copy link
Member

mrousavy commented Dec 12, 2023

Hey - thanks for linking that tweet (was a bit controversal) - my opinion is that expo-image is great for displaying web images, as it uses the native SDWebImage library under the hood, which is really good at caching. That's the same lib that react-native-fast-image uses.

expo-image is however well maintained, which react-native-fast-image currently is not. It also has better recycling/virtualization support when displaying a lot of images.

I'd say expo-image is the way to go if the expo-modules setup code isn't a problem for you guys! 👍

(Also, I think the expo team is working on making that setup code smaller, so I think it's the right horse to bet on)

@roryabraham
Copy link
Contributor Author

It looks like we have a clear consensus in slack to add expo-image to E/App, so I'm going to close this. Thanks for leading the discussion @AndrewGable and to everyone for participating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoAssignerAppLibraryReview Auto assign someone to review a new library being added to App Weekly KSv2
Projects
None yet
Development

No branches or pull requests

4 participants