Remove REACT_NATIVE_MINOR_VERSION build flag - #4422
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
💤 Files with no reviewable changes (3)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe native integrations no longer parse or pass React Native minor versions. Android uses C++20 and React Native compile options unconditionally. Runtime ShadowNode conversion always uses the current bridging API. ChangesVersion-independent native integration
Possibly related PRs
Merge Risk: ⚪ Minimal · up to The PR removes an unused build flag and corrects Android compile-option setup; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR removes the REACT_NATIVE_MINOR_VERSION build flag across Apple/Android build tooling and simplifies the runtime C++ code accordingly, while also fixing Android’s JNI CMakeLists.txt so target_compile_reactnative_options is correctly applied to the gesturehandler target (matching ReactAndroid’s compile flags).
Changes:
- Removed
REACT_NATIVE_MINOR_VERSIONusage from runtime code and build scripts (podspec/Gradle/CMake). - Fixed Android JNI CMake to include
react-native-flags.cmakeand applytarget_compile_reactnative_optionsto the correct target afterfind_package(ReactAndroid). - Standardized the Android JNI CMake C++ standard selection to C++20.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/react-native-gesture-handler/shared/runtime/RNGHRuntimeDecorator.cpp | Removes now-unnecessary RN-minor conditional compilation around shadow node bridging. |
| packages/react-native-gesture-handler/scripts/gesture_handler_utils.rb | Deletes Ruby helpers used solely to discover RN minor version for build flags. |
| packages/react-native-gesture-handler/RNGestureHandler.podspec | Drops -DREACT_NATIVE_MINOR_VERSION=... from OTHER_CFLAGS. |
| packages/react-native-gesture-handler/android/src/main/jni/CMakeLists.txt | Removes RN-minor-based flag/standard logic; correctly wires react-native-flags.cmake + target_compile_reactnative_options for the JNI target. |
| packages/react-native-gesture-handler/android/build.gradle | Removes parsing/exposing of RN minor version and stops passing it into the native build. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Description
This PR removes the
REACT_NATIVE_MINOR_VERSIONbuild flag and fixes thetarget_compile_reactnative_optionscall in the AndroidCMakeLists.The only consumer of
REACT_NATIVE_MINOR_VERSIONwas a >= 81 check inRNGHRuntimeDecorator.cpp, which is always true on supported react-native versions. If a version check becomes necessary in the future, react-native ships<cxxreact/ReactNativeVersion.h>with theREACT_NATIVE_VERSION_MINORmacro, available on all platforms and build systems.The
target_compile_reactnative_optionsblock added in #3688 never executed: it ran beforefind_package(ReactAndroid)definesReactAndroid_VERSION_MINOR, referenced an undefinedLIB_TARGET_NAME, and was missing the include ofreact-native-flags.cmakethat defines the function. This PR fixes it to match how reanimated and worklets use it. Note that this applies RN_SERIALIZABLE_STATE and HERMES_V1_ENABLED=1 to our JNI target for the first time, matching how ReactAndroid itself is built.Test plan