Releases: mrousavy/nitro
Releases · mrousavy/nitro
Release 0.35.0
0.35.0 (2026-03-04)
❗️ Breaking Change
#1238 is the first breaking change after >1 year in Nitro. Unfortunately it is necessary, as it fixes a critical memory leak in Kotlin HybridObjects.
- For app developers: Try upgrading to Nitro 0.35.x and attempt a build. If it fails due to anything looking like
super.updateNative(...),JHybridObject,HybridBase, orAnyMapHolder, the Nitro library you are using needs to update to Nitro 0.35.x as well and re-generate their specs. Swift and C++ libraries will work fine, only Kotlin HybridObjects have a breaking change. - For library authors: Upgrade to Nitro 0.35.x (and nitrogen 0.35.x), and re-generate your specs. Follow these steps to migrate your library:
- Re-generating specs will automatically make your library compatible and implements the
JHybridObjectchange. - If you use
bigintin your specs, replace it with eitherInt64orUInt64:See #1212 for more information.interface Math extends HybridObject<...> { - calculateFibonacci(n: bigint): bigint + calculateFibonacci(n: UInt64): UInt64 } - Replace your JNI initialization (
cpp-adapter.cpporJNIOnLoad.cpp) with this:JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { - return margelo::nitro::$$androidNamespace$$::initialize(vm); + return facebook::jni::initialize(vm, []() { + margelo::nitro::$$androidNamespace$$::registerAllNatives(); + }); }
- Re-generating specs will automatically make your library compatible and implements the
🐛 Bug Fixes
Release 0.35.0-beta.0
0.35.0-beta.0 (2026-03-03)
❗️ Breaking Change
I think the change in JHybridObject is breaking. I will test (and potentially improve) this before making 0.35.0 stable.
Library authors need to re-generate their specs to support 0.35.0 onwards.
🐛 Bug Fixes
- Don't strip
HybridSomeExternalObject(f9da753) - Fix Kotlin HybridObject
jni::global_refmemory leak by separatingCxxPartwithweak_ptr(#1238) (32a4c86), closes #1239
📚 Documentation
Release 0.34.1
Release 0.34.0
0.34.0 (2026-02-26)
❗️ JNI OnLoad (cpp-adapter.cpp) change
For library authors: In your JNI OnLoad function (often in cpp-adapter.cpp), you should migrate to the new initialization API:
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
- return margelo::nitro::$$androidNamespace$$::initialize(vm);
+ return facebook::jni::initialize(vm, []() {
+ margelo::nitro::$$androidNamespace$$::registerAllNatives();
+ });
}Nothing really changes if you don't register any custom native JNI classes/functions, and it will also not break if you don't migrate. But it is recommended either way, as this new API allows you to create custom C++ native JNI classes/functions and register them.
✨ Features
- Add
createNativeArrayBuffer(size)to NitroModulesProxy (#1226) (c2b4ba4) - Add lambda argument for custom JNI registrations in
initialize…(...)(#1222) (8dde8b8)
🐛 Bug Fixes
- Fall back to
ByteBuffercopy ifHardwareBuffercopy fails (513a50b) - Fix
has*/is*property names being simplified on Swift/Kotlin (#1223) (47e867d) - Fix AnyMap
canConvertto check values instead of keys (#1163) (23cccba) - Rename
initialize()toregisterAllNatives()to be more aligned with fbjni (#1225) (3d4070b) - Test both C++ and Swift/Kotlin Test Objects with Harness (#1224) (c3d7839)
- Throw if
HardwareBuffer-backedArrayBufferis non-CPU-readable (#1227) (63aa30c) - Use
AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTENinstead ofAHARDWAREBUFFER_USAGE_CPU_WRITE_MASK(044b7fd)