expo-modules-core 1.5.3 → 1.5.4

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,16 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 1.5.4 — 2023-07-04
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Fix the `View cannot be cast to ViewGroup` exception on Android. ([#23264](https://github.com/expo/expo/pull/23264) by [@lukmccall](https://github.com/lukmccall))
18
+
19
+ ### 💡 Others
20
+
21
+ - Changed Objective-C names for `ExpoReactDelegate` and `ExpoReactDelegateHandler` to fix issues with versioning in Expo Go. ([#23229](https://github.com/expo/expo/pull/23229) by [@tsapeta](https://github.com/tsapeta))
22
+
13
23
  ## 1.5.3 — 2023-06-24
14
24
 
15
25
  ### 🎉 New features
@@ -6,7 +6,7 @@ apply plugin: 'maven-publish'
6
6
  apply plugin: "de.undercouch.download"
7
7
 
8
8
  group = 'host.exp.exponent'
9
- version = '1.5.3'
9
+ version = '1.5.4'
10
10
 
11
11
  buildscript {
12
12
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
@@ -160,7 +160,7 @@ android {
160
160
  targetSdkVersion safeExtGet("targetSdkVersion", 33)
161
161
  consumerProguardFiles 'proguard-rules.pro'
162
162
  versionCode 1
163
- versionName "1.5.3"
163
+ versionName "1.5.4"
164
164
  buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled.toString()
165
165
 
166
166
  testInstrumentationRunner "expo.modules.TestRunner"
@@ -0,0 +1,11 @@
1
+ package expo.modules.kotlin.views
2
+
3
+ import android.content.Context
4
+ import android.view.ViewGroup
5
+
6
+ /**
7
+ * A NOOP view group, which is used when an error occurs.
8
+ */
9
+ class ErrorViewGroup(context: Context) : ViewGroup(context) {
10
+ override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) = Unit
11
+ }
@@ -334,7 +334,12 @@ class ViewDefinitionBuilder<T : View>(
334
334
  UnexpectedException(e)
335
335
  }
336
336
  )
337
- return View(context)
337
+
338
+ return if (ViewGroup::class.java.isAssignableFrom(viewClass.java)) {
339
+ ErrorViewGroup(context)
340
+ } else {
341
+ View(context)
342
+ }
338
343
  }
339
344
 
340
345
  private fun getPrimaryConstructor(): KFunction<T>? {
@@ -10,5 +10,5 @@ if (__DEV__ && Platform.OS === 'android' && NativeErrorManager) {
10
10
  });
11
11
  }
12
12
  // We have to export `CodedError` via global object to use in later in the C++ code.
13
- global.ExpoModulesCore_CodedError = CodedError;
13
+ globalThis.ExpoModulesCore_CodedError = CodedError;
14
14
  //# sourceMappingURL=setUpErrorManager.fx.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"setUpErrorManager.fx.js","sourceRoot":"","sources":["../../src/sweet/setUpErrorManager.fx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,IAAI,OAAO,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,IAAI,kBAAkB,EAAE;IAC9D,MAAM,cAAc,GAAG,4CAA4C,CAAC;IACpE,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC,kBAAkB,CAAC,CAAC;IAE1D,YAAY,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,EAAE,OAAO,EAAuB,EAAE,EAAE;QAC5E,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;CACJ;AAED,oFAAoF;AACpF,MAAM,CAAC,0BAA0B,GAAG,UAAU,CAAC","sourcesContent":["import { EventEmitter } from '../EventEmitter';\nimport Platform from '../Platform';\nimport { CodedError } from '../errors/CodedError';\nimport NativeErrorManager from './NativeErrorManager';\n\nif (__DEV__ && Platform.OS === 'android' && NativeErrorManager) {\n const onNewException = 'ExpoModulesCoreErrorManager.onNewException';\n const eventEmitter = new EventEmitter(NativeErrorManager);\n\n eventEmitter.addListener(onNewException, ({ message }: { message: string }) => {\n console.error(message);\n });\n}\n\n// We have to export `CodedError` via global object to use in later in the C++ code.\nglobal.ExpoModulesCore_CodedError = CodedError;\n"]}
1
+ {"version":3,"file":"setUpErrorManager.fx.js","sourceRoot":"","sources":["../../src/sweet/setUpErrorManager.fx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,IAAI,OAAO,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,IAAI,kBAAkB,EAAE;IAC9D,MAAM,cAAc,GAAG,4CAA4C,CAAC;IACpE,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC,kBAAkB,CAAC,CAAC;IAE1D,YAAY,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,EAAE,OAAO,EAAuB,EAAE,EAAE;QAC5E,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;CACJ;AAED,oFAAoF;AACpF,UAAU,CAAC,0BAA0B,GAAG,UAAU,CAAC","sourcesContent":["import { EventEmitter } from '../EventEmitter';\nimport Platform from '../Platform';\nimport { CodedError } from '../errors/CodedError';\nimport NativeErrorManager from './NativeErrorManager';\n\nif (__DEV__ && Platform.OS === 'android' && NativeErrorManager) {\n const onNewException = 'ExpoModulesCoreErrorManager.onNewException';\n const eventEmitter = new EventEmitter(NativeErrorManager);\n\n eventEmitter.addListener(onNewException, ({ message }: { message: string }) => {\n console.error(message);\n });\n}\n\n// We have to export `CodedError` via global object to use in later in the C++ code.\nglobalThis.ExpoModulesCore_CodedError = CodedError;\n"]}
@@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
11
11
  */
12
12
  @interface EXReactDelegateWrapper(Private)
13
13
 
14
- - (instancetype)initWithExpoReactDelegate:(ExpoReactDelegate *)expoReactDelegate;
14
+ - (instancetype)initWithExpoReactDelegate:(EXReactDelegate *)expoReactDelegate;
15
15
 
16
16
  @end
17
17
 
@@ -7,13 +7,13 @@
7
7
 
8
8
  @interface EXReactDelegateWrapper()
9
9
 
10
- @property (nonatomic, weak) ExpoReactDelegate *expoReactDelegate;
10
+ @property (nonatomic, weak) EXReactDelegate *expoReactDelegate;
11
11
 
12
12
  @end
13
13
 
14
14
  @implementation EXReactDelegateWrapper
15
15
 
16
- - (instancetype)initWithExpoReactDelegate:(ExpoReactDelegate *)expoReactDelegate
16
+ - (instancetype)initWithExpoReactDelegate:(EXReactDelegate *)expoReactDelegate
17
17
  {
18
18
  if (self = [super init]) {
19
19
  _expoReactDelegate = expoReactDelegate;
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  An extensible react instance creation delegate. This class will loop through each `ExpoReactDelegateHandler` to determine the winner to create the instance.
5
5
  */
6
- @objc
6
+ @objc(EXReactDelegate)
7
7
  public class ExpoReactDelegate: NSObject {
8
8
  private let handlers: [ExpoReactDelegateHandler]
9
9
 
@@ -5,7 +5,7 @@ import React
5
5
  /**
6
6
  The handler for `ExpoReactDelegate`. A module can implement a handler to process react instance creation.
7
7
  */
8
- @objc
8
+ @objc(EXReactDelegateHandler)
9
9
  open class ExpoReactDelegateHandler: NSObject {
10
10
  public override required init() {}
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-modules-core",
3
- "version": "1.5.3",
3
+ "version": "1.5.4",
4
4
  "description": "The core of Expo Modules architecture",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -42,5 +42,5 @@
42
42
  "@testing-library/react-hooks": "^7.0.1",
43
43
  "expo-module-scripts": "^3.0.0"
44
44
  },
45
- "gitHead": "19e6561830e33168b1c963ec50b7248baafbb758"
45
+ "gitHead": "cf90d5c30c2a08a6493ebfa8aa3791aa70666759"
46
46
  }
@@ -13,4 +13,4 @@ if (__DEV__ && Platform.OS === 'android' && NativeErrorManager) {
13
13
  }
14
14
 
15
15
  // We have to export `CodedError` via global object to use in later in the C++ code.
16
- global.ExpoModulesCore_CodedError = CodedError;
16
+ globalThis.ExpoModulesCore_CodedError = CodedError;