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

[asset] Add config plugin to link assets to native project #27052

Merged
merged 5 commits into from
Feb 29, 2024

Conversation

alanjhughes
Copy link
Collaborator

@alanjhughes alanjhughes commented Feb 12, 2024

Why

Closes ENG-11315

How

Added a config plugin to expo-asset that allows adding assets to the native project.
Supports json, png, jpg, mp3, mp4, off, ttf, db, gif, lottie.

Test Plan

Created a test project and added various asset types. Some of our libraries currently don't support reading from the native project.
expo-av: iOS only
expo-image: iOS only
expo-sqlite: iOS and android
I'll work on these in separate PRs

Screenshot 2024-02-12 at 12 10 15

Copy link

linear bot commented Feb 12, 2024

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Feb 12, 2024
@alanjhughes alanjhughes force-pushed the @alanhughes/assets/plugin branch from 3527e89 to a4a47d0 Compare February 12, 2024 12:23
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Feb 12, 2024
@alanjhughes alanjhughes marked this pull request as ready for review February 12, 2024 12:48
packages/expo-asset/plugin/src/utils.ts Outdated Show resolved Hide resolved
packages/expo-asset/plugin/src/utils.ts Outdated Show resolved Hide resolved
packages/expo-asset/plugin/src/utils.ts Show resolved Hide resolved
packages/expo-asset/plugin/src/withAssets.ts Show resolved Hide resolved
packages/expo-asset/plugin/src/withAssetsAndroid.ts Outdated Show resolved Hide resolved
packages/expo-asset/plugin/src/withAssetsIos.ts Outdated Show resolved Hide resolved
packages/expo-asset/plugin/src/withAssetsIos.ts Outdated Show resolved Hide resolved
@alanjhughes
Copy link
Collaborator Author

@tsapeta @wschurman - Spoke with @brentvatne and we are going to exclude fonts from this because expo-font has this and we need to handle differences in how both OSs refer to fonts

Copy link
Member

@wschurman wschurman left a comment

Choose a reason for hiding this comment

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

Feel pretty strongly that we shouldn't do that any cast, especially because it's in first-party code and now there are multiple places that do it. I think if you want to fix it in a follow-up PR though, that's fine.

@alanjhughes
Copy link
Collaborator Author

Added dotLottie files to the supported extensions. Also, used Doug's suggestion for the any cast

@alanjhughes alanjhughes merged commit 4f6ec30 into main Feb 29, 2024
14 checks passed
@alanjhughes alanjhughes deleted the @alanhughes/assets/plugin branch February 29, 2024 11:57
@brentvatne brentvatne added the published Changes from the PR have been published to npm label Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: fingerprint compatible bot: passed checks ExpoBot has nothing to complain about published Changes from the PR have been published to npm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants