expo-modules-core 58.0.17 → 58.0.19
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 +23 -0
- package/ExpoModulesCore.podspec +10 -1
- package/android/build.gradle +3 -3
- package/android/prebuilt/metadata.json +2 -2
- package/android/prebuilt/native-libs.tar.xz +0 -0
- package/android/src/main/java/expo/modules/v2/ExpoModulesV2Host.kt +4 -0
- package/build/ts-declarations/global.d.ts +0 -1
- package/common/cpp/EventEmitter.cpp +8 -4
- package/expo-module-gradle-plugin/build.gradle.kts +1 -1
- package/ios/Api/Factories/ClassFactories.swift +1 -1
- package/ios/Benchmarks/Benchmarks.swift +15 -0
- package/ios/Benchmarks/EventEmitterBenchmarks.swift +140 -0
- package/ios/Benchmarks/FunctionBenchmarks.swift +112 -0
- package/ios/Benchmarks/SharedObjectBenchmarks.swift +80 -0
- package/ios/Core/AppContext.swift +22 -2
- package/ios/Core/ArrayBuffers/ArrayBuffer.swift +8 -3
- package/ios/Core/Classes/ClassDefinition.swift +15 -5
- package/ios/Core/EventListener.swift +4 -0
- package/ios/Core/Events/EventEmitter.swift +56 -12
- package/ios/Core/Events/EventObservingDefinition.swift +4 -0
- package/ios/Core/Functions/AsyncFunctionDefinition.swift +4 -0
- package/ios/Core/Functions/ConcurrentFunctionDefinition.swift +4 -0
- package/ios/Core/Functions/OptimizedAsyncFunctionDefinition.swift +4 -0
- package/ios/Core/Functions/OptimizedSyncFunctionDefinition.swift +4 -0
- package/ios/Core/Functions/StaticFunctionDefinition.swift +12 -16
- package/ios/Core/Functions/SyncFunctionDefinition.swift +4 -0
- package/ios/Core/ModuleHolder.swift +1 -0
- package/ios/Core/ModuleRegistry.swift +2 -2
- package/ios/Core/Modules/Module.swift +7 -5
- package/ios/Core/Modules/ModuleDefinition.swift +43 -16
- package/ios/Core/Objects/ConstantDefinition.swift +4 -0
- package/ios/Core/Objects/ObjectDefinition.swift +35 -31
- package/ios/Core/Objects/PropertyDefinition.swift +4 -0
- package/ios/Core/Protocols/AnyDefinition.swift +43 -1
- package/ios/Core/Protocols/AnyModule.swift +1 -1
- package/ios/Core/TypeName.swift +12 -0
- package/ios/Core/TypedArrays/ConcreteTypedArrays.swift +58 -46
- package/ios/Core/TypedArrays/TypedArray.swift +11 -5
- package/ios/Core/Views/ConcreteViewProp.swift +4 -0
- package/ios/Core/Views/SwiftUI/SwiftUIViewDefinition.swift +1 -1
- package/ios/Core/Views/ViewDefinition.swift +36 -15
- package/ios/Core/Views/ViewLifecycleMethod.swift +4 -0
- package/ios/JS/EXJSUtils.h +16 -0
- package/ios/JS/EXJSUtils.mm +13 -4
- package/ios/Utilities/Utilities.swift +0 -14
- package/package.json +4 -4
- 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/spm.config.json +9 -1
- package/src/ts-declarations/global.ts +0 -1
|
@@ -2,18 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
import ExpoModulesJSI
|
|
4
4
|
|
|
5
|
-
// Each concrete typed array overrides `decode` to return its own `Self` and reject a
|
|
6
|
-
// delegating to the shared `decode(_:expectingKind:)` on the base.
|
|
5
|
+
// Each concrete typed array overrides the unowned `decode` to return its own `Self` and reject a
|
|
6
|
+
// mismatched kind, delegating to the shared `decode(_:expectingKind:in:)` on the base. The owning
|
|
7
|
+
// `decode` is the `JavaScriptDecodable` default, which forwards to it. See `TypedArray.swift` for why the
|
|
7
8
|
// witness is an overridable `class func` rather than living in the conformance extension.
|
|
8
9
|
|
|
9
10
|
/// Native equivalent of `Int8Array` in JavaScript, an array of two's-complement 8-bit signed integers.
|
|
10
11
|
public final class Int8Array: GenericTypedArray<Int8> {
|
|
11
12
|
@JavaScriptActor
|
|
12
13
|
@inlinable
|
|
13
|
-
public override class func decode(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
public override class func decode(
|
|
15
|
+
_ value: borrowing JavaScriptUnownedValue,
|
|
16
|
+
in runtime: borrowing JavaScriptRuntime
|
|
17
|
+
) throws -> Int8Array {
|
|
18
|
+
return try decode(value, expectingKind: .Int8Array, in: runtime)
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
|
|
@@ -21,10 +23,11 @@ public final class Int8Array: GenericTypedArray<Int8> {
|
|
|
21
23
|
public final class Int16Array: GenericTypedArray<Int16> {
|
|
22
24
|
@JavaScriptActor
|
|
23
25
|
@inlinable
|
|
24
|
-
public override class func decode(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
public override class func decode(
|
|
27
|
+
_ value: borrowing JavaScriptUnownedValue,
|
|
28
|
+
in runtime: borrowing JavaScriptRuntime
|
|
29
|
+
) throws -> Int16Array {
|
|
30
|
+
return try decode(value, expectingKind: .Int16Array, in: runtime)
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
|
|
@@ -32,10 +35,11 @@ public final class Int16Array: GenericTypedArray<Int16> {
|
|
|
32
35
|
public final class Int32Array: GenericTypedArray<Int32> {
|
|
33
36
|
@JavaScriptActor
|
|
34
37
|
@inlinable
|
|
35
|
-
public override class func decode(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
public override class func decode(
|
|
39
|
+
_ value: borrowing JavaScriptUnownedValue,
|
|
40
|
+
in runtime: borrowing JavaScriptRuntime
|
|
41
|
+
) throws -> Int32Array {
|
|
42
|
+
return try decode(value, expectingKind: .Int32Array, in: runtime)
|
|
39
43
|
}
|
|
40
44
|
}
|
|
41
45
|
|
|
@@ -43,10 +47,11 @@ public final class Int32Array: GenericTypedArray<Int32> {
|
|
|
43
47
|
public final class Uint8Array: GenericTypedArray<UInt8> {
|
|
44
48
|
@JavaScriptActor
|
|
45
49
|
@inlinable
|
|
46
|
-
public override class func decode(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
public override class func decode(
|
|
51
|
+
_ value: borrowing JavaScriptUnownedValue,
|
|
52
|
+
in runtime: borrowing JavaScriptRuntime
|
|
53
|
+
) throws -> Uint8Array {
|
|
54
|
+
return try decode(value, expectingKind: .Uint8Array, in: runtime)
|
|
50
55
|
}
|
|
51
56
|
}
|
|
52
57
|
|
|
@@ -54,10 +59,11 @@ public final class Uint8Array: GenericTypedArray<UInt8> {
|
|
|
54
59
|
public final class Uint8ClampedArray: GenericTypedArray<UInt8> {
|
|
55
60
|
@JavaScriptActor
|
|
56
61
|
@inlinable
|
|
57
|
-
public override class func decode(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
public override class func decode(
|
|
63
|
+
_ value: borrowing JavaScriptUnownedValue,
|
|
64
|
+
in runtime: borrowing JavaScriptRuntime
|
|
65
|
+
) throws -> Uint8ClampedArray {
|
|
66
|
+
return try decode(value, expectingKind: .Uint8ClampedArray, in: runtime)
|
|
61
67
|
}
|
|
62
68
|
}
|
|
63
69
|
|
|
@@ -65,10 +71,11 @@ public final class Uint8ClampedArray: GenericTypedArray<UInt8> {
|
|
|
65
71
|
public final class Uint16Array: GenericTypedArray<UInt16> {
|
|
66
72
|
@JavaScriptActor
|
|
67
73
|
@inlinable
|
|
68
|
-
public override class func decode(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
74
|
+
public override class func decode(
|
|
75
|
+
_ value: borrowing JavaScriptUnownedValue,
|
|
76
|
+
in runtime: borrowing JavaScriptRuntime
|
|
77
|
+
) throws -> Uint16Array {
|
|
78
|
+
return try decode(value, expectingKind: .Uint16Array, in: runtime)
|
|
72
79
|
}
|
|
73
80
|
}
|
|
74
81
|
|
|
@@ -76,10 +83,11 @@ public final class Uint16Array: GenericTypedArray<UInt16> {
|
|
|
76
83
|
public final class Uint32Array: GenericTypedArray<UInt32> {
|
|
77
84
|
@JavaScriptActor
|
|
78
85
|
@inlinable
|
|
79
|
-
public override class func decode(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
public override class func decode(
|
|
87
|
+
_ value: borrowing JavaScriptUnownedValue,
|
|
88
|
+
in runtime: borrowing JavaScriptRuntime
|
|
89
|
+
) throws -> Uint32Array {
|
|
90
|
+
return try decode(value, expectingKind: .Uint32Array, in: runtime)
|
|
83
91
|
}
|
|
84
92
|
}
|
|
85
93
|
|
|
@@ -87,10 +95,11 @@ public final class Uint32Array: GenericTypedArray<UInt32> {
|
|
|
87
95
|
public final class Float32Array: GenericTypedArray<Float32> {
|
|
88
96
|
@JavaScriptActor
|
|
89
97
|
@inlinable
|
|
90
|
-
public override class func decode(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
98
|
+
public override class func decode(
|
|
99
|
+
_ value: borrowing JavaScriptUnownedValue,
|
|
100
|
+
in runtime: borrowing JavaScriptRuntime
|
|
101
|
+
) throws -> Float32Array {
|
|
102
|
+
return try decode(value, expectingKind: .Float32Array, in: runtime)
|
|
94
103
|
}
|
|
95
104
|
}
|
|
96
105
|
|
|
@@ -98,10 +107,11 @@ public final class Float32Array: GenericTypedArray<Float32> {
|
|
|
98
107
|
public final class Float64Array: GenericTypedArray<Float64> {
|
|
99
108
|
@JavaScriptActor
|
|
100
109
|
@inlinable
|
|
101
|
-
public override class func decode(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
110
|
+
public override class func decode(
|
|
111
|
+
_ value: borrowing JavaScriptUnownedValue,
|
|
112
|
+
in runtime: borrowing JavaScriptRuntime
|
|
113
|
+
) throws -> Float64Array {
|
|
114
|
+
return try decode(value, expectingKind: .Float64Array, in: runtime)
|
|
105
115
|
}
|
|
106
116
|
}
|
|
107
117
|
|
|
@@ -109,10 +119,11 @@ public final class Float64Array: GenericTypedArray<Float64> {
|
|
|
109
119
|
public final class BigInt64Array: GenericTypedArray<Int64> {
|
|
110
120
|
@JavaScriptActor
|
|
111
121
|
@inlinable
|
|
112
|
-
public override class func decode(
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
122
|
+
public override class func decode(
|
|
123
|
+
_ value: borrowing JavaScriptUnownedValue,
|
|
124
|
+
in runtime: borrowing JavaScriptRuntime
|
|
125
|
+
) throws -> BigInt64Array {
|
|
126
|
+
return try decode(value, expectingKind: .BigInt64Array, in: runtime)
|
|
116
127
|
}
|
|
117
128
|
}
|
|
118
129
|
|
|
@@ -120,9 +131,10 @@ public final class BigInt64Array: GenericTypedArray<Int64> {
|
|
|
120
131
|
public final class BigUint64Array: GenericTypedArray<UInt64> {
|
|
121
132
|
@JavaScriptActor
|
|
122
133
|
@inlinable
|
|
123
|
-
public override class func decode(
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
134
|
+
public override class func decode(
|
|
135
|
+
_ value: borrowing JavaScriptUnownedValue,
|
|
136
|
+
in runtime: borrowing JavaScriptRuntime
|
|
137
|
+
) throws -> BigUint64Array {
|
|
138
|
+
return try decode(value, expectingKind: .BigUint64Array, in: runtime)
|
|
127
139
|
}
|
|
128
140
|
}
|
|
@@ -100,10 +100,15 @@ public class TypedArray: AnyTypedArray {
|
|
|
100
100
|
|
|
101
101
|
/// `JavaScriptDecodable` witness. It's a `class func` in the class body, not in the conformance
|
|
102
102
|
/// extension, so the concrete subclasses can override it (extension methods can't be overridden).
|
|
103
|
+
/// It takes a borrowed value, so a typed array argument is decoded without copying it into an owning
|
|
104
|
+
/// `JavaScriptValue`; the owning `decode` is the `JavaScriptDecodable` default, which forwards here.
|
|
103
105
|
/// The base accepts any kind and resolves the concrete subclass via `create(from:)`.
|
|
104
106
|
@JavaScriptActor
|
|
105
107
|
@inlinable
|
|
106
|
-
public class func decode(
|
|
108
|
+
public class func decode(
|
|
109
|
+
_ value: borrowing JavaScriptUnownedValue,
|
|
110
|
+
in runtime: borrowing JavaScriptRuntime
|
|
111
|
+
) throws -> Self {
|
|
107
112
|
guard value.isTypedArray() else {
|
|
108
113
|
throw NotATypedArrayException()
|
|
109
114
|
}
|
|
@@ -111,7 +116,7 @@ public class TypedArray: AnyTypedArray {
|
|
|
111
116
|
// to `Self` always holds; it only fails when this inherited witness runs for a narrower `Self` (a
|
|
112
117
|
// `GenericTypedArray<T>` specialization) whose element type doesn't match the JS kind. Guard rather
|
|
113
118
|
// than force-cast so that surfaces as a thrown error instead of a trap.
|
|
114
|
-
let typedArray = create(from: value.getTypedArray())
|
|
119
|
+
let typedArray = create(from: value.getTypedArray(in: runtime))
|
|
115
120
|
guard let typed = typedArray as? Self else {
|
|
116
121
|
throw KindMismatchException(expected: nil, received: typedArray.kind)
|
|
117
122
|
}
|
|
@@ -123,13 +128,14 @@ public class TypedArray: AnyTypedArray {
|
|
|
123
128
|
@JavaScriptActor
|
|
124
129
|
@inlinable
|
|
125
130
|
internal static func decode(
|
|
126
|
-
_ value: borrowing
|
|
127
|
-
expectingKind kind: JavaScriptTypedArray.Kind
|
|
131
|
+
_ value: borrowing JavaScriptUnownedValue,
|
|
132
|
+
expectingKind kind: JavaScriptTypedArray.Kind,
|
|
133
|
+
in runtime: borrowing JavaScriptRuntime
|
|
128
134
|
) throws -> Self {
|
|
129
135
|
guard value.isTypedArray() else {
|
|
130
136
|
throw NotATypedArrayException()
|
|
131
137
|
}
|
|
132
|
-
let jsTypedArray = value.getTypedArray()
|
|
138
|
+
let jsTypedArray = value.getTypedArray(in: runtime)
|
|
133
139
|
guard jsTypedArray.kind == kind else {
|
|
134
140
|
throw KindMismatchException(expected: kind, received: jsTypedArray.kind)
|
|
135
141
|
}
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
Specialized class for the view prop. Specifies the prop name and its setter.
|
|
5
5
|
*/
|
|
6
6
|
public final class ConcreteViewProp<ViewType: UIView, PropType: AnyArgument>: AnyViewProp, @unchecked Sendable {
|
|
7
|
+
public var _definitionClassification: DefinitionClassification {
|
|
8
|
+
return DefinitionClassification(kind: .viewProp(self))
|
|
9
|
+
}
|
|
10
|
+
|
|
7
11
|
public typealias SetterType = @MainActor (ViewType, PropType) -> Void
|
|
8
12
|
|
|
9
13
|
/**
|
|
@@ -87,7 +87,7 @@ extension ExpoSwiftUI {
|
|
|
87
87
|
|
|
88
88
|
convenience init(_ viewType: ViewType.Type) {
|
|
89
89
|
// We assume SwiftUI views are exported as named views under the class name
|
|
90
|
-
let nameDefinitionElement = ViewNameDefinition(name:
|
|
90
|
+
let nameDefinitionElement = ViewNameDefinition(name: unqualifiedTypeName(viewType))
|
|
91
91
|
self.init(viewType, elements: [nameDefinitionElement])
|
|
92
92
|
}
|
|
93
93
|
|
|
@@ -6,6 +6,10 @@ import ExpoModulesJSI
|
|
|
6
6
|
A definition representing the native view to export to React.
|
|
7
7
|
*/
|
|
8
8
|
public class ViewDefinition<ViewType>: ObjectDefinition, AnyViewDefinition, @unchecked Sendable {
|
|
9
|
+
public override var _definitionClassification: DefinitionClassification {
|
|
10
|
+
return DefinitionClassification(kind: .view(self))
|
|
11
|
+
}
|
|
12
|
+
|
|
9
13
|
/**
|
|
10
14
|
An array of view props definitions.
|
|
11
15
|
*/
|
|
@@ -30,22 +34,35 @@ public class ViewDefinition<ViewType>: ObjectDefinition, AnyViewDefinition, @unc
|
|
|
30
34
|
Default initializer receiving children definitions from the result builder.
|
|
31
35
|
*/
|
|
32
36
|
init(_ viewType: ViewType.Type, elements: [AnyViewDefinitionElement]) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
var props = [any AnyViewProp]()
|
|
38
|
+
var name: String?
|
|
39
|
+
var eventNames = [String]()
|
|
40
|
+
var lifecycleMethods = [AnyViewLifecycleMethod]()
|
|
41
|
+
|
|
42
|
+
for element in elements {
|
|
43
|
+
switch element._definitionClassification.kind {
|
|
44
|
+
case .viewProp(let prop):
|
|
45
|
+
props.append(prop)
|
|
46
|
+
case .viewName(let nameDefinition):
|
|
47
|
+
name = nameDefinition.name
|
|
48
|
+
case .events(let events):
|
|
49
|
+
eventNames.append(contentsOf: events.names)
|
|
50
|
+
case .viewLifecycle(let method):
|
|
51
|
+
lifecycleMethods.append(method)
|
|
52
|
+
case .unknown:
|
|
53
|
+
// `AnyViewProp` is the only element protocol collected here that a type from another module can conform to.
|
|
54
|
+
if let prop = element as? AnyViewProp {
|
|
55
|
+
props.append(prop)
|
|
56
|
+
}
|
|
57
|
+
case .function, .staticFunction, .legacyConstants, .constant, .property, .klass, .moduleName, .eventListener, .eventObserver, .view:
|
|
58
|
+
break
|
|
59
|
+
}
|
|
60
|
+
}
|
|
46
61
|
|
|
47
|
-
self.
|
|
48
|
-
|
|
62
|
+
self.props = props
|
|
63
|
+
self.name = name ?? unqualifiedTypeName(viewType)
|
|
64
|
+
self.eventNames = eventNames
|
|
65
|
+
self.lifecycleMethods = lifecycleMethods
|
|
49
66
|
|
|
50
67
|
super.init(definitions: elements)
|
|
51
68
|
}
|
|
@@ -127,5 +144,9 @@ extension UIView: @MainActor AnyArgument {
|
|
|
127
144
|
}
|
|
128
145
|
|
|
129
146
|
public struct ViewNameDefinition: AnyViewDefinitionElement {
|
|
147
|
+
public var _definitionClassification: DefinitionClassification {
|
|
148
|
+
return DefinitionClassification(kind: .viewName(self))
|
|
149
|
+
}
|
|
150
|
+
|
|
130
151
|
let name: String
|
|
131
152
|
}
|
|
@@ -27,6 +27,10 @@ internal protocol AnyViewLifecycleMethod: AnyDefinition {
|
|
|
27
27
|
Element of the view definition that represents a lifecycle method, such as `OnViewDidUpdateProps`.
|
|
28
28
|
*/
|
|
29
29
|
public final class ViewLifecycleMethod<ViewType>: AnyViewLifecycleMethod {
|
|
30
|
+
public var _definitionClassification: DefinitionClassification {
|
|
31
|
+
return DefinitionClassification(kind: .viewLifecycle(self))
|
|
32
|
+
}
|
|
33
|
+
|
|
30
34
|
public typealias Closure = @MainActor (ViewType) -> Void
|
|
31
35
|
|
|
32
36
|
/**
|
package/ios/JS/EXJSUtils.h
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright 2025-present 650 Industries. All rights reserved.
|
|
2
2
|
|
|
3
3
|
#import <Foundation/Foundation.h>
|
|
4
|
+
#import <ExpoModulesCore/EXDefines.h>
|
|
4
5
|
|
|
5
6
|
NS_SWIFT_NAME(JSUtils)
|
|
6
7
|
@interface EXJSUtils : NSObject
|
|
@@ -26,3 +27,18 @@ NS_SWIFT_NAME(JSUtils)
|
|
|
26
27
|
argumentCount:(NSUInteger)argumentCount;
|
|
27
28
|
|
|
28
29
|
@end
|
|
30
|
+
|
|
31
|
+
EX_EXTERN_C_BEGIN
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
Same as `+[EXJSUtils emitEvent:runtimePointer:objectPointer:argumentsPointer:argumentCount:]`, but the event
|
|
35
|
+
name is a null-terminated UTF-8 string, and the call needs no Objective-C message.
|
|
36
|
+
*/
|
|
37
|
+
void EXJSUtilsEmitEvent(const char *_Nonnull eventName,
|
|
38
|
+
void *_Nonnull runtimePointer,
|
|
39
|
+
const void *_Nonnull objectPointer,
|
|
40
|
+
const void *_Nullable argumentsPointer,
|
|
41
|
+
size_t argumentCount)
|
|
42
|
+
NS_SWIFT_NAME(emitJSEvent(utf8Name:runtimePointer:objectPointer:argumentsPointer:argumentCount:));
|
|
43
|
+
|
|
44
|
+
EX_EXTERN_C_END
|
package/ios/JS/EXJSUtils.mm
CHANGED
|
@@ -27,17 +27,26 @@
|
|
|
27
27
|
objectPointer:(nonnull const void *)objectPointer
|
|
28
28
|
argumentsPointer:(nullable const void *)argumentsPointer
|
|
29
29
|
argumentCount:(NSUInteger)argumentCount
|
|
30
|
+
{
|
|
31
|
+
EXJSUtilsEmitEvent([eventName UTF8String], runtimePointer, objectPointer, argumentsPointer, argumentCount);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@end
|
|
35
|
+
|
|
36
|
+
void EXJSUtilsEmitEvent(const char *eventName,
|
|
37
|
+
void *runtimePointer,
|
|
38
|
+
const void *objectPointer,
|
|
39
|
+
const void *argumentsPointer,
|
|
40
|
+
size_t argumentCount)
|
|
30
41
|
{
|
|
31
42
|
auto &runtime = *static_cast<jsi::Runtime *>(runtimePointer);
|
|
32
43
|
auto &object = *static_cast<const jsi::Object *>(objectPointer);
|
|
33
44
|
|
|
34
45
|
if (argumentCount == 0 || argumentsPointer == nullptr) {
|
|
35
|
-
expo::EventEmitter::emitEvent(runtime, object,
|
|
46
|
+
expo::EventEmitter::emitEvent(runtime, object, eventName, nullptr, 0);
|
|
36
47
|
return;
|
|
37
48
|
}
|
|
38
49
|
|
|
39
50
|
auto *args = static_cast<const jsi::Value *>(argumentsPointer);
|
|
40
|
-
expo::EventEmitter::emitEvent(runtime, object,
|
|
51
|
+
expo::EventEmitter::emitEvent(runtime, object, eventName, args, argumentCount);
|
|
41
52
|
}
|
|
42
|
-
|
|
43
|
-
@end
|
|
@@ -95,20 +95,6 @@ internal class NonisolatedUnsafeVar<VarType>: @unchecked Sendable {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
/**
|
|
99
|
-
Like ``NonisolatedUnsafeVar``, but holds a weak reference so it can be captured into an isolated
|
|
100
|
-
closure without extending the referenced object's lifetime. Useful for sending a non-`Sendable`
|
|
101
|
-
object across an isolation boundary while keeping weak semantics.
|
|
102
|
-
- TODO: Remove it once the code is refactored to deal better with the concurrency model.
|
|
103
|
-
*/
|
|
104
|
-
internal class NonisolatedUnsafeWeakVar<VarType: AnyObject>: @unchecked Sendable {
|
|
105
|
-
nonisolated(unsafe) weak var value: VarType?
|
|
106
|
-
|
|
107
|
-
init(_ value: VarType?) {
|
|
108
|
-
self.value = value
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
98
|
internal func performSynchronouslyOnMainActor<Result: Sendable>(_ closure: @MainActor () throws -> Result) rethrows -> Result {
|
|
113
99
|
if Thread.isMainThread {
|
|
114
100
|
return try MainActor.assumeIsolated(closure)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-modules-core",
|
|
3
|
-
"version": "58.0.
|
|
3
|
+
"version": "58.0.19",
|
|
4
4
|
"description": "The core of Expo Modules architecture",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"expo",
|
|
@@ -64,12 +64,12 @@
|
|
|
64
64
|
"./package.json": "./package.json"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"expo-modules-jsi": "~58.0.
|
|
68
|
-
"expo-modules-macros": "0.
|
|
67
|
+
"expo-modules-jsi": "~58.0.14",
|
|
68
|
+
"expo-modules-macros": "0.20.0",
|
|
69
69
|
"invariant": "^2.2.4"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@expo/internal-scripts": "58.0.
|
|
72
|
+
"@expo/internal-scripts": "58.0.3",
|
|
73
73
|
"@testing-library/react-native": "^14.0.1",
|
|
74
74
|
"@types/invariant": "^2.2.33",
|
|
75
75
|
"@types/react": "~19.3.0",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/spm.config.json
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
{
|
|
6
6
|
"name": "ExpoModulesCore",
|
|
7
7
|
"podName": "ExpoModulesCore",
|
|
8
|
+
"headersXCFramework": true,
|
|
8
9
|
"platforms": ["iOS(\"16.4\")"],
|
|
9
10
|
"externalDependencies": [
|
|
10
11
|
"ReactNativeDependencies",
|
|
@@ -36,7 +37,13 @@
|
|
|
36
37
|
"path": "ios",
|
|
37
38
|
"pattern": "**/*.{m,mm}",
|
|
38
39
|
"headerPattern": "**/*.h",
|
|
39
|
-
"exclude": [
|
|
40
|
+
"exclude": [
|
|
41
|
+
"Tests/**",
|
|
42
|
+
"Benchmarks/**",
|
|
43
|
+
"WorkletsTests/**",
|
|
44
|
+
"Worklets/**",
|
|
45
|
+
"WorkletsAdapter/**"
|
|
46
|
+
],
|
|
40
47
|
"fileMapping": [
|
|
41
48
|
{
|
|
42
49
|
"from": "Core/Views/SwiftUI/SwiftUIVirtualViewSharedImpl+Private.h",
|
|
@@ -65,6 +72,7 @@
|
|
|
65
72
|
"exclude": [
|
|
66
73
|
"JSI/**",
|
|
67
74
|
"Tests/**",
|
|
75
|
+
"Benchmarks/**",
|
|
68
76
|
"WorkletsTests/**",
|
|
69
77
|
"BridgeModule/**",
|
|
70
78
|
"Views/**",
|
|
@@ -14,7 +14,6 @@ export interface ExpoProcessEnv {
|
|
|
14
14
|
EXPO_DEV_SERVER_ORIGIN?: string;
|
|
15
15
|
|
|
16
16
|
EXPO_ROUTER_IMPORT_MODE?: string;
|
|
17
|
-
EXPO_ROUTER_ABS_APP_ROOT?: string;
|
|
18
17
|
EXPO_ROUTER_APP_ROOT?: string;
|
|
19
18
|
|
|
20
19
|
/** Maps to the `experiments.baseUrl` property in the project Expo config. This is injected by `babel-preset-expo` and supports automatic cache invalidation. */
|