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

Expo Config Plugin (Custom Dev Client) #18

Open
hirbod opened this issue Jan 6, 2022 · 4 comments
Open

Expo Config Plugin (Custom Dev Client) #18

hirbod opened this issue Jan 6, 2022 · 4 comments

Comments

@hirbod
Copy link

hirbod commented Jan 6, 2022

If anybody want to use this package with an expo custom dev client and eas:

// create a file like plugins/withAnimatedWebPSupport.js

const {
    createRunOncePlugin,
    withGradleProperties
} = require('@expo/config-plugins');

const withAnimatedWebPSupport = (config) => {

    const propertyToModify = {
        type: 'property',
        key: 'expo.webp.animated',
        value: true,
    };

    return withGradleProperties(config, (config) => {
        config.modResults = config.modResults.filter(
            (item) => !(item.type === propertyToModify.type && item.key === propertyToModify.key)
        );

        config.modResults.push(propertyToModify);

        return config;
    });
};

module.exports = createRunOncePlugin(withAnimatedWebPSupport, 'animated-webp-support', '1.0.0');

And import like that in your app.json / app.config.js (expo.plugins)

    ['./plugins/withAnimatedWebPSupport'],

iOS will work OOTB after installing the pod. I also have a FastImage Implementation if anyone is interested.

@ggepenyan
Copy link

@hirbod can you please provider fastimage implementation? I use Expo and really miss that. Also is there any way to do it without custom client? I just need to add webp image support for the ios 12-13. has webp support for all devices instead ios 12-13. Thanks in advance.

@hirbod
Copy link
Author

hirbod commented Mar 29, 2022

@ggepenyan sure, here is my implementation:
https://gist.github.com/hirbod/07c6641970c9406ff35a7271dda1f01c

You can't do it without a custom dev client though, it is mandatory (and I really recommend to free you from limitations of Expo Go. I love Expo but I also need that little extra freedom, specially for such cases)

@hasanfd
Copy link

hasanfd commented Jun 26, 2022

Hello @hirbod, thanks for the fantastic work!
I managed to run animated webps with Expo finally.

@hirbod
Copy link
Author

hirbod commented Jun 26, 2022

I am using it with FastImage, but you're right, they play faster as the actually are. Haven't digged into that

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

No branches or pull requests

3 participants