Commit Graph
10 Commits
Author SHA1 Message Date
Marc RousavyandGitHub baed798c3e feat: Create React Native ViewManager (+ Props + State) for HybridViews (#500) 2025-01-20 16:40:15 +01:00
Marc RousavyandGitHub 03e1a716cf fix: Fix NITRO_DEBUG debug/release preprocessor directive (#132)
* fix: Use `NITRO_DEBUG` flag to predictably run debug/release code

* feat: Add `NitroModules.buildType`

* fix: Style `debug` label
2024-09-16 16:18:05 +02:00
Marc RousavyandGitHub 3d4455eaa8 feat: Add support for ArrayBuffer in Kotlin Nitro Modules (#55)
* fix: More all Java files into `.core`

* fix: Remove unused `_runtime` member in `JSICache`

* feat: Create `JArrayBuffer`

* feat: Crate `JArrayBuffer` from both ways

* feat: Implement bidirectional `ArrayBuffer` for Kotlin

* Update JArrayBuffer.hpp

* fix: Fix include

* fix: Fix non-direct buffers

* Update README.md
2024-08-20 18:10:10 +02:00
Marc RousavyandGitHub e7b9f412eb fix: Rewrite Logger to use platform NSLog / __android_log_print (#54)
* fix: Fix wrong include..?

* fix: Reimplement NitroLogger as a platform-specific logger

* fix: Copy args, and use proper tag

* fix: Fix sprintf crash because of wrong format argument

* fix: Fix Logger usage on iOS
2024-08-20 16:20:44 +02:00
Marc RousavyandGitHub acca5baaa4 fix: Replace #if DEBUG with #ifndef NDEBUG to make it work on Android (#53)
* fix: Fix `hasNativeState` checks and provide better errors

* fix: Replace `#if DEBUG` with `#ifndef NDEBUG` to make it work on Android
2024-08-20 15:30:03 +02:00
Marc RousavyandGitHub 0dd63227d8 fix: Fix Swift umbrella header includes (#19)
* feat: Try bridge more Swift

* Make all Promises `async` in swift

* Rename `Promise` to `JSPromise`

* Update JSPromise.hpp

* Update JSICache.cpp

* fix import

* fix: Init props

* fix: Remove AnyMap and ArrayBuffer apis for now

* fix import

* no more async? idk

* feat: Convert `std::optional<T>` to `swift::Optional<T>`

* Remove all funcs except hello

* fix: Generate Swift Umbrella header

* fix: Organize

* fix: Hardcode forward-decl

* feat: Properly generate umbrella header from known types

* fix: Fix indentation

* order

* feat: Try bridging some primitives over...

* Update NitroDefines.hpp

* Update Property.ts

* fallthrough looks better

* better error

* fix: Fix wrong enum `maxLength`

* feat: Try `CarSwift` experiment

* Revert "feat: Try `CarSwift` experiment"

This reverts commit 7794f38271.
2024-08-12 14:18:13 +02:00
Marc RousavyandGitHub c101faf948 feat: Cache toObject(...) using jsi::WeakObject and correctly set externalExternalMemoryPressure (#13)
* feat: Cache `toObject(...)` using `jsi::WeakObject` and set `externalMemoryPressure` properly

* feat: Support caching different JSI types - strongly typed
2024-08-08 12:28:33 +02:00
Marc RousavyandGitHub 86c3702ffc feat: Make HybridObject a NativeState (#11)
* feat: Make `HybridObject` a `NativeState`

* feat: Get `NativeState` inside `callMethod(...)`, no more passing `this*`

* Update HybridObject.hpp

* fix: Convert NativeState to `jsi::Value` again

* Use `Object.create`

* fix broken test

* feat: Add `__type` hidden state to objects

* chore: Format

* `makeGlobal` -> `makeShared`

* feat: Extract to `HybridObjectPrototype`

* Update HybridObject.hpp

* feat: Properly build Prototype chain

* Cache prototypes

* fix: Fix prototype caching

* Extract to separate file

* fix: Some comments

* chore: Format

* feat: Freeze prototypes

* Remove freeze

* feat: Optimize `NativeState` performance, make it 56x faster (#12)

* fix: Fix `HybridFunction` usage

* Update HybridFunction.hpp

* mark final

* feat: Add new `registerHybrids(...)` API

* fix: Remove logs

* perf: Make `registerHybrids` faster by using function pointer instead of `std::function<...>`

* fix: Turn off memory allocations debugger

* refactor

* Format

* fix: Fix cyclic includes for `JSIConverter+HybridObject`

* DO_NULL_CHECKS

* fix: Use `jsi::Value` directly to avoid down and up casting again

* Add `__type` to `HybridObject` declaration

* feat: Throw `jsi::JSError` again

* feat: Add prototype tests

* feat: Set `__type` on Prototypes as well

* Delete PointerHolder.hpp

* Delete `JSIPrototypeCache`

* fix: Use `jsi::Value` directly
2024-08-08 11:39:17 +02:00
Marc Rousavy 882054e587 feat: Support JSIConverter<AnyMap>::canConvert (+ AnyValue and unordered_map<string, T>) 2024-08-07 13:56:10 +02:00
Marc Rousavy 0b7e2b5561 fix: Fix JSICache<T> being recreated each time because of C++ template specialization 2024-08-06 01:37:08 +02:00