fix(android): update nitrogen-generated code to CxxPart/JavaPart pattern#169
Open
hamdij0maa wants to merge 1 commit intorive-app:mainfrom
Open
fix(android): update nitrogen-generated code to CxxPart/JavaPart pattern#169hamdij0maa wants to merge 1 commit intorive-app:mainfrom
hamdij0maa wants to merge 1 commit intorive-app:mainfrom
Conversation
Update the nitrogen-generated Android code to use the newer Nitro Modules API with CxxPart/JavaPart inner classes instead of the legacy HybridClass pattern. This fixes compatibility with recent versions of react-native-nitro-modules (0.22+). Changes across 68 files: - All HybridSpec.kt files: Replace manual HybridData/initHybrid with CxxPart inner class - All JHybridSpec.hpp files: Migrate from HybridClass to JavaPart/CxxPart structs - All JHybridSpec.cpp files: Update JNI implementations, replace javaClassStatic() calls - JVariant/JResolvedReferencedAsset: Update javaobject refs to JavaPart - JHybridRiveViewStateUpdater: Update view references for new pattern - riveOnLoad: Add registerAllNatives(), deprecate initialize(), add Impl factories - cpp-adapter.cpp: Use facebook::jni::initialize with registerAllNatives
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.
Summary
CxxPart/JavaPartinner classes instead of the legacyHybridClasspatternreact-native-nitro-modules(0.35.0)registerAllNatives()entry point and deprecates the oldinitialize()functionChanges
Kotlin (20 files)
All
HybridXxxSpec.ktfiles updated:HybridData/initHybrid()/updateNative()boilerplateCxxPartinner class andcreateCxxPart()overrideC++ Headers (20 files)
All
JHybridXxxSpec.hppfiles updated:jni::HybridClass<JHybridXxxSpec, JHybridObject>toJavaPart/CxxPartstruct patternJavaPartreferencegetExternalMemorySize(),equals(),dispose(),toString()(now handled by base class)_javaParttype fromjavaobjecttoJavaPartC++ Implementations (20 files)
All
JHybridXxxSpec.cppfiles updated:JavaPart::getJHybridXxxSpec()factory methodCxxPart::initHybrid(),CxxPart::createHybridObject(),CxxPart::registerNatives()javaClassStatic()->with_javaPart->javaClassStatic()->Other files (8 files)
JVariant_*andJResolvedReferencedAsset: Updated::javaobjectreferences to::JavaPartJHybridRiveViewStateUpdater: Updated view reference pattern for new APIriveOnLoad.hpp/cpp: AddedregisterAllNatives(), deprecateinitialize(), addedImplfactory structscpp-adapter.cpp: Usefacebook::jni::initializewithregisterAllNatives()Context
The current nitrogen-generated code uses an older Nitro Modules pattern that is incompatible with
react-native-nitro-modulesv0.22+. The newCxxPart/JavaPartpattern is the current standard used by the nitrogen code generator. This can alternatively be fixed by re-running the nitrogen code generator against the current version.Test plan