Repository navigation
refactor: generate codegen in the app instead of shipping it - #1121
Open
hryhoriiK97 wants to merge 1 commit into
Open
hryhoriiK97 wants to merge 1 commit into
hryhoriiK97 wants to merge 1 commit into
Conversation
The package shipped codegen output generated with the RN version it was published with (includesGeneratedCode). Newer RN can change what that code calls, as the 0.89 nightly did by deprecating the invokeJavaMethod overload the shipped Java TurboModule glue used, so the code now comes from the app's own codegen run, matching its RN version. - package.json: drop includesGeneratedCode, outputDir and the bob codegen target. - Android: CMake reads the RN Gradle plugin's build/generated/source/codegen output; the plugin adds the generated Java sources itself. Removes the temporary -Wno-error=deprecated-declarations flag. - iOS: import generated headers from the app's ReactCodegen pod (react/renderer/components/EnrichedMarkdownTextSpec/...), drop the ios/generated header path and exclude any leftover ios/generated. Co-authored-by: Cursor <cursoragent@cursor.com>
hryhoriiK97
marked this pull request as ready for review
November 2, 2026 11:06
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What/Why?
Follow-up to #1119, which is a temporary fix.
The package shipped codegen output (
includesGeneratedCode: true), generated with the RN version it was publishedwith. Newer RN can change what that code calls: the 0.89 nightly deprecated the
invokeJavaMethodoverload ourshipped Java TurboModule glue used (facebook/react-native#59619),
which broke the Android nightly build. With this change the app generates the code with its own RN version, so
codegen changes in RN can no longer break the shipped code.
includesGeneratedCode,outputDirand the bobcodegentarget.build/generated/source/codegen/jni; the plugin adds thegenerated Java sources itself, so
generated/*comes out ofbuild.gradle. Removes the temporary-Wno-error=deprecated-declarationsflag from fix(android): build against RN nightly's deprecated invokeJavaMethod overload #1119.ReactCodegenpod(
react/renderer/components/EnrichedMarkdownTextSpec/...) instead of our own pod. The podspec drops theios/generated/ReactCodegenheader path and excludes any leftoverios/generated.Consumers don't need to do anything: the app's build already runs codegen for libraries that don't ship it.
Testing
:app:assembleDebugon RN 0.88ReactCodegencontainsEnrichedMarkdownTextSpec)react-native@nightlyEnrichedMarkdownParser)use_frameworks!/ Expo prebuildUnrelated: plain
assembleDebugfails in:display-benchmarkonmaintoo (BlockSlotMeasureSession.hnot on itsinclude path since #1027).
PR Checklist