Commit Graph
20 Commits
Author SHA1 Message Date
Marc RousavyandGitHub b9ce7462a3 fix: Add additional nullptr check to make_shared_from_jni function (#584)
* fix: Add additional nullptr check to `make_shared_from_jni` function

* fix: Allow move `&&` and forward

* Update JNISharedPtr.hpp

* fix: Add copy ctor

* fix: Avoid `emplace` if there can be duplicates

* Update JNISharedPtr.hpp

* fix: Don't call `release()` on global_ref!

* fix: Use `const &` to keep it lvalue

* Also check `cthis()`
2025-02-24 18:09:50 +01:00
Marc Rousavy 4733b4e4ea perf: Use .find(..) for cache lookups 2025-02-24 17:15:20 +01:00
Marc RousavyandGitHub 4d07b2a1d5 feat: Create Sync<T> to pass fully synchronous JS callbacks (#564)
* feat: Create `Sync<T>`

* Return

* Make it return number

* feat: Add `isSync` check...

* check

* Impl

* feat: Add `JSCallback`

* perf: Store `Dispatcher` in cache if really missed

* I think it builds now

* fix memory

* fix: Use `isAsync`

* Rename

* fix: Impl `callHybridFunction` again

* fix: Avoid forward decl

* Docs

* feat: Cache `regex` in `NitroTypeInfo`

* Update NitroTypeInfo.cpp

* perf: Make `Dispatcher` a `weak_ptr`

* Some formating

* fix: Fix styling in Benchmarks

* feat: Test if callbackSync returns same number

* fix: Fix warning in `toString()`

* Update Sync.ts

* perf: Allow `std::forward<...>`
2025-02-23 15:59:01 +01:00
Marc RousavyandGitHub 2ebff1b4a5 fix: Reject Promise with timeout if it gets destroyed (#444)
* fix: Reject Promise with timeout if it gets destroyed

If a Promise gets destroyed without ever being resolved or rejected, it goes stale.

This PR fixes this and rejects a Promise with a timeout error if it gets destructed and is still pending

* Add promise typename

* Reject swift promise as well

* Update Promise.hpp

* fix: Build

* Update Dispatcher.cpp

* fix: Also reject `JPromise` if it gets destroyed
2024-12-22 13:53:24 +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 b4592244f2 feat: AnyMap for Kotlin/Android (#60)
* feat: Create `JAnyMap` base

* Update JNIOnLoad.cpp

* feat: Create `AnyMap` methods

* fix: Fix wrong name & format

* feat: `setNull`

* log dimmed

* Update README.md
2024-08-27 18:02:39 +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 Rousavy 882054e587 feat: Support JSIConverter<AnyMap>::canConvert (+ AnyValue and unordered_map<string, T>) 2024-08-07 13:56:10 +02:00
Marc Rousavy 9d69ba04ab chore: Run clang format 2024-07-31 17:39:56 +02:00
Marc Rousavy 404b125b8f fix: Kinda builds? 2024-07-30 13:31:22 +02:00
Marc Rousavy e6f84bee16 fix: Fix JS callbacks not using Dispatcher!!!!!
lol this broke a lot I cant believe I didnt catch this
2024-07-30 12:17:22 +02:00
Marc Rousavy 4adc79dcfc Rename to GetRuntimeID 2024-07-18 00:22:49 +02:00
Marc Rousavy f6853f7055 feat: Log runtime thread ID 2024-07-18 00:20:56 +02:00
Marc Rousavy 7bc2767348 fix: Move to namespace margelo::nitro 2024-07-17 21:49:11 +02:00
Marc Rousavy a6b69b309a perf: Speed up Dispatcher get calls 2024-06-23 12:27:04 +02:00
Marc Rousavy 2bc02c0f6f A ton of improvements around jsi::Runtime safe code. 2024-06-20 16:20:13 +02:00
Marc Rousavy caf953f552 fix imports 2024-06-20 10:47:50 +02:00
Marc Rousavy 84b995e4eb Rename to .hpp 2024-06-20 10:41:09 +02:00
Marc Rousavy b7f40384e1 Add Dispatcher 2024-06-19 19:59:03 +02:00