bndkt / react-native-app-clip

Easily add an App Clip for iOS apps built with React Native
https://bndkt.com/blog/2022/react-native-app-clip
482 stars 22 forks source link

Brand new build has a really large bundle size #40

Open calebpanza opened 3 months ago

calebpanza commented 3 months ago

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 commented 2 months ago

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

calebpanza commented 2 months ago

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

pdyby commented 2 months ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 4 weeks ago

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