expo 44.0.0-alpha.0 → 44.0.0-beta.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.
@@ -8,7 +8,7 @@ apply from: "../scripts/autolinking.gradle"
8
8
  ensureDependeciesWereEvaluated(project)
9
9
 
10
10
  group = 'host.exp.exponent'
11
- version = '44.0.0-alpha.0'
11
+ version = '44.0.0-beta.0'
12
12
 
13
13
  buildscript {
14
14
  // Simple helper that allows the root project to override versions declared by this library.
@@ -62,7 +62,7 @@ android {
62
62
  minSdkVersion safeExtGet("minSdkVersion", 21)
63
63
  targetSdkVersion safeExtGet("targetSdkVersion", 30)
64
64
  versionCode 1
65
- versionName "44.0.0-alpha.0"
65
+ versionName "44.0.0-beta.0"
66
66
  consumerProguardFiles("proguard-rules.pro")
67
67
  }
68
68
  lintOptions {
@@ -33,7 +33,7 @@ class ReactActivityDelegateWrapper(
33
33
 
34
34
  override fun createRootView(): ReactRootView {
35
35
  return reactActivityHandlers.asSequence()
36
- .map { it.createReactRootView(activity) }
36
+ .mapNotNull { it.createReactRootView(activity) }
37
37
  .firstOrNull() ?: invokeDelegateMethod("createRootView")
38
38
  }
39
39
 
@@ -29,11 +29,11 @@ class ReactNativeHostWrapper(
29
29
  }
30
30
 
31
31
  val result = reactNativeHostHandlers.asSequence()
32
- .map { it.createReactInstanceManager(developerSupport) }
32
+ .mapNotNull { it.createReactInstanceManager(developerSupport) }
33
33
  .firstOrNull() ?: super.createReactInstanceManager()
34
34
 
35
35
  reactNativeHostHandlers.forEach { handler ->
36
- handler.onDidCreateReactInstanceManager(developerSupport)
36
+ handler.onDidCreateReactInstanceManager(result, developerSupport)
37
37
  }
38
38
 
39
39
  return result
@@ -63,13 +63,13 @@ class ReactNativeHostWrapper(
63
63
 
64
64
  override fun getJSBundleFile(): String? {
65
65
  return reactNativeHostHandlers.asSequence()
66
- .map { it.getJSBundleFile(useDeveloperSupport) }
66
+ .mapNotNull { it.getJSBundleFile(useDeveloperSupport) }
67
67
  .firstOrNull() ?: invokeDelegateMethod<String?>("getJSBundleFile")
68
68
  }
69
69
 
70
70
  override fun getBundleAssetName(): String? {
71
71
  return reactNativeHostHandlers.asSequence()
72
- .map { it.getBundleAssetName(useDeveloperSupport) }
72
+ .mapNotNull { it.getBundleAssetName(useDeveloperSupport) }
73
73
  .firstOrNull() ?: invokeDelegateMethod<String?>("getBundleAssetName")
74
74
  }
75
75
 
@@ -1,110 +1,112 @@
1
1
  {
2
2
  "@expo/vector-icons": "^12.0.0",
3
3
  "@react-native-async-storage/async-storage": "~1.15.0",
4
- "@react-native-community/datetimepicker": "3.5.2",
5
- "@react-native-masked-view/masked-view": "0.2.5",
6
- "@react-native-community/netinfo": "6.0.2",
7
- "@react-native-community/slider": "4.1.7",
4
+ "@react-native-community/datetimepicker": "4.0.0",
5
+ "@react-native-masked-view/masked-view": "0.2.6",
6
+ "@react-native-community/netinfo": "7.1.3",
7
+ "@react-native-community/slider": "4.1.12",
8
8
  "@react-native-community/viewpager": "5.0.11",
9
- "@react-native-picker/picker": "2.1.0",
9
+ "@react-native-picker/picker": "2.2.1",
10
10
  "@react-native-segmented-control/segmented-control": "2.4.0",
11
- "@stripe/stripe-react-native": "0.2.2",
11
+ "@stripe/stripe-react-native": "0.2.3",
12
12
  "@unimodules/core": "~7.2.0",
13
13
  "@unimodules/react-native-adapter": "~6.5.0",
14
- "expo-ads-admob": "~11.0.3",
15
- "expo-ads-facebook": "~11.0.3",
16
- "expo-analytics-amplitude": "~11.0.4",
17
- "expo-analytics-segment": "~11.0.3",
18
- "expo-app-auth": "~11.0.3",
14
+ "expo-ads-admob": "~12.0.0",
15
+ "expo-ads-facebook": "~11.1.0",
16
+ "expo-analytics-amplitude": "~11.1.0",
17
+ "expo-analytics-segment": "~11.1.0",
18
+ "expo-app-auth": "~11.1.0",
19
19
  "expo-app-loader-provider": "~8.0.0",
20
- "expo-app-loading": "~1.2.1",
21
- "expo-apple-authentication": "~4.0.3",
20
+ "expo-app-loading": "~1.3.0",
21
+ "expo-apple-authentication": "~4.1.0",
22
22
  "expo-application": "~4.0.1",
23
23
  "expo-asset": "~8.4.4",
24
- "expo-auth-session": "~3.4.2",
25
- "expo-av": "~10.1.3",
26
- "expo-background-fetch": "~10.0.3",
27
- "expo-barcode-scanner": "~11.1.2",
28
- "expo-battery": "~6.0.3",
29
- "expo-blur": "~10.0.3",
30
- "expo-branch": "~5.0.3",
31
- "expo-brightness": "~10.0.3",
32
- "expo-calendar": "~10.0.3",
33
- "expo-camera": "~12.0.3",
34
- "expo-cellular": "~4.0.0",
24
+ "expo-auth-session": "~3.5.0",
25
+ "expo-av": "~10.2.0",
26
+ "expo-background-fetch": "~10.1.0",
27
+ "expo-barcode-scanner": "~11.2.0",
28
+ "expo-battery": "~6.1.0",
29
+ "expo-blur": "~11.0.0",
30
+ "expo-branch": "~5.1.0",
31
+ "expo-brightness": "~10.1.0",
32
+ "expo-calendar": "~10.1.0",
33
+ "expo-camera": "~12.1.0",
34
+ "expo-cellular": "~4.1.0",
35
35
  "expo-checkbox": "~2.0.0",
36
- "expo-clipboard": "~2.0.3",
37
- "expo-constants": "~12.2.0",
38
- "expo-contacts": "~10.0.3",
39
- "expo-crypto": "~10.0.3",
40
- "expo-device": "~4.0.3",
41
- "expo-document-picker": "~10.0.3",
42
- "expo-dev-client": "~0.6.3",
43
- "expo-error-recovery": "~3.0.3",
44
- "expo-face-detector": "~11.0.3",
45
- "expo-facebook": "~12.0.3",
36
+ "expo-clipboard": "~2.1.0",
37
+ "expo-constants": "~13.0.0",
38
+ "expo-contacts": "~10.1.0",
39
+ "expo-crypto": "~10.1.0",
40
+ "expo-dev-client": "~0.7.1",
41
+ "expo-device": "~4.1.0",
42
+ "expo-document-picker": "~10.1.0",
43
+ "expo-error-recovery": "~3.0.4",
44
+ "expo-face-detector": "~11.1.0",
45
+ "expo-facebook": "~12.1.0",
46
46
  "expo-file-system": "~13.1.0",
47
- "expo-firebase-analytics": "~5.0.3",
48
- "expo-firebase-core": "~4.0.3",
49
- "expo-firebase-recaptcha": "~2.0.2",
47
+ "expo-firebase-analytics": "~6.0.0",
48
+ "expo-firebase-core": "~4.1.0",
49
+ "expo-firebase-recaptcha": "~2.1.0",
50
50
  "expo-font": "~10.0.4",
51
- "expo-gl": "~11.0.3",
52
- "expo-gl-cpp": "~11.0.1",
53
- "expo-google-app-auth": "~9.0.0",
54
- "expo-google-sign-in": "~10.0.3",
55
- "expo-haptics": "~11.0.3",
56
- "expo-image-loader": "~3.0.0",
57
- "expo-image-manipulator": "~10.1.2",
58
- "expo-image-picker": "~11.0.3",
59
- "expo-in-app-purchases": "~12.0.0",
60
- "expo-intent-launcher": "~10.0.3",
51
+ "expo-gl": "~11.1.0",
52
+ "expo-gl-cpp": "~11.1.0",
53
+ "expo-google-app-auth": "~8.3.0",
54
+ "expo-google-sign-in": "~10.1.0",
55
+ "expo-haptics": "~11.1.0",
56
+ "expo-image-loader": "~3.1.0",
57
+ "expo-image-manipulator": "~10.2.0",
58
+ "expo-image-picker": "~12.0.0",
59
+ "expo-in-app-purchases": "~12.1.0",
60
+ "expo-intent-launcher": "~10.1.0",
61
61
  "expo-keep-awake": "~10.0.1",
62
- "expo-linear-gradient": "~10.0.3",
63
- "expo-linking": "~2.4.2",
64
- "expo-local-authentication": "~12.0.1",
65
- "expo-localization": "~11.0.0",
66
- "expo-location": "~13.0.4",
67
- "expo-mail-composer": "~11.0.3",
68
- "expo-media-library": "~13.0.3",
69
- "expo-module-template": "~10.0.0",
70
- "expo-modules-core": "~0.5.0",
71
- "expo-network": "~4.0.3",
72
- "expo-notifications": "~0.13.3",
73
- "expo-permissions": "~13.0.3",
74
- "expo-print": "~11.0.3",
75
- "expo-random": "~12.0.1",
76
- "expo-screen-orientation": "~4.0.3",
77
- "expo-secure-store": "~11.0.3",
78
- "expo-sensors": "~11.0.3",
79
- "expo-sharing": "~10.0.3",
80
- "expo-sms": "~10.0.3",
81
- "expo-speech": "~10.0.3",
82
- "expo-splash-screen": "~0.13.4",
83
- "expo-sqlite": "~10.0.3",
84
- "expo-status-bar": "~1.1.0",
85
- "expo-store-review": "~5.0.3",
86
- "expo-task-manager": "~10.0.3",
87
- "expo-tracking-transparency": "~2.0.3",
88
- "expo-updates": "~0.10.9",
89
- "expo-video-thumbnails": "~6.0.3",
90
- "expo-web-browser": "~10.0.3",
91
- "lottie-react-native": "4.0.3",
62
+ "expo-linear-gradient": "~11.0.0",
63
+ "expo-linking": "~3.0.0",
64
+ "expo-local-authentication": "~12.1.0",
65
+ "expo-localization": "~12.0.0",
66
+ "expo-location": "~14.0.0",
67
+ "expo-mail-composer": "~11.1.0",
68
+ "expo-media-library": "~14.0.0",
69
+ "expo-module-template": "~10.1.0",
70
+ "expo-modules-core": "~0.6.0",
71
+ "expo-navigation-bar": "~1.1.0",
72
+ "expo-network": "~4.1.0",
73
+ "expo-notifications": "~0.14.0",
74
+ "expo-permissions": "~13.1.0",
75
+ "expo-print": "~11.1.0",
76
+ "expo-random": "~12.1.0",
77
+ "expo-screen-orientation": "~4.1.0",
78
+ "expo-secure-store": "~11.1.0",
79
+ "expo-sensors": "~11.1.0",
80
+ "expo-sharing": "~10.1.0",
81
+ "expo-sms": "~10.1.0",
82
+ "expo-speech": "~10.1.0",
83
+ "expo-splash-screen": "~0.14.0",
84
+ "expo-sqlite": "~10.1.0",
85
+ "expo-status-bar": "~1.2.0",
86
+ "expo-store-review": "~5.1.0",
87
+ "expo-system-ui": "~1.1.0",
88
+ "expo-task-manager": "~10.1.0",
89
+ "expo-tracking-transparency": "~2.1.0",
90
+ "expo-updates": "~0.11.0",
91
+ "expo-video-thumbnails": "~6.1.0",
92
+ "expo-web-browser": "~10.1.0",
93
+ "lottie-react-native": "5.0.1",
92
94
  "react-native-appearance": "~0.3.3",
93
95
  "react-native-branch": "5.0.0",
94
- "react-native-gesture-handler": "~1.10.2",
96
+ "react-native-gesture-handler": "~2.0.0",
95
97
  "react-native-get-random-values": "~1.7.0",
96
- "react-native-maps": "0.28.0",
97
- "react-native-pager-view": "5.4.6",
98
+ "react-native-maps": "0.29.4",
99
+ "react-native-pager-view": "5.4.9",
98
100
  "react-native-reanimated": "~2.2.0",
99
101
  "react-native-safe-area-context": "3.3.2",
100
102
  "react-native-screens": "~3.8.0",
101
- "react-native-shared-element": "0.8.2",
103
+ "react-native-shared-element": "0.8.3",
102
104
  "react-native-svg": "12.1.1",
103
105
  "react-native-unimodules": "~0.15.0",
104
106
  "react-native-view-shot": "3.1.2",
105
- "react-native-webview": "11.13.0",
107
+ "react-native-webview": "11.15.0",
106
108
  "sentry-expo": "^4.0.0",
107
109
  "unimodules-app-loader": "~3.0.0",
108
110
  "unimodules-image-loader-interface": "~6.1.0",
109
- "unimodules-task-manager-interface": "~7.0.3"
111
+ "unimodules-task-manager-interface": "~7.1.0"
110
112
  }
@@ -0,0 +1,14 @@
1
+ // Copyright 2016-present 650 Industries. All rights reserved.
2
+
3
+ #import <Foundation/Foundation.h>
4
+
5
+ NS_ASSUME_NONNULL_BEGIN
6
+
7
+ /**
8
+ This class loads some preprocessors and pass into `EXAppDefines` of ExpoModulesCore.
9
+ */
10
+ @interface EXAppDefinesLoader : NSObject
11
+
12
+ @end
13
+
14
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,24 @@
1
+ // Copyright 2016-present 650 Industries. All rights reserved.
2
+
3
+ #import <Expo/EXAppDefinesLoader.h>
4
+
5
+ #import <ExpoModulesCore/ExpoModulesCore.h>
6
+ #import <React/RCTDefines.h>
7
+
8
+ @implementation EXAppDefinesLoader
9
+
10
+ + (void)load
11
+ {
12
+ BOOL APP_DEBUG;
13
+ [EXAppDefines load:@{
14
+ #if DEBUG
15
+ @"APP_DEBUG": @(YES),
16
+ #else
17
+ @"APP_DEBUG": @(NO),
18
+ #endif
19
+ @"APP_RCT_DEBUG": @(RCT_DEBUG),
20
+ @"APP_RCT_DEV": @(RCT_DEV),
21
+ }];
22
+ }
23
+
24
+ @end
package/ios/Expo.h CHANGED
@@ -1 +1,2 @@
1
1
  #import <ExpoModulesCore/ExpoModulesCore.h>
2
+ #import <Expo/EXAppDefinesLoader.h>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo",
3
- "version": "44.0.0-alpha.0",
3
+ "version": "44.0.0-beta.0",
4
4
  "description": "The Expo SDK",
5
5
  "main": "build/Expo.js",
6
6
  "module": "build/Expo.js",
@@ -57,16 +57,16 @@
57
57
  "@babel/runtime": "^7.14.0",
58
58
  "@expo/metro-config": "~0.2.6",
59
59
  "@expo/vector-icons": "^12.0.4",
60
- "babel-preset-expo": "~8.5.1",
60
+ "babel-preset-expo": "~9.0.0",
61
61
  "cross-spawn": "^6.0.5",
62
62
  "expo-application": "~4.0.1",
63
63
  "expo-asset": "~8.4.4",
64
- "expo-constants": "~12.2.0",
64
+ "expo-constants": "~13.0.0",
65
65
  "expo-file-system": "~13.1.0",
66
66
  "expo-font": "~10.0.4",
67
67
  "expo-keep-awake": "~10.0.1",
68
- "expo-modules-autolinking": "0.4.0",
69
- "expo-modules-core": "0.5.0",
68
+ "expo-modules-autolinking": "0.5.0",
69
+ "expo-modules-core": "0.6.0",
70
70
  "fbemitter": "^2.1.1",
71
71
  "invariant": "^2.2.4",
72
72
  "md5-file": "^3.2.3",
@@ -74,7 +74,7 @@
74
74
  "uuid": "^3.4.0"
75
75
  },
76
76
  "optionalDependencies": {
77
- "expo-error-recovery": "~3.0.1"
77
+ "expo-error-recovery": "~3.0.4"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@types/fbemitter": "^2.0.32",
@@ -88,5 +88,5 @@
88
88
  "react-dom": "17.0.1",
89
89
  "react-native": "0.64.3"
90
90
  },
91
- "gitHead": "9faa58818454ba59dbff95077b9025a1c1cbd9fd"
91
+ "gitHead": "4ac89934e2acc4ef1fad59f338d9019fe2d92240"
92
92
  }
@@ -1,261 +0,0 @@
1
-
2
- # Created by https://www.gitignore.io/api/java,maven,gradle,android,intellij,androidstudio
3
-
4
- ### Android ###
5
- # Built application files
6
- *.apk
7
- *.ap_
8
-
9
- # Files for the ART/Dalvik VM
10
- *.dex
11
-
12
- # Java class files
13
- *.class
14
-
15
- # Generated files
16
- bin/
17
- gen/
18
- out/
19
-
20
- # Gradle files
21
- .gradle/
22
- build/
23
-
24
- # Local configuration file (sdk path, etc)
25
- local.properties
26
-
27
- # Proguard folder generated by Eclipse
28
- proguard/
29
-
30
- # Log Files
31
- *.log
32
-
33
- # Android Studio Navigation editor temp files
34
- .navigation/
35
-
36
- # Android Studio captures folder
37
- captures/
38
-
39
- # Intellij
40
- *.iml
41
- .idea/workspace.xml
42
- .idea/tasks.xml
43
- .idea/gradle.xml
44
- .idea/dictionaries
45
- .idea/libraries
46
-
47
- # External native build folder generated in Android Studio 2.2 and later
48
- .externalNativeBuild
49
-
50
- # Freeline
51
- freeline.py
52
- freeline/
53
- freeline_project_description.json
54
-
55
- ### Android Patch ###
56
- gen-external-apklibs
57
-
58
- ### AndroidStudio ###
59
- # Covers files to be ignored for android development using Android Studio.
60
-
61
- # Built application files
62
-
63
- # Files for the ART/Dalvik VM
64
-
65
- # Java class files
66
-
67
- # Generated files
68
-
69
- # Gradle files
70
- .gradle
71
-
72
- # Signing files
73
- .signing/
74
-
75
- # Local configuration file (sdk path, etc)
76
-
77
- # Proguard folder generated by Eclipse
78
-
79
- # Log Files
80
-
81
- # Android Studio
82
- /*/build/
83
- /*/local.properties
84
- /*/out
85
- /*/*/build
86
- /*/*/production
87
- *.ipr
88
- *~
89
- *.swp
90
-
91
- # Android Patch
92
-
93
- # External native build folder generated in Android Studio 2.2 and later
94
-
95
- # NDK
96
- obj/
97
-
98
- # IntelliJ IDEA
99
- *.iws
100
- /out/
101
-
102
- # User-specific configurations
103
- .idea/libraries/
104
- .idea/.name
105
- .idea/compiler.xml
106
- .idea/copyright/profiles_settings.xml
107
- .idea/encodings.xml
108
- .idea/misc.xml
109
- .idea/modules.xml
110
- .idea/scopes/scope_settings.xml
111
- .idea/vcs.xml
112
- .idea/jsLibraryMappings.xml
113
- .idea/datasources.xml
114
- .idea/dataSources.ids
115
- .idea/sqlDataSources.xml
116
- .idea/dynamic.xml
117
- .idea/uiDesigner.xml
118
-
119
- # OS-specific files
120
- .DS_Store
121
- .DS_Store?
122
- ._*
123
- .Spotlight-V100
124
- .Trashes
125
- ehthumbs.db
126
- Thumbs.db
127
-
128
- # Legacy Eclipse project files
129
- .classpath
130
- .project
131
- .cproject
132
- .settings/
133
-
134
- # Mobile Tools for Java (J2ME)
135
- .mtj.tmp/
136
-
137
- # Package Files #
138
- *.war
139
- *.ear
140
-
141
- # virtual machine crash logs (Reference: http://www.java.com/en/download/help/error_hotspot.xml)
142
- hs_err_pid*
143
-
144
- ## Plugin-specific files:
145
-
146
- # mpeltonen/sbt-idea plugin
147
- .idea_modules/
148
-
149
- # JIRA plugin
150
- atlassian-ide-plugin.xml
151
-
152
- # Mongo Explorer plugin
153
- .idea/mongoSettings.xml
154
-
155
- ### AndroidStudio Patch ###
156
-
157
- !/gradle/wrapper/gradle-wrapper.jar
158
-
159
- ### Intellij ###
160
- # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
161
- # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
162
-
163
- # User-specific stuff:
164
- .idea/**/workspace.xml
165
- .idea/**/tasks.xml
166
-
167
- # Sensitive or high-churn files:
168
- .idea/**/dataSources/
169
- .idea/**/dataSources.ids
170
- .idea/**/dataSources.xml
171
- .idea/**/dataSources.local.xml
172
- .idea/**/sqlDataSources.xml
173
- .idea/**/dynamic.xml
174
- .idea/**/uiDesigner.xml
175
-
176
- # Gradle:
177
- .idea/**/gradle.xml
178
- .idea/**/libraries
179
-
180
- # CMake
181
- cmake-build-debug/
182
-
183
- # Mongo Explorer plugin:
184
- .idea/**/mongoSettings.xml
185
-
186
- ## File-based project format:
187
-
188
- ## Plugin-specific files:
189
-
190
- # IntelliJ
191
-
192
- # mpeltonen/sbt-idea plugin
193
-
194
- # JIRA plugin
195
-
196
- # Cursive Clojure plugin
197
- .idea/replstate.xml
198
-
199
- # Ruby plugin and RubyMine
200
- /.rakeTasks
201
-
202
- ### Intellij Patch ###
203
- # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
204
-
205
- # *.iml
206
- # modules.xml
207
- # .idea/misc.xml
208
- # *.ipr
209
-
210
- # Sonarlint plugin
211
- .idea/sonarlint
212
-
213
- ### Java ###
214
- # Compiled class file
215
-
216
- # Log file
217
-
218
- # BlueJ files
219
- *.ctxt
220
-
221
- # Mobile Tools for Java (J2ME)
222
-
223
- # Package Files #
224
- *.jar
225
- *.zip
226
- *.tar.gz
227
- *.rar
228
-
229
- # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
230
-
231
- ### Maven ###
232
- target/
233
- pom.xml.tag
234
- pom.xml.releaseBackup
235
- pom.xml.versionsBackup
236
- pom.xml.next
237
- release.properties
238
- dependency-reduced-pom.xml
239
- buildNumber.properties
240
- .mvn/timing.properties
241
-
242
- # Avoid ignoring Maven wrapper jar file (.jar files are usually ignored)
243
- !/.mvn/wrapper/maven-wrapper.jar
244
-
245
- ### Gradle ###
246
- **/build/
247
-
248
- # Ignore Gradle GUI config
249
- gradle-app.setting
250
-
251
- # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
252
- !gradle-wrapper.jar
253
-
254
- # Cache of project
255
- .gradletasknamecache
256
-
257
- # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
258
- # gradle/wrapper/gradle-wrapper.properties
259
-
260
-
261
- # End of https://www.gitignore.io/api/java,maven,gradle,android,intellij,androidstudio
@@ -1,53 +0,0 @@
1
- /**
2
- * NOTE(brentvatne):
3
- * AppLoadingPlaceholder exists to smooth the upgrade experience to SDK 40. The
4
- * placeholder behaves mostly as expected with the existing API, however it
5
- * will no longer leverage any native APIs to keep the splash screen visible.
6
- * This makes it so a user who upgrades and runs their app can see their app
7
- * running and get the warning about the AppLoading module being removed
8
- * top, without an extraneous red screen that would appear from attempting to
9
- * render an undefined AppLoading component.
10
- *
11
- * Remove this in SDK 42.
12
- */
13
- import React from 'react';
14
- declare type Props = {
15
- /**
16
- * Optional, you can do this process manually if you prefer.
17
- * This is mainly for backwards compatibility and it is not recommended.
18
- *
19
- * When provided, requires providing `onError` prop as well.
20
- * @deprecated
21
- */
22
- startAsync: () => Promise<void>;
23
- /**
24
- * If `startAsync` throws an error, it is caught and passed into the provided function.
25
- * @deprecated
26
- */
27
- onError: (error: Error) => void;
28
- /**
29
- * Called when `startAsync` resolves or rejects.
30
- * This should be used to set state and unmount the `AppLoading` component.
31
- * @deprecated
32
- */
33
- onFinish: () => void;
34
- /**
35
- * Whether to hide the native splash screen as soon as you unmount the `AppLoading` component.
36
- * Auto-hiding is enabled by default.
37
- */
38
- autoHideSplash?: boolean;
39
- } | {
40
- /**
41
- * Whether to hide the native splash screen as soon as you unmount the `AppLoading` component.
42
- * Auto-hiding is enabled by default.
43
- */
44
- autoHideSplash?: boolean;
45
- };
46
- export default class AppLoadingPlaceholder extends React.Component<Props> {
47
- _isMounted: boolean;
48
- componentDidMount(): void;
49
- componentWillUnmount(): void;
50
- private startLoadingAppResourcesAsync;
51
- render(): null;
52
- }
53
- export {};
@@ -1,56 +0,0 @@
1
- /**
2
- * NOTE(brentvatne):
3
- * AppLoadingPlaceholder exists to smooth the upgrade experience to SDK 40. The
4
- * placeholder behaves mostly as expected with the existing API, however it
5
- * will no longer leverage any native APIs to keep the splash screen visible.
6
- * This makes it so a user who upgrades and runs their app can see their app
7
- * running and get the warning about the AppLoading module being removed
8
- * top, without an extraneous red screen that would appear from attempting to
9
- * render an undefined AppLoading component.
10
- *
11
- * Remove this in SDK 42.
12
- */
13
- import React from 'react';
14
- export default class AppLoadingPlaceholder extends React.Component {
15
- _isMounted = false;
16
- componentDidMount() {
17
- this._isMounted = true;
18
- this.startLoadingAppResourcesAsync().catch((error) => {
19
- console.error(`AppLoading threw an unexpected error when loading:\n${error.stack}`);
20
- });
21
- }
22
- componentWillUnmount() {
23
- this._isMounted = false;
24
- }
25
- async startLoadingAppResourcesAsync() {
26
- if (!('startAsync' in this.props)) {
27
- return;
28
- }
29
- if (!('onFinish' in this.props)) {
30
- throw new Error('AppLoading onFinish prop is required if startAsync is provided');
31
- }
32
- if (!('onError' in this.props)) {
33
- throw new Error('AppLoading onError prop is required if startAsync is provided');
34
- }
35
- try {
36
- await this.props.startAsync();
37
- }
38
- catch (e) {
39
- if (!this._isMounted) {
40
- return;
41
- }
42
- this.props.onError(e);
43
- }
44
- finally {
45
- if (!this._isMounted) {
46
- return;
47
- }
48
- // If we get to this point then we know that either there was no error, or the error was handled.
49
- this.props.onFinish();
50
- }
51
- }
52
- render() {
53
- return null;
54
- }
55
- }
56
- //# sourceMappingURL=AppLoadingPlaceholder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AppLoadingPlaceholder.js","sourceRoot":"","sources":["../../src/launch/AppLoadingPlaceholder.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAwC1B,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,KAAK,CAAC,SAAgB;IACvE,UAAU,GAAY,KAAK,CAAC;IAE5B,iBAAiB;QACf,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QAEvB,IAAI,CAAC,6BAA6B,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACnD,OAAO,CAAC,KAAK,CAAC,uDAAuD,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;QACtF,CAAC,CAAC,CAAC;IACL,CAAC;IAED,oBAAoB;QAClB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC;IAEO,KAAK,CAAC,6BAA6B;QACzC,IAAI,CAAC,CAAC,YAAY,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE;YACjC,OAAO;SACR;QAED,IAAI,CAAC,CAAC,UAAU,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;SACnF;QAED,IAAI,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;SAClF;QAED,IAAI;YACF,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;SAC/B;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;gBACpB,OAAO;aACR;YACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;SACvB;gBAAS;YACR,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;gBACpB,OAAO;aACR;YACD,iGAAiG;YACjG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;SACvB;IACH,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["/**\n * NOTE(brentvatne):\n * AppLoadingPlaceholder exists to smooth the upgrade experience to SDK 40. The\n * placeholder behaves mostly as expected with the existing API, however it\n * will no longer leverage any native APIs to keep the splash screen visible.\n * This makes it so a user who upgrades and runs their app can see their app\n * running and get the warning about the AppLoading module being removed\n * top, without an extraneous red screen that would appear from attempting to\n * render an undefined AppLoading component.\n *\n * Remove this in SDK 42.\n */\n\nimport React from 'react';\n\ntype Props =\n | {\n /**\n * Optional, you can do this process manually if you prefer.\n * This is mainly for backwards compatibility and it is not recommended.\n *\n * When provided, requires providing `onError` prop as well.\n * @deprecated\n */\n startAsync: () => Promise<void>;\n\n /**\n * If `startAsync` throws an error, it is caught and passed into the provided function.\n * @deprecated\n */\n onError: (error: Error) => void;\n\n /**\n * Called when `startAsync` resolves or rejects.\n * This should be used to set state and unmount the `AppLoading` component.\n * @deprecated\n */\n onFinish: () => void;\n\n /**\n * Whether to hide the native splash screen as soon as you unmount the `AppLoading` component.\n * Auto-hiding is enabled by default.\n */\n autoHideSplash?: boolean;\n }\n | {\n /**\n * Whether to hide the native splash screen as soon as you unmount the `AppLoading` component.\n * Auto-hiding is enabled by default.\n */\n autoHideSplash?: boolean;\n };\n\nexport default class AppLoadingPlaceholder extends React.Component<Props> {\n _isMounted: boolean = false;\n\n componentDidMount() {\n this._isMounted = true;\n\n this.startLoadingAppResourcesAsync().catch((error) => {\n console.error(`AppLoading threw an unexpected error when loading:\\n${error.stack}`);\n });\n }\n\n componentWillUnmount() {\n this._isMounted = false;\n }\n\n private async startLoadingAppResourcesAsync() {\n if (!('startAsync' in this.props)) {\n return;\n }\n\n if (!('onFinish' in this.props)) {\n throw new Error('AppLoading onFinish prop is required if startAsync is provided');\n }\n\n if (!('onError' in this.props)) {\n throw new Error('AppLoading onError prop is required if startAsync is provided');\n }\n\n try {\n await this.props.startAsync();\n } catch (e) {\n if (!this._isMounted) {\n return;\n }\n this.props.onError(e);\n } finally {\n if (!this._isMounted) {\n return;\n }\n // If we get to this point then we know that either there was no error, or the error was handled.\n this.props.onFinish();\n }\n }\n\n render() {\n return null;\n }\n}\n"]}