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


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


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


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


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


# 72841a14 20-Sep-2022 Łukasz Kosmaty <[email protected]>

[modules][Android] Fix modules aren't created after reload (#19176)

# Why

A follow-up to https://github.com/expo/expo/pull/18844 and https://github.com/expo/expo/pull/18823.
It turns out that th

[modules][Android] Fix modules aren't created after reload (#19176)

# Why

A follow-up to https://github.com/expo/expo/pull/18844 and https://github.com/expo/expo/pull/18823.
It turns out that the recently added fix breaks the reload behavior. Right now, when you hard reload your app, modules won't be installed, because the `mModulesProxy` isn't recreated.

# How

Made sure that the module proxy is recreated after reloading.
Added some debug logs.

> Note:
There are still some problems when someone reloads the app multiple times.

# Test Plan

- unit tests ✅
- bare-expo ✅
- expo-go ✅

show more ...


# 57cd185a 30-Aug-2022 Kudo Chien <[email protected]>

[core] Decouple jsc or hermes runtime lib on Android (#18899)

# Why

the expo-modules-core links hermes or jsc to create a js runtime, however the call flow is only for android instrumented test.

[core] Decouple jsc or hermes runtime lib on Android (#18899)

# Why

the expo-modules-core links hermes or jsc to create a js runtime, however the call flow is only for android instrumented test. the test code increases build time as well as introducing the lib dependency to hermes/jsc and then breaks v8 support.
fix https://github.com/Kudo/react-native-v8/issues/134

# How

- Use `UNIT_TEST` preprocessor for the test code.
- change `FOR_HERMES -> USE_HERMES`

# Test Plan

- bare-expo
- `./gradlew :expo-modules-core:connectedAndroidTest` in `android`. this is running instrumented test on jsc
- `./gradlew :expo-modules-core:connectedAndroidTest` in `apps/bare-expo/android`. this is running instrumented test on hermes
- unzip the apk and use `objdump -x /path/to/libexpo-modules-core.so` to make sure there's no hermes or jsc dependency.

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


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


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


# 5e5e73a5 30-May-2022 Łukasz Kosmaty <[email protected]>

[core][Kotlin] Add more tests to cover jni functionalities (#17657)

# Why

Adds more tests to cover jni functionalities


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