History log of /expo/packages/expo-modules-core/android/src/main/cpp/JSIInteropModuleRegistry.h (Results 1 – 12 of 12)
Revision Date Author Comments
# db6683c6 19-Aug-2023 Kudo Chien <[email protected]>

[core][dev-menu] fix react-native 0.73 compatibility [2/3] (#24019)

# Why

fix react-native 0.73 compatibility. this pr focus on react-native 0.73 breaking changes.

# How

- [core] fix compat

[core][dev-menu] fix react-native 0.73 compatibility [2/3] (#24019)

# Why

fix react-native 0.73 compatibility. this pr focus on react-native 0.73 breaking changes.

# How

- [core] fix compatibility of `NativeMethodCallInvoker` renaming: https://github.com/facebook/react-native/commit/b70f186b53
- [dev-menu] fix compatibility of `RCTAppDelegate` changes.
- [core] fix ios runtime crash from [upstream change](https://github.com/facebook/react-native/blob/540c41be9/packages/react-native/React/Views/RCTComponentData.m#L506-L507)
- [core] fix android build error because BOOST_VERSION is removed from `gradle.properties`

# Test Plan

ci passed in #23961 (https://github.com/expo/expo/pull/23961/checks)

show more ...


# b702c83d 26-Jul-2023 Łukasz Kosmaty <[email protected]>

[core][Android] Add `CoreModule` defining the `global.expo` object (#23654)

# Why

This a follow-up to the https://github.com/expo/expo/pull/22567.
Closes ENG-8810.

# How

We want the `globa

[core][Android] Add `CoreModule` defining the `global.expo` object (#23654)

# Why

This a follow-up to the https://github.com/expo/expo/pull/22567.
Closes ENG-8810.

# How

We want the `global.expo` object to be automatically built and decorated. The best and easiest approach is to introduce the `CoreModule` that will live outside the module registry but will be used to build the object for `global.expo`.

# Test Plan

- automatic tests ✅
- bare-expo ✅

show more ...


# 29e8b6f8 25-May-2023 Łukasz Kosmaty <[email protected]>

[core][Android] Bind `JNIDeallocator` to the context (#22610)

# Why

Binds the `JNIDeallocator` to the current context.

# How

I've discovered that making `JNIDeallocator` static wasn't a go

[core][Android] Bind `JNIDeallocator` to the context (#22610)

# Why

Binds the `JNIDeallocator` to the current context.

# How

I've discovered that making `JNIDeallocator` static wasn't a good decision. This approach failed to function properly when we migrated to our API in the dev-launcher context. Whenever the user switches between the app and launcher, the app will crash since the dev-launcher remains in memory, but the app context's destruction causes all registered objects inside the `JNIDeallocator` to deallocate. Consequently, we're removing js objects associated with the dev-launcher context, even if it's still valid.

# Test Plan

- bare-expo with and without dev-client ✅
- unit tests ✅

show more ...


# ecb7f347 29-Mar-2023 Łukasz Kosmaty <[email protected]>

[core][Android] Introduce shared object (#21855)

# Why

This's a follow-up to https://github.com/expo/expo/pull/17514.

# How

- Added a shared object registry
- Run a native constructor if

[core][Android] Introduce shared object (#21855)

# Why

This's a follow-up to https://github.com/expo/expo/pull/17514.

# How

- Added a shared object registry
- Run a native constructor if present when creating a js class
- Added a shared object with its js representation to the registry
- Added a converter for shared object

# TODO

- [ ] call native destructor when class is deallocated
- [ ] use weak refs to hold js objects in the registry

# Test Plan

- unit tests ✅

show more ...


# b627df43 21-Mar-2023 Łukasz Kosmaty <[email protected]>

[core][Android] Make module initialization lazy (#21774)

# Why

This approach guarantees that module functions and properties are only initialized upon user request. When the module is required by

[core][Android] Make module initialization lazy (#21774)

# Why

This approach guarantees that module functions and properties are only initialized upon user request. When the module is required by JavaScript, it does not automatically mean that all of its members will be added at that moment. Instead, they will be added at a later time, as needed.

# How

Added `LazyObject` abstraction as it was done on iOS.
Used an arbitrary js object instead of HostObject to define modules - it'll be handy in the future when I'll be adding shared classes.

# Test Plan

- unit tests ✅
- bare-expo ✅

show more ...


# b7d1787d 12-Aug-2022 Łukasz Kosmaty <[email protected]>

[sweet API] Cache PropNameID and js objects (#18579)

# Why

Adds a cache for prop name IDs and js objects like `Promise` or `CodedError`.

# How

- Added a cache registry
- Added missing tr

[sweet API] Cache PropNameID and js objects (#18579)

# Why

Adds a cache for prop name IDs and js objects like `Promise` or `CodedError`.

# How

- Added a cache registry
- Added missing try catch in the async function

# Test Plan

- unit tests ✅

show more ...


# a89667b6 23-Jun-2022 Łukasz Kosmaty <[email protected]>

[sweet API][Kotlin] Add method to drain event loop (#17938)

# Why

Adds a method to drain even loop from Kotlin.

# How

Exposes a `drainMicrotasks` function from `JSI`.
This function is ver

[sweet API][Kotlin] Add method to drain event loop (#17938)

# Why

Adds a method to drain even loop from Kotlin.

# How

Exposes a `drainMicrotasks` function from `JSI`.
This function is very handy when you're trying to test async flows.

show more ...


# 78b3dbc7 13-Jun-2022 Łukasz Kosmaty <[email protected]>

[sweet API][Kotlin] Export property names in the expo modules host object (#17836)

# Why

Makes sure that `getPropertyNames` function inside `ExpoModulesHostObject` works.

# How

Exports all

[sweet API][Kotlin] Export property names in the expo modules host object (#17836)

# Why

Makes sure that `getPropertyNames` function inside `ExpoModulesHostObject` works.

# How

Exports all modules names.

# Test Plan

- NCL and `ExpoModules` screen ✅

show more ...


# 6095fdc7 31-May-2022 Łukasz Kosmaty <[email protected]>

[sweet API][Kotlin] Remove references to invokers in `JSIInteropModuleRegistry` (#17688)

# Why

The invokers were stored in two places - in the `JSIInteropModuleRegistry` and in the `JavaScriptRun

[sweet API][Kotlin] Remove references to invokers in `JSIInteropModuleRegistry` (#17688)

# Why

The invokers were stored in two places - in the `JSIInteropModuleRegistry` and in the `JavaScriptRuntime`. It doesn't look like a clean solution. So I've decided to make the `JavaScriptRuntime` class the only place which stores those references.

# How

Removed invokers from `JSIInteropModuleRegistry`.

# Test Plan

- unit tests ✅

show more ...


# 342f32d0 31-May-2022 Łukasz Kosmaty <[email protected]>

[sweet API][Kotlin] Add `JavaScriptRuntime.createObject` (#17687)

# Why

Adds `JavaScriptRuntime.createObject`

# How

Adds a simple method to create an empty object without running `evaluateS

[sweet API][Kotlin] Add `JavaScriptRuntime.createObject` (#17687)

# Why

Adds `JavaScriptRuntime.createObject`

# How

Adds a simple method to create an empty object without running `evaluateScript`.

# Test Plan

- unit tests ✅

show more ...


# a416e6db 24-May-2022 Łukasz Kosmaty <[email protected]>

[sweet][Kotlin] Add `evaluateScript` function (#17586)

# Why

Adds a `evaluateScript` function.
Also, adds wrappers for `jsi::Value` and `jsi::Object`.

# How

Exposes a `evaluateScript` fun

[sweet][Kotlin] Add `evaluateScript` function (#17586)

# Why

Adds a `evaluateScript` function.
Also, adds wrappers for `jsi::Value` and `jsi::Object`.

# How

Exposes a `evaluateScript` function to Kotlin (it's pretty handy in the tests environment). I've also created a wrapper for jsi types. For now, it's read-only, but that will be expanded in the future.

# Test Plan

- unit tests ✅

show more ...


# 64f5c95f 17-May-2022 Łukasz Kosmaty <[email protected]>

[module-core][Kotlin] Add basic support for sync function (#16977)

# Why

Closes ENG-4608.
Adds basic support for sync function.

# How

- Created ExpoModulesHostObject that installs into the

[module-core][Kotlin] Add basic support for sync function (#16977)

# Why

Closes ENG-4608.
Adds basic support for sync function.

# How

- Created ExpoModulesHostObject that installs into the runtime as `global.ExpoModules`. A host object is an abstract object where we can define our property getter, allowing us to create JS object for each module lazily.
- Added `isAsync` property to sweet functions and `runSynchronously()` modifier - that will be changed in the future.
- Created `JavaScriptModuleObject` that represents a module in the JS world. It has a map of methods with a cached body.
- All the communication goes via two kotlin methods - `getJavaScriptModuleObject` (which returns a hybrid representation of the module) and `callMethodSync` (which is calling correct implementation). Right now, I'm not using lambdas to pass Kotlin functions into CPP, because I don't see any reason why should I.

# Test Plan

- tested with bare-expo ✅

show more ...