expo-modules-core 2.1.1 → 2.1.2

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,14 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 2.1.2 — 2024-12-16
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Ensure `uuid.v4`and`uuid.v5` is available on old react native architecture. ([#33621](https://github.com/expo/expo/pull/33621) by [@andrejpavlovic](https://github.com/andrejpavlovic))
18
+ - Changed `import` to `import type` for TS type declarations. ([#33447](https://github.com/expo/expo/pull/33447) by [@j-piasecki](https://github.com/j-piasecki))
19
+ - [macOS] Allow SwiftUI views to work on macOS ([#33506](https://github.com/expo/expo/pull/33506) by [@hassankhan](https://github.com/hassankhan))
20
+
13
21
  ## 2.1.1 — 2024-12-02
14
22
 
15
23
  _This version does not introduce any user-facing changes._
@@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3
3
  apply plugin: 'com.android.library'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '2.1.1'
6
+ version = '2.1.2'
7
7
 
8
8
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
9
9
  apply from: expoModulesCorePlugin
@@ -67,7 +67,7 @@ android {
67
67
  defaultConfig {
68
68
  consumerProguardFiles 'proguard-rules.pro'
69
69
  versionCode 1
70
- versionName "2.1.1"
70
+ versionName "2.1.2"
71
71
  buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled.toString()
72
72
 
73
73
  testInstrumentationRunner "expo.modules.TestRunner"
@@ -1,4 +1,4 @@
1
- import { ProxyNativeModule } from './NativeModulesProxy.types';
1
+ import type { ProxyNativeModule } from './NativeModulesProxy.types';
2
2
  /**
3
3
  * @deprecated `NativeModulesProxy` is deprecated and might be removed in the future releases.
4
4
  * Use `requireNativeModule` or `requireOptionalNativeModule` instead.
@@ -1 +1 @@
1
- {"version":3,"file":"NativeModulesProxy.d.ts","sourceRoot":"","sources":["../src/NativeModulesProxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAI/D;;;GAGG;;;;AACH,wBAAiE"}
1
+ {"version":3,"file":"NativeModulesProxy.d.ts","sourceRoot":"","sources":["../src/NativeModulesProxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAIpE;;;GAGG;;;;AACH,wBAAiE"}
@@ -1,4 +1,4 @@
1
- import { ProxyNativeModule } from './NativeModulesProxy.types';
1
+ import type { ProxyNativeModule } from './NativeModulesProxy.types';
2
2
  /**
3
3
  * @deprecated `NativeModulesProxy` is deprecated and might be removed in the future releases.
4
4
  * Use `requireNativeModule` or `requireOptionalNativeModule` instead.
@@ -1 +1 @@
1
- {"version":3,"file":"NativeModulesProxy.native.d.ts","sourceRoot":"","sources":["../src/NativeModulesProxy.native.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAU/D;;;GAGG;AACH,QAAA,MAAM,kBAAkB,EAAE;IAAE,CAAC,UAAU,EAAE,MAAM,GAAG,iBAAiB,CAAA;CAAO,CAAC;AA+D3E,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"NativeModulesProxy.native.d.ts","sourceRoot":"","sources":["../src/NativeModulesProxy.native.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAUpE;;;GAGG;AACH,QAAA,MAAM,kBAAkB,EAAE;IAAE,CAAC,UAAU,EAAE,MAAM,GAAG,iBAAiB,CAAA;CAAO,CAAC;AA+D3E,eAAe,kBAAkB,CAAC"}
package/build/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import EventEmitter, { type EventSubscription } from './EventEmitter';
2
2
  import { LegacyEventEmitter } from './LegacyEventEmitter';
3
3
  import NativeModule from './NativeModule';
4
4
  import NativeModulesProxy from './NativeModulesProxy';
5
- import { ProxyNativeModule } from './NativeModulesProxy.types';
5
+ import type { ProxyNativeModule } from './NativeModulesProxy.types';
6
6
  import { requireNativeViewManager } from './NativeViewManagerAdapter';
7
7
  import Platform from './Platform';
8
8
  import SharedObject from './SharedObject';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,8BAA8B,CAAC;AACtC,OAAO,aAAa,CAAC;AAErB,mBAAmB,0BAA0B,CAAC;AAE9C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEzC,OAAO,EACL,iBAAiB,EACjB,QAAQ,EACR,wBAAwB,EAExB,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,YAAY,EAEZ,UAAU,EACV,mBAAmB,EAEnB,iBAAiB,EAEjB,kBAAkB,EAClB,kBAAkB,GACnB,CAAC;AAEF,cAAc,uBAAuB,CAAC;AACtC,cAAc,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C;AAElC,cAAc,QAAQ,CAAC;AAEvB,cAAc,kCAAkC,CAAC;AACjD,cAAc,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../src/uuid/uuid.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AA+BrD,QAAA,MAAM,IAAI,EAAE,IAIX,CAAC;AACF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../src/uuid/uuid.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AAgCrD,QAAA,MAAM,IAAI,EAAE,IAIX,CAAC;AACF,eAAe,IAAI,CAAC"}
@@ -9,6 +9,16 @@ extension ExpoSwiftUI {
9
9
  struct UIViewHost: UIViewRepresentable {
10
10
  let view: UIView
11
11
 
12
+ #if os(macOS)
13
+ func makeNSView(context: Context) -> NSView {
14
+ return view
15
+ }
16
+
17
+ func updateNSView(_ nsView: NSView, context: Context) {
18
+ // Nothing to do here
19
+ }
20
+ #endif
21
+
12
22
  func makeUIView(context: Context) -> UIView {
13
23
  return view
14
24
  }
@@ -10,5 +10,6 @@ public typealias UIResponder = NSResponder
10
10
  public typealias UIApplicationDelegate = NSApplicationDelegate
11
11
  public typealias UIWindow = NSWindow
12
12
  public typealias UIHostingController = NSHostingController
13
+ public typealias UIViewRepresentable = NSViewRepresentable
13
14
 
14
15
  #endif // os(macOS)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-modules-core",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "The core of Expo Modules architecture",
5
5
  "main": "src/index.ts",
6
6
  "types": "build/index.d.ts",
@@ -44,5 +44,5 @@
44
44
  "@testing-library/react-native": "^12.5.2",
45
45
  "expo-module-scripts": "^4.0.0"
46
46
  },
47
- "gitHead": "bc1fea6bcab47889e2922d543920397691b200f3"
47
+ "gitHead": "637acf537a92ac6209bfced71e097ba736b43fef"
48
48
  }
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { NativeModules } from 'react-native';
7
7
 
8
- import { ProxyNativeModule } from './NativeModulesProxy.types';
8
+ import type { ProxyNativeModule } from './NativeModulesProxy.types';
9
9
 
10
10
  const LegacyNativeProxy = NativeModules.NativeUnimoduleProxy;
11
11
  // Fixes `cannot find name 'global'.` in tests
@@ -1,4 +1,4 @@
1
- import { ProxyNativeModule } from './NativeModulesProxy.types';
1
+ import type { ProxyNativeModule } from './NativeModulesProxy.types';
2
2
 
3
3
  // We default to an empty object shim wherever we don't have an environment-specific implementation
4
4
 
package/src/index.ts CHANGED
@@ -2,7 +2,7 @@ import EventEmitter, { type EventSubscription } from './EventEmitter';
2
2
  import { LegacyEventEmitter } from './LegacyEventEmitter';
3
3
  import NativeModule from './NativeModule';
4
4
  import NativeModulesProxy from './NativeModulesProxy';
5
- import { ProxyNativeModule } from './NativeModulesProxy.types';
5
+ import type { ProxyNativeModule } from './NativeModulesProxy.types';
6
6
  import { requireNativeViewManager } from './NativeViewManagerAdapter';
7
7
  import Platform from './Platform';
8
8
  import SharedObject from './SharedObject';
package/src/uuid/uuid.ts CHANGED
@@ -1,10 +1,9 @@
1
1
  import bytesToUuid from './lib/bytesToUuid';
2
2
  import { UUID, Uuidv5Namespace } from './uuid.types';
3
3
 
4
- const nativeUuidv4 = globalThis?.expo?.uuidv4;
5
- const nativeUuidv5 = globalThis?.expo?.uuidv5;
6
-
7
4
  function uuidv4(): string {
5
+ const nativeUuidv4 = globalThis?.expo?.uuidv4;
6
+
8
7
  if (!nativeUuidv4) {
9
8
  throw Error(
10
9
  "Native UUID version 4 generator implementation wasn't found in `expo-modules-core`"
@@ -23,6 +22,8 @@ function uuidv5(name: string, namespace: string | number[]) {
23
22
  throw new Error('`namespace` must be a valid UUID string or an Array of 16 byte values');
24
23
  }
25
24
 
25
+ const nativeUuidv5 = globalThis?.expo?.uuidv5;
26
+
26
27
  if (!nativeUuidv5) {
27
28
  throw Error("Native UUID type 5 generator implementation wasn't found in `expo-modules-core`");
28
29
  }