expo-splash-screen 0.23.1 → 0.25.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.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,31 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 0.25.0 — 2023-11-14
14
+
15
+ ### 🛠 Breaking changes
16
+
17
+ - Bumped iOS deployment target to 13.4. ([#25063](https://github.com/expo/expo/pull/25063) by [@gabrieldonadel](https://github.com/gabrieldonadel))
18
+ - On `Android` bump `compileSdkVersion` and `targetSdkVersion` to `34`. ([#24708](https://github.com/expo/expo/pull/24708) by [@alanjhughes](https://github.com/alanjhughes))
19
+
20
+ ### 🎉 New features
21
+
22
+ - Automatically dismiss splash screen when an error is thrown to prevent blocking error information. ([#24893](https://github.com/expo/expo/pull/24893) by [@EvanBacon](https://github.com/EvanBacon))
23
+
24
+ ### 💡 Others
25
+
26
+ - Moved changes required for splash screen orchestration from `expo-router` to `expo-splash-screen`. ([#24893](https://github.com/expo/expo/pull/24893) by [@EvanBacon](https://github.com/EvanBacon))
27
+
28
+ ## 0.24.0 — 2023-10-17
29
+
30
+ ### 🛠 Breaking changes
31
+
32
+ - Dropped support for Android SDK 21 and 22. ([#24201](https://github.com/expo/expo/pull/24201) by [@behenate](https://github.com/behenate))
33
+
34
+ ### 🐛 Bug fixes
35
+
36
+ - On Android, remove `isClickable` on `SplashScreenView` that caused incorrect behaviour with `TalkBack`. ([#24601](https://github.com/expo/expo/pull/24601) by [@alanhughes](https://github.com/alanjhughes))
37
+
13
38
  ## 0.23.1 — 2023-09-18
14
39
 
15
40
  _This version does not introduce any user-facing changes._
@@ -3,15 +3,20 @@ apply plugin: 'kotlin-android'
3
3
  apply plugin: 'maven-publish'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '0.23.1'
6
+ version = '0.25.0'
7
7
 
8
- buildscript {
9
- def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
10
- if (expoModulesCorePlugin.exists()) {
11
- apply from: expoModulesCorePlugin
12
- applyKotlinExpoModulesCorePlugin()
8
+ def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
9
+ if (expoModulesCorePlugin.exists()) {
10
+ apply from: expoModulesCorePlugin
11
+ applyKotlinExpoModulesCorePlugin()
12
+ // Remove this check, but keep the contents after SDK49 support is dropped
13
+ if (safeExtGet("expoProvidesDefaultConfig", false)) {
14
+ useExpoPublishing()
15
+ useCoreDependencies()
13
16
  }
17
+ }
14
18
 
19
+ buildscript {
15
20
  // Simple helper that allows the root project to override versions declared by this library.
16
21
  ext.safeExtGet = { prop, fallback ->
17
22
  rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
@@ -35,23 +40,44 @@ buildscript {
35
40
  }
36
41
  }
37
42
 
38
- afterEvaluate {
39
- publishing {
40
- publications {
41
- release(MavenPublication) {
42
- from components.release
43
+ // Remove this if and it's contents, when support for SDK49 is dropped
44
+ if (!safeExtGet("expoProvidesDefaultConfig", false)) {
45
+ afterEvaluate {
46
+ publishing {
47
+ publications {
48
+ release(MavenPublication) {
49
+ from components.release
50
+ }
43
51
  }
44
- }
45
- repositories {
46
- maven {
47
- url = mavenLocal().url
52
+ repositories {
53
+ maven {
54
+ url = mavenLocal().url
55
+ }
48
56
  }
49
57
  }
50
58
  }
51
59
  }
52
60
 
53
61
  android {
54
- compileSdkVersion safeExtGet("compileSdkVersion", 33)
62
+ // Remove this if and it's contents, when support for SDK49 is dropped
63
+ if (!safeExtGet("expoProvidesDefaultConfig", false)) {
64
+ compileSdkVersion safeExtGet("compileSdkVersion", 34)
65
+
66
+ defaultConfig {
67
+ minSdkVersion safeExtGet("minSdkVersion", 23)
68
+ targetSdkVersion safeExtGet("targetSdkVersion", 34)
69
+ }
70
+
71
+ publishing {
72
+ singleVariant("release") {
73
+ withSourcesJar()
74
+ }
75
+ }
76
+
77
+ lintOptions {
78
+ abortOnError false
79
+ }
80
+ }
55
81
 
56
82
  def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
57
83
  if (agpVersion.tokenize('.')[0].toInteger() < 8) {
@@ -67,27 +93,20 @@ android {
67
93
 
68
94
  namespace "expo.modules.splashscreen"
69
95
  defaultConfig {
70
- minSdkVersion safeExtGet('minSdkVersion', 21)
71
- targetSdkVersion safeExtGet("targetSdkVersion", 33)
72
96
  versionCode 17
73
- versionName '0.23.1'
74
- }
75
- lintOptions {
76
- abortOnError false
77
- }
78
- publishing {
79
- singleVariant("release") {
80
- withSourcesJar()
81
- }
97
+ versionName '0.25.0'
82
98
  }
83
99
  }
84
100
 
85
101
  dependencies {
86
- implementation project(':expo-modules-core')
102
+ // Remove this if and it's contents, when support for SDK49 is dropped
103
+ if (!safeExtGet("expoProvidesDefaultConfig", false)) {
104
+ implementation project(':expo-modules-core')
105
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
106
+ }
87
107
 
88
108
  //noinspection GradleDynamicVersion
89
109
  implementation 'com.facebook.react:react-native:+'
90
110
  implementation 'androidx.appcompat:appcompat:1.2.0'
91
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
92
111
  implementation "org.jetbrains.kotlin:kotlin-reflect:${getKotlinVersion()}"
93
112
  }
@@ -24,7 +24,6 @@ class SplashScreenView(
24
24
 
25
25
  init {
26
26
  layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
27
- isClickable = true
28
27
 
29
28
  addView(imageView)
30
29
  }
@@ -1,2 +1,20 @@
1
- export declare const preventAutoHideAsync: () => Promise<boolean>, hideAsync: () => Promise<boolean>;
1
+ /**
2
+ * Expo Router uses this internal method to ensure that we can detect if the user
3
+ * has explicitly opted into preventing the splash screen from hiding. This means
4
+ * they will also explicitly hide it. If they don't, we will hide it for them after
5
+ * the navigation render completes.
6
+ *
7
+ * @private
8
+ */
9
+ export declare const _internal_preventAutoHideAsync: () => void;
10
+ /**
11
+ * Used for Expo libraries to attempt hiding the splash screen after they've completed their work.
12
+ * If the user has explicitly opted into preventing the splash screen from hiding, we should not
13
+ * hide it for them. This is often used for animated splash screens.
14
+ *
15
+ * @private
16
+ */
17
+ export declare const _internal_maybeHideAsync: () => void;
18
+ export declare function hideAsync(): Promise<boolean | void>;
19
+ export declare const preventAutoHideAsync: () => void;
2
20
  //# sourceMappingURL=index.native.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAEA,eAAO,MAAQ,oBAAoB,QACL,QAAQ,OAAO,CAAC,EADT,SAAS,QAE3B,QAAQ,OAAO,CACjC,CAAC"}
1
+ {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAUA;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B,YAkB1C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,YAOpC,CAAC;AAEF,wBAAgB,SAAS,4BAYxB;AAED,eAAO,MAAM,oBAAoB,YAKhC,CAAC"}
@@ -1,3 +1,63 @@
1
1
  import { requireNativeModule } from 'expo-modules-core';
2
- export const { preventAutoHideAsync, hideAsync } = requireNativeModule('ExpoSplashScreen');
2
+ const SplashModule = requireNativeModule('ExpoSplashScreen');
3
+ let _userControlledAutoHideEnabled = false;
4
+ let _preventAutoHideAsyncInvoked = false;
5
+ /**
6
+ * Expo Router uses this internal method to ensure that we can detect if the user
7
+ * has explicitly opted into preventing the splash screen from hiding. This means
8
+ * they will also explicitly hide it. If they don't, we will hide it for them after
9
+ * the navigation render completes.
10
+ *
11
+ * @private
12
+ */
13
+ export const _internal_preventAutoHideAsync = () => {
14
+ // Memoize, this should only be called once.
15
+ if (_preventAutoHideAsyncInvoked) {
16
+ return;
17
+ }
18
+ _preventAutoHideAsyncInvoked = true;
19
+ // Append error handling to ensure any uncaught exceptions result in the splash screen being hidden.
20
+ // This prevents the splash screen from floating over error screens.
21
+ if (ErrorUtils?.getGlobalHandler) {
22
+ const originalHandler = ErrorUtils.getGlobalHandler();
23
+ ErrorUtils.setGlobalHandler((error, isFatal) => {
24
+ hideAsync();
25
+ originalHandler(error, isFatal);
26
+ });
27
+ }
28
+ SplashModule.preventAutoHideAsync();
29
+ };
30
+ /**
31
+ * Used for Expo libraries to attempt hiding the splash screen after they've completed their work.
32
+ * If the user has explicitly opted into preventing the splash screen from hiding, we should not
33
+ * hide it for them. This is often used for animated splash screens.
34
+ *
35
+ * @private
36
+ */
37
+ export const _internal_maybeHideAsync = () => {
38
+ // If the user has explicitly opted into preventing the splash screen from hiding,
39
+ // we should not hide it for them. This is often used for animated splash screens.
40
+ if (_userControlledAutoHideEnabled) {
41
+ return;
42
+ }
43
+ hideAsync();
44
+ };
45
+ export function hideAsync() {
46
+ return SplashModule.hideAsync().catch((error) => {
47
+ // Hide this very unfortunate error.
48
+ if (
49
+ // Only throw the error is something unexpected happened.
50
+ _preventAutoHideAsyncInvoked &&
51
+ error.message.includes('No native splash screen registered for ')) {
52
+ return;
53
+ }
54
+ throw error;
55
+ });
56
+ }
57
+ export const preventAutoHideAsync = () => {
58
+ // Indicate that the user is controlling the auto hide behavior.
59
+ _userControlledAutoHideEnabled = true;
60
+ // Prevent as usual...
61
+ _internal_preventAutoHideAsync();
62
+ };
3
63
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,CAAC,MAAM,EAAE,oBAAoB,EAAE,SAAS,EAAE,GAAG,mBAAmB,CAAC,kBAAkB,CAGxF,CAAC","sourcesContent":["import { requireNativeModule } from 'expo-modules-core';\n\nexport const { preventAutoHideAsync, hideAsync } = requireNativeModule('ExpoSplashScreen') as {\n preventAutoHideAsync: () => Promise<boolean>;\n hideAsync: () => Promise<boolean>;\n};\n"]}
1
+ {"version":3,"file":"index.native.js","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,YAAY,GAAG,mBAAmB,CAAC,kBAAkB,CAG1D,CAAC;AAEF,IAAI,8BAA8B,GAAG,KAAK,CAAC;AAC3C,IAAI,4BAA4B,GAAG,KAAK,CAAC;AAEzC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAG,EAAE;IACjD,4CAA4C;IAC5C,IAAI,4BAA4B,EAAE;QAChC,OAAO;KACR;IACD,4BAA4B,GAAG,IAAI,CAAC;IAEpC,oGAAoG;IACpG,oEAAoE;IACpE,IAAI,UAAU,EAAE,gBAAgB,EAAE;QAChC,MAAM,eAAe,GAAG,UAAU,CAAC,gBAAgB,EAAE,CAAC;QACtD,UAAU,CAAC,gBAAgB,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;YAC7C,SAAS,EAAE,CAAC;YACZ,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;KACJ;IAED,YAAY,CAAC,oBAAoB,EAAE,CAAC;AACtC,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,EAAE;IAC3C,kFAAkF;IAClF,kFAAkF;IAClF,IAAI,8BAA8B,EAAE;QAClC,OAAO;KACR;IACD,SAAS,EAAE,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,UAAU,SAAS;IACvB,OAAO,YAAY,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,KAAU,EAAE,EAAE;QACnD,oCAAoC;QACpC;QACE,yDAAyD;QACzD,4BAA4B;YAC5B,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,yCAAyC,CAAC,EACjE;YACA,OAAO;SACR;QACD,MAAM,KAAK,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACvC,gEAAgE;IAChE,8BAA8B,GAAG,IAAI,CAAC;IACtC,sBAAsB;IACtB,8BAA8B,EAAE,CAAC;AACnC,CAAC,CAAC","sourcesContent":["import { requireNativeModule } from 'expo-modules-core';\n\nconst SplashModule = requireNativeModule('ExpoSplashScreen') as {\n preventAutoHideAsync: () => Promise<boolean>;\n hideAsync: () => Promise<boolean>;\n};\n\nlet _userControlledAutoHideEnabled = false;\nlet _preventAutoHideAsyncInvoked = false;\n\n/**\n * Expo Router uses this internal method to ensure that we can detect if the user\n * has explicitly opted into preventing the splash screen from hiding. This means\n * they will also explicitly hide it. If they don't, we will hide it for them after\n * the navigation render completes.\n *\n * @private\n */\nexport const _internal_preventAutoHideAsync = () => {\n // Memoize, this should only be called once.\n if (_preventAutoHideAsyncInvoked) {\n return;\n }\n _preventAutoHideAsyncInvoked = true;\n\n // Append error handling to ensure any uncaught exceptions result in the splash screen being hidden.\n // This prevents the splash screen from floating over error screens.\n if (ErrorUtils?.getGlobalHandler) {\n const originalHandler = ErrorUtils.getGlobalHandler();\n ErrorUtils.setGlobalHandler((error, isFatal) => {\n hideAsync();\n originalHandler(error, isFatal);\n });\n }\n\n SplashModule.preventAutoHideAsync();\n};\n\n/**\n * Used for Expo libraries to attempt hiding the splash screen after they've completed their work.\n * If the user has explicitly opted into preventing the splash screen from hiding, we should not\n * hide it for them. This is often used for animated splash screens.\n *\n * @private\n */\nexport const _internal_maybeHideAsync = () => {\n // If the user has explicitly opted into preventing the splash screen from hiding,\n // we should not hide it for them. This is often used for animated splash screens.\n if (_userControlledAutoHideEnabled) {\n return;\n }\n hideAsync();\n};\n\nexport function hideAsync() {\n return SplashModule.hideAsync().catch((error: any) => {\n // Hide this very unfortunate error.\n if (\n // Only throw the error is something unexpected happened.\n _preventAutoHideAsyncInvoked &&\n error.message.includes('No native splash screen registered for ')\n ) {\n return;\n }\n throw error;\n });\n}\n\nexport const preventAutoHideAsync = () => {\n // Indicate that the user is controlling the auto hide behavior.\n _userControlledAutoHideEnabled = true;\n // Prevent as usual...\n _internal_preventAutoHideAsync();\n};\n"]}
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
10
10
  s.license = package['license']
11
11
  s.author = package['author']
12
12
  s.homepage = package['homepage']
13
- s.platforms = { :ios => '13.0', :tvos => '13.0' }
13
+ s.platforms = { :ios => '13.4', :tvos => '13.4' }
14
14
  s.source = { git: 'https://github.com/expo/expo.git' }
15
15
  s.static_framework = true
16
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-splash-screen",
3
- "version": "0.23.1",
3
+ "version": "0.25.0",
4
4
  "description": "Provides a module to allow keeping the native Splash Screen visible until you choose to hide it.",
5
5
  "main": "build",
6
6
  "types": "build",
@@ -34,7 +34,7 @@
34
34
  "license": "MIT",
35
35
  "homepage": "https://docs.expo.dev/versions/latest/sdk/splash-screen/",
36
36
  "dependencies": {
37
- "@expo/prebuild-config": "6.4.1"
37
+ "@expo/prebuild-config": "6.6.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "expo-module-scripts": "^3.0.0"
@@ -42,5 +42,5 @@
42
42
  "peerDependencies": {
43
43
  "expo": "*"
44
44
  },
45
- "gitHead": "62f76105dfb436f7144440d6e6077d4ff3263842"
45
+ "gitHead": "3142a086578deffd8704a8f1b6f0f661527d836c"
46
46
  }
@@ -1,6 +1,74 @@
1
1
  import { requireNativeModule } from 'expo-modules-core';
2
2
 
3
- export const { preventAutoHideAsync, hideAsync } = requireNativeModule('ExpoSplashScreen') as {
3
+ const SplashModule = requireNativeModule('ExpoSplashScreen') as {
4
4
  preventAutoHideAsync: () => Promise<boolean>;
5
5
  hideAsync: () => Promise<boolean>;
6
6
  };
7
+
8
+ let _userControlledAutoHideEnabled = false;
9
+ let _preventAutoHideAsyncInvoked = false;
10
+
11
+ /**
12
+ * Expo Router uses this internal method to ensure that we can detect if the user
13
+ * has explicitly opted into preventing the splash screen from hiding. This means
14
+ * they will also explicitly hide it. If they don't, we will hide it for them after
15
+ * the navigation render completes.
16
+ *
17
+ * @private
18
+ */
19
+ export const _internal_preventAutoHideAsync = () => {
20
+ // Memoize, this should only be called once.
21
+ if (_preventAutoHideAsyncInvoked) {
22
+ return;
23
+ }
24
+ _preventAutoHideAsyncInvoked = true;
25
+
26
+ // Append error handling to ensure any uncaught exceptions result in the splash screen being hidden.
27
+ // This prevents the splash screen from floating over error screens.
28
+ if (ErrorUtils?.getGlobalHandler) {
29
+ const originalHandler = ErrorUtils.getGlobalHandler();
30
+ ErrorUtils.setGlobalHandler((error, isFatal) => {
31
+ hideAsync();
32
+ originalHandler(error, isFatal);
33
+ });
34
+ }
35
+
36
+ SplashModule.preventAutoHideAsync();
37
+ };
38
+
39
+ /**
40
+ * Used for Expo libraries to attempt hiding the splash screen after they've completed their work.
41
+ * If the user has explicitly opted into preventing the splash screen from hiding, we should not
42
+ * hide it for them. This is often used for animated splash screens.
43
+ *
44
+ * @private
45
+ */
46
+ export const _internal_maybeHideAsync = () => {
47
+ // If the user has explicitly opted into preventing the splash screen from hiding,
48
+ // we should not hide it for them. This is often used for animated splash screens.
49
+ if (_userControlledAutoHideEnabled) {
50
+ return;
51
+ }
52
+ hideAsync();
53
+ };
54
+
55
+ export function hideAsync() {
56
+ return SplashModule.hideAsync().catch((error: any) => {
57
+ // Hide this very unfortunate error.
58
+ if (
59
+ // Only throw the error is something unexpected happened.
60
+ _preventAutoHideAsyncInvoked &&
61
+ error.message.includes('No native splash screen registered for ')
62
+ ) {
63
+ return;
64
+ }
65
+ throw error;
66
+ });
67
+ }
68
+
69
+ export const preventAutoHideAsync = () => {
70
+ // Indicate that the user is controlling the auto hide behavior.
71
+ _userControlledAutoHideEnabled = true;
72
+ // Prevent as usual...
73
+ _internal_preventAutoHideAsync();
74
+ };