react-native-app-clip icon indicating copy to clipboard operation
react-native-app-clip copied to clipboard

`excludedPackages` doesn't work

Open nathan-ahn opened this issue 2 years ago • 2 comments

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.

nathan-ahn avatar Oct 11 '23 21:10 nathan-ahn

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

david-arteaga avatar Oct 20 '23 16:10 david-arteaga

Going to experiment, but I think there's a good chance this issue is related to this commit.

nathan-ahn avatar Jul 31 '24 00:07 nathan-ahn

This issue only affects non-Expo modules. Expo modules are correctly handled with use_expo_modules's exclude field, but non-Expo modules are going to require a custom implementation.

nathan-ahn avatar Nov 23 '24 22:11 nathan-ahn

Fixed in #50.

nathan-ahn avatar Nov 24 '24 18:11 nathan-ahn