You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a RN library that was shipping the generated artifacts using RN 0.76. When I tried to add it to a RN 75 I started getting this compilation error:
This is confusing as it is on the generated code. I stumbled for hours trying to re-generate everything but nothing helped. I then tried to update the app to 76 and it magically started working. I tried to revert back to 75 but it kept working.
I then started googling trying to see if the problem was my package and gratuitously landed on this page
It finally dawned on me I had the "includesGeneratedCode": true set. This is the default used by react-native-builder-bob. So, I was shipping the generated code which, contrary to what's described on that page, it cannot be true to be guaranteed stable across RN versions. What's the entire point of codegen if it will be generated against one specific version?!
I'm on the process of disabling the flag and shipping only the source files so codegen happens on build time of the app but I'm just trying to understand if I'm holding it wrong or what's mentioned on the page is just not true
I don't know if you can confidently ship this feature. I know it's not necessarily fault of the codegen cli but rather the template but at least to me it seems stability across versions CANNOT be guaranteed, right?
The text was updated successfully, but these errors were encountered:
The other problem I have is now, the instructions to disable this read:
Update your package.json to include the generated code.
Update your podspec to include the generated code.
Update your build.Gradle file to include the generated code.
Update cmakeListsPath in react-native.config.js so that Gradle doesn't look for CMakeLists file in the build directory but instead in your outputDir.
Uhm... update to what exactly? What do I need to put on react-native-config.js? Leave it empty? And the podspec? And build.gradle?
Description
I have a RN library that was shipping the generated artifacts using RN 0.76. When I tried to add it to a RN 75 I started getting this compilation error:
This is confusing as it is on the generated code. I stumbled for hours trying to re-generate everything but nothing helped. I then tried to update the app to 76 and it magically started working. I tried to revert back to 75 but it kept working.
I then started googling trying to see if the problem was my package and gratuitously landed on this page
https://reactnative.dev/docs/the-new-architecture/codegen-cli#including-generated-code-into-libraries
It finally dawned on me I had the
"includesGeneratedCode": true
set. This is the default used by react-native-builder-bob. So, I was shipping the generated code which, contrary to what's described on that page, it cannot be true to be guaranteed stable across RN versions. What's the entire point of codegen if it will be generated against one specific version?!I'm on the process of disabling the flag and shipping only the source files so codegen happens on build time of the app but I'm just trying to understand if I'm holding it wrong or what's mentioned on the page is just not true
I don't know if you can confidently ship this feature. I know it's not necessarily fault of the codegen cli but rather the template but at least to me it seems stability across versions CANNOT be guaranteed, right?
The text was updated successfully, but these errors were encountered: