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
504 stars 25 forks source link

Skipping Dependencies For App Clip Target #7

Closed Ross-Landry closed 1 year ago

Ross-Landry commented 2 years ago

Hi, first of all - thank you so much for creating this config-plugin!

I have been able to build an app clip for my Expo app with it. However, I am over the accepted size limit.

Have you been able to remove certain dependencies for the app clip target? For example, an npm package that the main app uses and the app clip does not.

At the moment my app clip shares all the same dependencies as the main project.

Ross-Landry commented 2 years ago

I'm considering trying something like this: https://github.com/react-native-community/cli/issues/1179#issuecomment-756539463

twicemeDev commented 1 year ago

We have the same problem. Did you manage to get it to work? @Ross-Landry

alexreyes commented 1 year ago

Chiming in, I also have the same problem. Do you have any ideas @bndkt?

(I'll keep trying to separate the dependencies, and I'll provide update when I figure it out.)

Ross-Landry commented 1 year ago

@twicemeDev @alexreyes I did not (yet) find a solution for this.

I will be interested to hear if anyone is able to do it!

I am hopeful that expo-router might eventually solve this problem. @EvanBacon has hinted that expo-router might facilitate app-clips.

Ross-Landry commented 1 year ago

https://expo.github.io/router/docs/future

Bundle splitting: Unlike the web, native has the ability to ship Hermes bytecode, meaning bundle splitting would not have very drastic savings for most screens. We can implement this in the background later when web is a priority. Bundle splitting should make certain size-limited targets like App Clips (limited to 15mb) more powerful as you could dynamically load pages, but this is not a priority for v1.

bndkt commented 1 year ago

This has been implemented (at least for manual exclusion) with the latest release: https://bndkt.com/blog/2023/react-native-app-clip-new-capabilities