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
446 stars 19 forks source link

`excludedPackages` doesn't work #27

Open nahn20 opened 8 months ago

nahn20 commented 8 months ago

Findings

I ran two tests to determine that excludedPackages isn't working. Both using react-native-skia which is known to have a significant iOS bundle size of ~5.8 MB. Resulting bundle sizes are determined using App Thinning Size Report.txt as recommend by Apple.

Test 1

Including "@shopify/react-native-skia" in excludedPackages yields an uncompressed size of 27.7 MB. Removing it yields the same uncompressed size of 27.7 MB

Test 2

As in the previous test, including "@shopify/react-native-skia" in excludedPackages yields an uncompressed size of 27.7 MB. I uninstall @shopify/react-native-skia completely and got an uncompressed bundle size of 21.8 MB. According to Shopify, the JavaScript bundle is only supposed to account for 220 KB (and likely 0 KB in our case given that it was never imported). So the size discrepancy is almost definitely due to properly removed native code.

Additional Note

ios/Pods/Podfile generates correctly with "@shopify/react-native-skia" being included in exclude.

david-arteaga commented 8 months ago

btw I've tested with v0.1.4 and excludedPackages does work as expected. I archived a build without any packages in that list -- got about 55MB Then added a bunch of packages in our project to excludedPackages, archived again -- got about 26MB

So the issue may have been introduced after v0.1.4