feat: Enable New Architecture with react-native.config.js#2091
feat: Enable New Architecture with react-native.config.js#2091TMisiukiewicz wants to merge 4 commits intoreact-native-community:mainfrom
Conversation
| '(this may take a few minutes)', | ||
| )}`, | ||
| ); | ||
|
|
There was a problem hiding this comment.
💡We can add here a log that New Architecture is enabled.
|
Q - How is this going to play with: |
|
@cortinico we could read this data from the manifest if present. Small feat to add, once we settle on the proposal. And since this is still a draft, we can align the API to mimic the one presented in the |
|
btw I'm not even sure that the RFC is in shape right now, wasn't it supposed to get re-written once again? |
Yes, I have to do it, but I have higher priority tasks to run first. However, I'm not a fan of having the same settings in multiple places. As soon as the RFC land, that should be the only place where user can enable/disable the new architecture. All other places and ways to set it should then be ignored. So, consider that when working on this feature. Part of the work you are doing could need to be removed later on. |
Summary:
Currently, to enable New Architecture, there is a need of running
RCT_NEW_ARCH_ENABLED=1 pod install. This change introduces new param in config file:project.ios.newArchEnabledwhich forces to run app with a given architecture. This change is caused by enabling pods installation inrun-iosandbuild-ioscommands (#2077) - currently, if someone ranRCT_NEW_ARCH_ENABLED=1 pod installand then added a package with native code, the script would disable New Arch. This PR allows to:Pods.xcodeproj/project.pbxprojproject.ios.newArchEnabledfield. In case anyone change the architecture by using a RCT_NEW_ARCH_ENABLED flag and the param in config is set, it will install the pods accordingly to the Architecture set in the configTest Plan:
run-iosand check if project ran correctlyRCT_NEW_ARCH_ENABLED=1 pod installandrun-iosand verify iffabric: truein Metro consolereact-native.config.jswith the following content:run-iosand verifyfabric: trueis not visible in Metro logstrueand runrun-iosagain - verifyfabric: trueis visible in Metro logsreact-native-gesture-handlerto the projectrun-iosagain, let the pods install and verifyfabric: trueis set in the Metro logspod installiniosfolder and runrun-iosagain, verify that pods are installed again andfabric: trueis visible in Metro logsChecklist