React Native is a mess [ep.1]
January 30th, 2023

I guess im able to write a series of example when React Native going really crazy

Golden Foundation

Episode 1: lib React Native Firebase for iOS and “use_frameworks”

from github issue

If anyone is looking, I could/should note that "the use_frameworks issue" is a few things at once.

If I understand, the permutations possible are like this:

F-D (Frameworks Dynamic) == use_frameworks! or use_frameworks! :linkage => :dynamic (they are the same? supposed to be the same
F-S (Frameworks Static) == use_frameworks! :linkage => :static

RN-O (React-native Old architecture)
RN-N (Reacct-native New architecture)

F+ (Flipper enabled)
F- (Fillper disabled)

H+ (Hermes enabled)
H- (Hermes disabled)

And note that it needs to be checked for debug and release configurations, and ideally for macCatalyst as well - 4 permutations of each one!

So, it's quite a few permutations and each has unique problems.

👀 In react-native <= 0.68.2, F-D/RN-O/F-/H- worked, in react-native > 0.68.2 this combo breaks. That's the regression.

First get the regression(s) nailed down

F-D/RN-O/F-/H- (Fix current so hack not needed: 0.64 stable new template fails when using use_frameworks! facebook/react-native#31149 (comment))
https://github.com/mikehardy/rnfbdemo/blob/51ef9f125d67b599854de81764b9451514a5608e/make-demo.sh#L279
F-D/RN-O/F-/H- (Fix regression in 0.69)
Then, and the reason I've taken the time to specify all the permutations, it would be great to solve these things in priority order:

F-D/RN-N/F-/H- (Fix New Arch: basically, making sure it works in new arch too, otherwise there is no future at all...)
F-D/RN-?/F-/H+ (Fix Hermes: Hermes is a big selling point, it's a shame to disable it...)
F-D/RN-?/F+/H? (Fix Flipper: Disabling Flipper, which will be the future debug state from what I understand, is a bummer)
F-S/??? (static linkage: seems to work without hermes and flipper at least)
There are unique issues for each one

1- has a podfile workaround for codegen so RN <= 0.68 will build
2- header inclusion issues it appears? this is the current / new regression
3- no idea what new architecture will need, have not tried

4- Hermes has a couple issues
4a- has a header thing? https://stackoverflow.com/a/70111404/9910298 - I had experimental success with this I think
4b- obscure linker error:

❌ Undefined symbols for architecture x86_64
❌   "_jump_fcontext", referenced from:
❌   "_make_fcontext", referenced from:
❌ ld: symbol(s) not found for architecture x86_64
5- Flipper includes two statically linked libraries, so dynamic linkage doesn't work, it fails during pod install

[!] The 'Pods-rnfbdemo' target has transitive dependencies that include statically linked binaries: (Flipper-Boost-iOSX and Flipper-RSocket)`
6a- F-S/RN-O/F+/H- Static linkage with Flipper makes it past pod install but has header issue

❌ /Users/mike/work/Invertase/rnfbdemo/rnfbdemo/node_modules/react-native/React/AppSetup/RCTAppSetupUtils.mm:27:9: 'FlipperKit/FlipperClient.h' file not found
#import <FlipperKit/FlipperClient.h>
6b- F-S/RN-O/F-/H+ builds and runs debug config, but then the Header component of default new app screen does not show Hermes enabled? 🤔 (verified that without use_frameworks! Hermes does show the little hermes engine thing in the app)

So by my count we've got at least 8 different issues, and likely similar to 4a workaround then uncovering 4b there may be some more.

This feels like the thing that should be tracked with an umbrella issue and sub-issues somewhere...
Subscribe to GMessier
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.
More from GMessier

Skeleton

Skeleton

Skeleton