History log of /expo/packages/expo-modules-core/android/src/main/cpp/JavaScriptRuntime.h (Results 1 – 13 of 13)
Revision Date Author Comments
# 12cf8561 21-Sep-2023 lukmccall <[email protected]>

[core][Android] Fix failing instrumental tests


# 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 ...


# 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 ...


# 879827bb 06-Apr-2023 Łukasz Kosmaty <[email protected]>

[core][Android] Add functions converter (#21976)

# Why

Adds functions converter.

# How

- Adds a frontend and backend converter for js function type
- Adds ability to call those functions

[core][Android] Add functions converter (#21976)

# Why

Adds functions converter.

# How

- Adds a frontend and backend converter for js function type
- Adds ability to call those functions via Kotlin code

# Test Plan

- unit tests ✅

show more ...


# dedc0ffd 29-Sep-2022 Łukasz Kosmaty <[email protected]>

[modules][Android] Install modules host object as `global.expo.modules` instead of `global.ExpoModules` (#19281)

# Why

A follow-up to https://github.com/expo/expo/pull/19273.

# How

- Added

[modules][Android] Install modules host object as `global.expo.modules` instead of `global.ExpoModules` (#19281)

# Why

A follow-up to https://github.com/expo/expo/pull/19273.

# How

- Added `global.expo` object to the runtime.
- Installed the Expo Modules host object as `global.expo.modules`.
- Deprecated `global.ExpoModules`, which will still exist in SDK47 for one-cycle backward compatibility. It can be removed in SDK48.
- Migrated references to `global.ExpoModules` in native unit tests

# Test Plan

- unit test ✅
- NCL ✅

show more ...


# 256b5942 27-Jul-2022 Łukasz Kosmaty <[email protected]>

[sweet API][Kotlin] Simplify usage of `JavaScriptRuntime` (#18382)

# Why

In many places, we have a similar code that accesses the `jsi::Runtime` from `weak_ptr`. It makes the code hard to read. S

[sweet API][Kotlin] Simplify usage of `JavaScriptRuntime` (#18382)

# Why

In many places, we have a similar code that accesses the `jsi::Runtime` from `weak_ptr`. It makes the code hard to read. So I decided to decorate the `std::weak_ptr<JavaScriptRuntime>` with additional access functions.

# How

Added a `WeakRuntimeHolder` with two additional methods to access `jsi::Runtime`

# Test Plan

- unit tests ✅

show more ...


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

[sweet API][Kotlin] Set up a test environment for async flow (#17943)

# Why

Sets up a test environment to work with async functions.

# How

- Implemented a basic `CallInvoker` that automati

[sweet API][Kotlin] Set up a test environment for async flow (#17943)

# Why

Sets up a test environment to work with async functions.

# How

- Implemented a basic `CallInvoker` that automatically calls the received function.
- Mocked `setImmediate ` function that is needed by Hermes `Promise` implementation.
- Exports a `global` object to the js.

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 ...


# 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 ...


# 14c0f05d 31-May-2022 Łukasz Kosmaty <[email protected]>

[sweet API][Kotlin] Add `JavaScriptObject.setProperty` (#17684)

# Why

Adds `setProperty` to the `JavaScriptObject`.

# How

- Adds a base interface to indicate if the derived class wrap a jsi

[sweet API][Kotlin] Add `JavaScriptObject.setProperty` (#17684)

# Why

Adds `setProperty` to the `JavaScriptObject`.

# How

- Adds a base interface to indicate if the derived class wrap a jsi::Value or jsi::Object.
- Adds a conversion between JNI and jsi objects based on the type traits.
- Hides raw JNI API in the `JavaScriptObject` using methods overload.
- Adds unit tests

# 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 ...