expo-modules-core 58.0.20 → 58.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/android/build.gradle +2 -2
- package/android/prebuilt/metadata.json +2 -2
- package/android/prebuilt/native-libs.tar.xz +0 -0
- package/android/src/main/cpp/worklets/Serializable.h +1 -1
- package/android/src/main/cpp/worklets/Worklet.cpp +1 -1
- package/common/cpp/JSI/JSIUtils.cpp +26 -8
- package/ios/WorkletsAdapter/ExpoWorkletsBridgeProvider.mm +4 -3
- package/package.json +5 -3
- package/prebuilds/output/debug/xcframeworks/ExpoModulesCore.tar.gz +0 -0
- package/prebuilds/output/debug/xcframeworks/ExpoModulesWorklets.tar.gz +0 -0
- package/prebuilds/output/headers/xcframeworks/ExpoModulesCoreHeaders.tar.gz +0 -0
- package/prebuilds/output/release/xcframeworks/ExpoModulesCore.tar.gz +0 -0
- package/prebuilds/output/release/xcframeworks/ExpoModulesWorklets.tar.gz +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 58.0.22
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [Android] Fix native memory that grew with each module class under Hermes V1, by about 0.57 MiB per class on React Native 0.86 and 0.87 and about 93 KiB on 0.88. `createClass` evaluated a new JavaScript source for each class, and Hermes keeps memory for every evaluated source until the runtime is destroyed. It now evaluates one class factory for each runtime and calls it for each class. On iOS, this code creates only the four base classes (`SharedObject`, `SharedRef`, `EventEmitter` and `NativeModule`). ([#51582](https://github.com/expo/expo/pull/51582) by [@amillez](https://github.com/amillez))
|
|
8
|
+
- Fix an `-Wunused-result` warning in `Worklet.cpp` on Android when building with `react-native-worklets@0.13`. Running a worklet synchronously now discards its return value while the worklet runtime lock is still held, on Android and iOS. ([#51656](https://github.com/expo/expo/pull/51656) by [@tomekzaw](https://github.com/tomekzaw))
|
|
9
|
+
- Fix the `Do not include this file directly` warnings from `react-native-worklets@0.13` on Android and iOS. The worklets integration now includes the specific `Serializable` headers instead of the deprecated `worklets/SharedItems/Serializable.h`. ([#51664](https://github.com/expo/expo/pull/51664) by [@tomekzaw](https://github.com/tomekzaw))
|
|
10
|
+
- Updated dependencies. ([#51583](https://github.com/expo/expo/pull/51583))
|
|
11
|
+
- expo-modules-jsi@58.0.15
|
|
12
|
+
|
|
13
|
+
## 58.0.21
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [Web] Fix `globalThis.expo` missing on web when Rolldown or `vite build` on Vite 8 drops `ensureNativeModulesAreInstalled` and the polyfill it imports. The module is now listed in `sideEffects`. ([#51624](https://github.com/expo/expo/pull/51624) by [@Kudo](https://github.com/Kudo))
|
|
18
|
+
|
|
3
19
|
## 58.0.20
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/android/build.gradle
CHANGED
|
@@ -46,7 +46,7 @@ if (shouldIncludeCompose) {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
group = 'host.exp.exponent'
|
|
49
|
-
version = '58.0.
|
|
49
|
+
version = '58.0.22'
|
|
50
50
|
|
|
51
51
|
def isExpoModulesCoreTests = {
|
|
52
52
|
Gradle gradle = getGradle()
|
|
@@ -175,7 +175,7 @@ android {
|
|
|
175
175
|
defaultConfig {
|
|
176
176
|
consumerProguardFiles 'proguard-rules.pro'
|
|
177
177
|
versionCode 1
|
|
178
|
-
versionName "58.0.
|
|
178
|
+
versionName "58.0.22"
|
|
179
179
|
buildConfigField "String", "EXPO_MODULES_CORE_VERSION", "\"${versionName}\""
|
|
180
180
|
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", "true"
|
|
181
181
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"reactNativeVersion": "0.88.0",
|
|
3
|
-
"sourceHash": "
|
|
3
|
+
"sourceHash": "5d969987e485331bb2f3b9a20d954e37",
|
|
4
4
|
"variants": [
|
|
5
5
|
"debug",
|
|
6
6
|
"release"
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
"libexpo-modules-jsi.so"
|
|
17
17
|
],
|
|
18
18
|
"stripped": true,
|
|
19
|
-
"createdAt": "2026-10-
|
|
19
|
+
"createdAt": "2026-10-16T19:27:48.952650783Z"
|
|
20
20
|
}
|
|
Binary file
|
|
@@ -1,21 +1,39 @@
|
|
|
1
1
|
// Copyright 2022-present 650 Industries. All rights reserved.
|
|
2
2
|
|
|
3
|
-
#include <sstream>
|
|
4
3
|
#include <utility>
|
|
5
4
|
#include "JSIUtils.h"
|
|
6
5
|
|
|
7
6
|
namespace expo::common {
|
|
8
7
|
|
|
8
|
+
static constexpr jsi::UUID classFactoryUUID{0xa1f49c57, 0x6f0a, 0x4775, 0x9f44, 0xcb0673675b4c};
|
|
9
|
+
|
|
10
|
+
// Hermes keeps memory for every evaluated source until the runtime is destroyed, so the
|
|
11
|
+
// constructor source is evaluated once per runtime and the factory is called for each class.
|
|
12
|
+
// The runtime data releases the factory when the runtime is destroyed, and JS code can't reach it.
|
|
13
|
+
static std::shared_ptr<jsi::Function> getClassFactory(jsi::Runtime &runtime) {
|
|
14
|
+
if (std::shared_ptr<void> cached = runtime.getRuntimeData(classFactoryUUID)) {
|
|
15
|
+
return std::static_pointer_cast<jsi::Function>(cached);
|
|
16
|
+
}
|
|
17
|
+
std::shared_ptr<jsi::StringBuffer> sourceBuffer = std::make_shared<jsi::StringBuffer>(
|
|
18
|
+
"(function (name) {"
|
|
19
|
+
" const klass = function (...args) { return this.__native_constructor__(...args); };"
|
|
20
|
+
" Object.defineProperty(klass, 'name', { value: name });"
|
|
21
|
+
" return klass;"
|
|
22
|
+
"})"
|
|
23
|
+
);
|
|
24
|
+
auto factory = std::make_shared<jsi::Function>(
|
|
25
|
+
runtime.evaluateJavaScript(sourceBuffer, "expo-modules-core/class-factory.js").asObject(runtime).asFunction(runtime)
|
|
26
|
+
);
|
|
27
|
+
runtime.setRuntimeData(classFactoryUUID, factory);
|
|
28
|
+
return factory;
|
|
29
|
+
}
|
|
30
|
+
|
|
9
31
|
jsi::Function createClass(jsi::Runtime &runtime, const char *name, ClassConstructor constructor) {
|
|
10
32
|
std::string nativeConstructorKey("__native_constructor__");
|
|
11
33
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
std::shared_ptr<jsi::StringBuffer> sourceBuffer = std::make_shared<jsi::StringBuffer>(source.str());
|
|
16
|
-
|
|
17
|
-
// Evaluate the code and obtain the returned value (the constructor function).
|
|
18
|
-
jsi::Object klass = runtime.evaluateJavaScript(sourceBuffer, "").asObject(runtime);
|
|
34
|
+
jsi::Object klass = getClassFactory(runtime)
|
|
35
|
+
->call(runtime, jsi::String::createFromUtf8(runtime, name))
|
|
36
|
+
.asObject(runtime);
|
|
19
37
|
|
|
20
38
|
// Set the native constructor in the prototype.
|
|
21
39
|
jsi::Object prototype = klass.getPropertyAsObject(runtime, "prototype");
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
#include <memory>
|
|
9
9
|
#include <vector>
|
|
10
10
|
#include <worklets/Compat/StableApi.h>
|
|
11
|
-
#include <worklets/SharedItems/Serializable.h>
|
|
11
|
+
#include <worklets/SharedItems/Serializable/Serializable.h>
|
|
12
|
+
#include <worklets/SharedItems/Serializable/SerializableWorklet.h>
|
|
12
13
|
#include <worklets/WorkletRuntime/WorkletRuntime.h>
|
|
13
14
|
|
|
14
15
|
namespace jsi = facebook::jsi;
|
|
@@ -233,8 +234,8 @@ static jsi::Value callWorklet(jsi::Runtime &rt, std::shared_ptr<worklets::Serial
|
|
|
233
234
|
return;
|
|
234
235
|
}
|
|
235
236
|
|
|
236
|
-
workletRuntime->runSync([worklet, arguments](jsi::Runtime &rt)
|
|
237
|
-
|
|
237
|
+
workletRuntime->runSync([worklet, arguments](jsi::Runtime &rt) {
|
|
238
|
+
callWorklet(rt, worklet, arguments);
|
|
238
239
|
});
|
|
239
240
|
}
|
|
240
241
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-modules-core",
|
|
3
|
-
"version": "58.0.
|
|
3
|
+
"version": "58.0.22",
|
|
4
4
|
"description": "The core of Expo Modules architecture",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"expo",
|
|
@@ -24,7 +24,9 @@
|
|
|
24
24
|
"*.fx.ts",
|
|
25
25
|
"*.fx.js",
|
|
26
26
|
"./src/polyfill/*.ts",
|
|
27
|
-
"./build/polyfill/*.js"
|
|
27
|
+
"./build/polyfill/*.js",
|
|
28
|
+
"./src/ensureNativeModulesAreInstalled.ts",
|
|
29
|
+
"./build/ensureNativeModulesAreInstalled.js"
|
|
28
30
|
],
|
|
29
31
|
"main": "build/index.js",
|
|
30
32
|
"types": "build/index.d.ts",
|
|
@@ -64,7 +66,7 @@
|
|
|
64
66
|
"./package.json": "./package.json"
|
|
65
67
|
},
|
|
66
68
|
"dependencies": {
|
|
67
|
-
"expo-modules-jsi": "~58.0.
|
|
69
|
+
"expo-modules-jsi": "~58.0.15",
|
|
68
70
|
"expo-modules-macros": "0.20.0",
|
|
69
71
|
"invariant": "^2.2.4"
|
|
70
72
|
},
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|