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

Brand new build has a really large bundle size #40

Open
calebpanza opened this issue Jun 19, 2024 · 7 comments
Open

Brand new build has a really large bundle size #40

calebpanza opened this issue Jun 19, 2024 · 7 comments

Comments

@calebpanza
Copy link

Hey there!

I'm working on implementing an App Clip on an existing project and figured I would give this package a try!

Before doing so on my existing app, I tested it out on a brand new Expo SDK 51 project. When trying to deploy it to TestFlight for testing, I was declined due to the Clip being over 15mb.

After testing over and over again, I continue to discover that the uncompressed size (through the App Size Report generated in Xcode) is over 9mb. When using an app that includes Expo Router, the size is over 14mb. The project only has a single JS file in it.

I'm hoping that I'm just doing something wrong on my end and would love to know if it's just me or if this issue is able to be replicated by others?

@yefim
Copy link

yefim commented Jul 11, 2024

try setting your deploymentTarget to "17.0". This will increase the size limit to 50mb

@calebpanza
Copy link
Author

This is great! Thanks for the suggestion. I'll check this out, for sure!

@pdyby
Copy link

pdyby commented Jul 24, 2024

I've done everything to try and minimise the bundle size but the smallest I can get the App Clip is 16mb 😭
The last thing I tried was switching from Yarn to NPM. This could make a difference for someone who is close to getting below the 15mb limit.
I use AWS Cognito which is quite a large library so it makes it hard to get below 15mb, even after reducing the library size by over 75% by tweaking the imports.

@pdyby
Copy link

pdyby commented Aug 30, 2024

try setting your deploymentTarget to "17.0". This will increase the size limit to 50mb

Be aware that if your app is > 15mb, you can't open it by scanning a QR code! With this target set.

@pdyby
Copy link

pdyby commented Aug 30, 2024

This is great! Thanks for the suggestion. I'll check this out, for sure!

What JS Engine are you using? I was using hermes and my App Clip was 16mb. I switched to JSC and it is now below 12mb! 😄

@calebpanza
Copy link
Author

That's really interesting! I could try that. Unfortunately, this project is requiring that we qualify for use of the QR codes

@nathan-ahn
Copy link
Collaborator

I'd recommend avoiding any large packages like AWS's Cognito when trying to create a minimal App Clip. As a personal anecdote, I've previously switched authentication providers instead of trying to support Cognito's massive size requirements on web. App Clip size limitations would be similar.

If you're trying to optimize your bundle size for an existing application, I'd recommend checking out the new .clip extension added in v0.5.0 which allows you to remove heavy components or other large files from the App Clip bundle. However, this won't do much for the boilerplate application bundle size issues.

Hopefully, an implementation of #1 can help with this issue.

My current recommendation is to bite the bullet of > 15 MB and switch to minimum iOS 17. If that's not an option, then you'll likely need to hyper-optimize the size of your App Clip by just writing it entirely natively.

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

4 participants