expo-modules-core 56.0.10 → 56.0.11

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 CHANGED
@@ -10,6 +10,12 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 56.0.11 — 2026-05-20
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - [iOS] Fix occasional `SharedObject.emit` crashes caused by an off-thread JSI lookup. ([#45986](https://github.com/expo/expo/pull/45986) by [@tsapeta](https://github.com/tsapeta))
18
+
13
19
  ## 56.0.10 — 2026-05-19
14
20
 
15
21
  ### 🎉 New features
@@ -27,7 +27,7 @@ if (shouldIncludeCompose) {
27
27
  }
28
28
 
29
29
  group = 'host.exp.exponent'
30
- version = '56.0.10'
30
+ version = '56.0.11'
31
31
 
32
32
  def isExpoModulesCoreTests = {
33
33
  Gradle gradle = getGradle()
@@ -94,7 +94,7 @@ android {
94
94
  defaultConfig {
95
95
  consumerProguardFiles 'proguard-rules.pro'
96
96
  versionCode 1
97
- versionName "56.0.10"
97
+ versionName "56.0.11"
98
98
  buildConfigField "String", "EXPO_MODULES_CORE_VERSION", "\"${versionName}\""
99
99
  buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", "true"
100
100
 
@@ -6,6 +6,7 @@ import expo.modules.plugin.Version
6
6
  import expo.modules.plugin.safeGet
7
7
  import org.gradle.api.Action
8
8
  import org.gradle.api.Project
9
+ import org.gradle.api.artifacts.Dependency
9
10
  import org.gradle.api.publish.maven.MavenPom
10
11
  import org.gradle.internal.extensions.core.extra
11
12
  import java.io.File
@@ -38,8 +39,9 @@ open class ExpoModuleExtension(val project: Project) {
38
39
  return project.rootProject.extra.safeGet<Any>(name) ?: default
39
40
  }
40
41
 
41
- fun getExpoDependency(name: String): Any {
42
- return autolinking.getExpoDependency(project, name)
42
+ fun getExpoDependency(name: String): Dependency {
43
+ val notation = autolinking.getExpoDependency(project, name)
44
+ return project.dependencies.create(notation)
43
45
  }
44
46
 
45
47
  var canBePublished: Boolean = true
@@ -77,11 +77,14 @@ open class SharedObject: AnySharedObject {
77
77
  log.warn("Trying to send event '\(event)' to \(type(of: self)), but the JS runtime has been lost")
78
78
  return
79
79
  }
80
- guard let jsValue = getJavaScriptValue() else {
81
- log.warn("Trying to send event '\(event)' to JS, but the JS object is no longer associated with the native instance")
82
- return
83
- }
84
- runtime.schedule {
80
+ runtime.schedule { [weak appContext, sharedObjectId] in
81
+ guard let appContext else {
82
+ return
83
+ }
84
+ guard let jsValue = appContext.sharedObjectRegistry.toJavaScriptValue(sharedObjectId: sharedObjectId) else {
85
+ log.warn("Trying to send event '\(event)' to JS, but the JS object is no longer associated with the native instance")
86
+ return
87
+ }
85
88
  dispatch(event: event, payload: payload, to: jsValue, in: runtime)
86
89
  }
87
90
  }
@@ -101,14 +104,14 @@ open class SharedObject: AnySharedObject {
101
104
  log.warn("Trying to send event '\(event)' to \(type(of: self)), but the JS runtime has been lost")
102
105
  return
103
106
  }
104
- guard let jsValue = getJavaScriptValue() else {
105
- log.warn("Trying to send event '\(event)' to JS, but the JS object is no longer associated with the native instance")
106
- return
107
- }
108
- runtime.schedule { [weak appContext] in
107
+ runtime.schedule { [weak appContext, sharedObjectId] in
109
108
  guard let appContext else {
110
109
  return
111
110
  }
111
+ guard let jsValue = appContext.sharedObjectRegistry.toJavaScriptValue(sharedObjectId: sharedObjectId) else {
112
+ log.warn("Trying to send event '\(event)' to JS, but the JS object is no longer associated with the native instance")
113
+ return
114
+ }
112
115
  do {
113
116
  let jsPayload = try (~P.self).castToJS(payload, appContext: appContext, in: runtime)
114
117
  dispatch(event: event, payload: jsPayload, to: jsValue, in: runtime)
@@ -181,6 +181,17 @@ public final class SharedObjectRegistry: Sendable {
181
181
  return toJavaScriptObject(nativeObject)?.asValue()
182
182
  }
183
183
 
184
+ /**
185
+ Variant of `toJavaScriptValue(_:)` that looks up by id rather than by native object.
186
+ */
187
+ @JavaScriptActor
188
+ internal func toJavaScriptValue(sharedObjectId id: SharedObjectId) -> JavaScriptValue? {
189
+ let pair = state.withLock { state in
190
+ return state.pairs[id]
191
+ }
192
+ return pair?.javaScript.lock()?.asValue()
193
+ }
194
+
184
195
  /**
185
196
  Gets the JS shared object that is paired with a given native object.
186
197
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-modules-core",
3
- "version": "56.0.10",
3
+ "version": "56.0.11",
4
4
  "description": "The core of Expo Modules architecture",
5
5
  "main": "src/index.ts",
6
6
  "types": "build/index.d.ts",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@expo/expo-modules-macros-plugin": "~0.0.9",
50
- "expo-modules-jsi": "~56.0.6",
50
+ "expo-modules-jsi": "~56.0.7",
51
51
  "invariant": "^2.2.4"
52
52
  },
53
53
  "peerDependencies": {
@@ -66,7 +66,7 @@
66
66
  "@types/invariant": "^2.2.33",
67
67
  "expo-module-scripts": "56.0.2"
68
68
  },
69
- "gitHead": "290368bc41026449a05a4ebf991b85c3a2fb0e3a",
69
+ "gitHead": "c4c9867a0bcbb188e55ecaec4998e38d33108a5d",
70
70
  "scripts": {
71
71
  "build": "expo-module build",
72
72
  "clean": "expo-module clean",