expo-modules-core 0.13.4 → 1.0.1

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,20 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 1.0.1 — 2022-11-07
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Added a list of the acceptable enum values to the conversion error on Android. ([#19895](https://github.com/expo/expo/pull/19895) by [@lukmccall](https://github.com/lukmccall))
18
+
19
+ ### 💡 Others
20
+
21
+ - Exposed coroutines related packages on Android. ([#19896](https://github.com/expo/expo/pull/19896) by [@lukmccall](https://github.com/lukmccall))
22
+
23
+ ## 1.0.0 — 2022-11-03
24
+
25
+ _This version does not introduce any user-facing changes._
26
+
13
27
  ## 0.13.4 — 2022-11-02
14
28
 
15
29
  ### 🐛 Bug fixes
@@ -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 = '0.13.4'
9
+ version = '1.0.1'
10
10
 
11
11
  buildscript {
12
12
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
@@ -191,7 +191,7 @@ android {
191
191
  targetSdkVersion safeExtGet("targetSdkVersion", 31)
192
192
  consumerProguardFiles 'proguard-rules.pro'
193
193
  versionCode 1
194
- versionName "0.13.4"
194
+ versionName "1.0.1"
195
195
  buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled.toString()
196
196
 
197
197
  testInstrumentationRunner "expo.modules.TestRunner"
@@ -289,7 +289,11 @@ dependencies {
289
289
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
290
290
  implementation "org.jetbrains.kotlin:kotlin-reflect:${getKotlinVersion()}"
291
291
  implementation 'androidx.annotation:annotation:1.3.0'
292
- implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0"
292
+
293
+ api "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0"
294
+ api "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0"
295
+ api "androidx.core:core-ktx:1.6.0"
296
+
293
297
  /**
294
298
  * ReactActivity (the base activity for every React Native application) is subclassing AndroidX classes.
295
299
  * Unfortunately until https://github.com/facebook/react-native/pull/33072 is released React Native uses "androidx.appcompat:appcompat:1.0.2".
@@ -71,6 +71,14 @@ internal class IncompatibleArgTypeException(
71
71
  cause = cause
72
72
  )
73
73
 
74
+ internal class EnumNoSuchValueException(
75
+ enumType: KClass<Enum<*>>,
76
+ enumConstants: Array<out Enum<*>>,
77
+ value: Any?
78
+ ) : CodedException(
79
+ message = "'$value' is not present in ${enumType.simpleName} enum, it must be one of: ${enumConstants.joinToString(separator = ", ") { "'${it.name}'" }}"
80
+ )
81
+
74
82
  internal class MissingTypeConverter(
75
83
  forType: KType
76
84
  ) : CodedException(
@@ -1,6 +1,7 @@
1
1
  package expo.modules.kotlin.types
2
2
 
3
3
  import com.facebook.react.bridge.Dynamic
4
+ import expo.modules.kotlin.exception.EnumNoSuchValueException
4
5
  import expo.modules.kotlin.exception.IncompatibleArgTypeException
5
6
  import expo.modules.kotlin.jni.ExpectedType
6
7
  import expo.modules.kotlin.logger
@@ -73,9 +74,8 @@ class EnumTypeConverter(
73
74
  stringRepresentation: String,
74
75
  enumConstants: Array<out Enum<*>>
75
76
  ): Enum<*> {
76
- return requireNotNull(
77
- enumConstants.find { it.name == stringRepresentation }
78
- ) { "Couldn't convert '$stringRepresentation' to ${enumClass.simpleName}" }
77
+ return enumConstants.find { it.name == stringRepresentation }
78
+ ?: throw EnumNoSuchValueException(enumClass, enumConstants, stringRepresentation)
79
79
  }
80
80
 
81
81
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-modules-core",
3
- "version": "0.13.4",
3
+ "version": "1.0.1",
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": "1a87dcc55895a9e16e3d4fd0fa78f2244c1d961f"
45
+ "gitHead": "029acef85addf3f25136a50d0a7a178bd0b109dc"
46
46
  }