expo-modules-macros 0.34.0 → 0.35.0

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.
Binary file
@@ -119,11 +119,14 @@ public struct ExpoModuleMacro: MemberMacro {
119
119
  // View classes are registered by type, not spliced as definitions: an `@ExpoView` emits no
120
120
  // definition function, so there is nothing to call on each entry. Core reads a view's props
121
121
  // type from its `Props` typealias and its event names from that type's `_eventNames`, both
122
- // static. Emitted only when the argument is present, so a module without views gains nothing.
122
+ // static. The element type makes the compiler reject a class that isn't an `@ExpoView`, whose
123
+ // macro adds the `AnyNativeView` conformance. Each entry is coerced on its own, because for an array
124
+ // literal of existential metatypes the compiler fails to produce a diagnostic. Emitted only when
125
+ // the argument is present, so a module without views gains nothing.
123
126
  let viewTypes = classListArgument(of: node, label: "views")
124
127
  if !viewTypes.isEmpty {
125
- let entries = viewTypes.map { "\($0).self" }.joined(separator: ", ")
126
- emitted.append("public static let _viewTypes: [Any.Type] = [\(raw: entries)]")
128
+ let entries = viewTypes.map { "\($0).self as any AnyNativeView.Type" }.joined(separator: ", ")
129
+ emitted.append("public static let _viewTypes: [any AnyNativeView.Type] = [\(raw: entries)]")
127
130
  }
128
131
 
129
132
  // `Module`/`BaseModule` already provide `appContext` storage and the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-modules-macros",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "description": "Swift macro plugin for Expo modules",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -26,9 +26,9 @@
26
26
  "typescript": "^5.4.0"
27
27
  },
28
28
  "optionalDependencies": {
29
- "@expo/modules-macros-linux-arm64": "0.34.0",
30
- "@expo/modules-macros-linux-x64": "0.34.0",
31
- "@expo/modules-macros-win32-arm64": "0.34.0",
32
- "@expo/modules-macros-win32-x64": "0.34.0"
29
+ "@expo/modules-macros-linux-arm64": "0.35.0",
30
+ "@expo/modules-macros-linux-x64": "0.35.0",
31
+ "@expo/modules-macros-win32-arm64": "0.35.0",
32
+ "@expo/modules-macros-win32-x64": "0.35.0"
33
33
  }
34
34
  }