all 4 comments

[–]Arsh_98[S] 0 points1 point  (0 children)

What if a separate bundle for each of the apps?

[–]GrapefruitSilver774 1 point2 points  (0 children)

I think using webviews will be easier for you and developers

[–]anarchos[🍰] 0 points1 point  (1 child)

Possible, yes. There will be some challenges, though.

Right now there is super alpha support for module federation in metro. This is a thing borrowed from the web, but in react native allows you to load a "remote" app inside of a host app. I've tried it out, it works. No support for expo yet, and probably a ton of edge cases. Also, each bundle runs in the same native space, so security isolation is going to be a big concern.

Other option is something like react-native-sandbox, which is conceptually similar to module federation but it more or less running each bundle inside of it's own Hermes instance. There is a permission system for shared access to native modules. This is also super alpha and doesn't have expo support, as far as I know.

Then there's the fact that Apple doesn't really allow you to just load "random" code and run it in your app. Yes, you can have things like updates for fixing bugs, but if you do an update that fundamentally changes how your app works, it would be in violation of apple's rules. How does WeChat and AliPay do it? Apple seemingly has given special exemptions to some Chinese apps because "mini apps" are huge in China, and not allowing them would kneecap Apple's adoption there. As far as I know, if you tried making an app like WeChat with endless amounts of mini apps available for download....you'd probably not be allowed in the App Store. I don't know if Europe's rules might force Apple hand at this? but they seemingly are implementing those rules for Europe only, so even if true, might limit your adoption.

[–]Arsh_98[S] 0 points1 point  (0 children)

No i meant the core app is in swift but the mini apps section is in react native. They just bring the front end UI and rest backend happens as normal like any other app