expo 43.0.4 → 44.0.0-beta.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.
@@ -8,7 +8,7 @@ apply from: "../scripts/autolinking.gradle"
8
8
  ensureDependeciesWereEvaluated(project)
9
9
 
10
10
  group = 'host.exp.exponent'
11
- version = '43.0.4'
11
+ version = '44.0.0-beta.2'
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 "43.0.4"
65
+ versionName "44.0.0-beta.2"
66
66
  consumerProguardFiles("proguard-rules.pro")
67
67
  }
68
68
  lintOptions {
@@ -71,6 +71,9 @@ android {
71
71
  kotlinOptions {
72
72
  jvmTarget = '1.8'
73
73
  }
74
+ testOptions {
75
+ unitTests.includeAndroidResources = true
76
+ }
74
77
 
75
78
  sourceSets {
76
79
  main {
@@ -79,12 +82,24 @@ android {
79
82
  }
80
83
  }
81
84
  }
85
+
86
+ unitTestVariants.all {
87
+ it.mergedFlavor.manifestPlaceholders = [
88
+ // Fix expo-app-auth manifest merger issue for unit test
89
+ appAuthRedirectScheme: "test"
90
+ ]
91
+ }
82
92
  }
83
93
 
84
94
  dependencies { dependencyHandler ->
85
95
  //noinspection GradleDynamicVersion
86
96
  implementation 'com.facebook.react:react-native:+'
87
97
 
98
+ testImplementation 'junit:junit:4.13.1'
99
+ testImplementation 'androidx.test:core:1.4.0'
100
+ testImplementation "com.google.truth:truth:1.1.2"
101
+ testImplementation 'io.mockk:mockk:1.12.0'
102
+
88
103
  // Link expo modules as dependencies of the adapter. It uses `api` configuration so they all will be visible for the app as well.
89
104
  // A collection of the dependencies depends on the options passed to `useExpoModules` in your project's `settings.gradle`.
90
105
  addExpoModulesDependencies(dependencyHandler, project)
@@ -1,6 +1,7 @@
1
1
  # For ReactNativeDelegateWrapper
2
2
  -keepclassmembers public class com.facebook.react.ReactActivityDelegate {
3
3
  protected *;
4
+ private ReactDelegate mReactDelegate;
4
5
  }
5
6
 
6
7
  # For ReactNativeHostWrapper
@@ -2,21 +2,26 @@ package expo.modules
2
2
 
3
3
  import android.app.Application
4
4
  import android.content.res.Configuration
5
+ import androidx.annotation.UiThread
6
+ import expo.modules.core.interfaces.ApplicationLifecycleListener
5
7
 
6
- class ApplicationLifecycleDispatcher private constructor() {
7
- companion object {
8
- @JvmStatic
9
- fun onApplicationCreate(application: Application) {
10
- ExpoModulesPackage.packageList
11
- .flatMap { it.createApplicationLifecycleListeners(application) }
12
- .forEach { it.onCreate(application) }
13
- }
8
+ object ApplicationLifecycleDispatcher {
9
+ private var listeners: List<ApplicationLifecycleListener>? = null
14
10
 
15
- @JvmStatic
16
- fun onConfigurationChanged(application: Application, newConfig: Configuration) {
17
- ExpoModulesPackage.packageList
18
- .flatMap { it.createApplicationLifecycleListeners(application) }
19
- .forEach { it.onConfigurationChanged(newConfig) }
20
- }
11
+ @UiThread
12
+ private fun getCachedListeners(application: Application): List<ApplicationLifecycleListener> {
13
+ return listeners ?: ExpoModulesPackage.packageList
14
+ .flatMap { it.createApplicationLifecycleListeners(application) }
15
+ .also { listeners = it }
16
+ }
17
+
18
+ @JvmStatic
19
+ fun onApplicationCreate(application: Application) {
20
+ getCachedListeners(application).forEach { it.onCreate(application) }
21
+ }
22
+
23
+ @JvmStatic
24
+ fun onConfigurationChanged(application: Application, newConfig: Configuration) {
25
+ getCachedListeners(application).forEach { it.onConfigurationChanged(newConfig) }
21
26
  }
22
27
  }
@@ -8,6 +8,7 @@ import com.facebook.react.bridge.ReactApplicationContext
8
8
  import com.facebook.react.uimanager.ViewManager
9
9
 
10
10
  import expo.modules.adapters.react.ModuleRegistryAdapter
11
+ import expo.modules.core.ModulePriorities
11
12
  import expo.modules.core.interfaces.Package
12
13
 
13
14
  import java.lang.Exception
@@ -21,9 +22,10 @@ class ExpoModulesPackage : ReactPackage {
21
22
  try {
22
23
  val expoModules = Class.forName("expo.modules.ExpoModulesPackageList")
23
24
  val getPackageList = expoModules.getMethod("getPackageList")
24
- getPackageList.invoke(null) as List<Package>
25
+ (getPackageList.invoke(null) as List<Package>)
26
+ .sortedByDescending { ModulePriorities.get(it::class.qualifiedName) }
25
27
  } catch (e: Exception) {
26
- Log.e("ExpoModulesPackage", "Couldn't get expo modules list.", e)
28
+ Log.e("ExpoModulesPackage", "Couldn't get expo package list.", e)
27
29
  emptyList()
28
30
  }
29
31
  }
@@ -8,10 +8,12 @@ import android.view.KeyEvent
8
8
  import androidx.collection.ArrayMap
9
9
  import com.facebook.react.ReactActivity
10
10
  import com.facebook.react.ReactActivityDelegate
11
+ import com.facebook.react.ReactDelegate
11
12
  import com.facebook.react.ReactInstanceManager
12
13
  import com.facebook.react.ReactNativeHost
13
14
  import com.facebook.react.ReactRootView
14
15
  import com.facebook.react.modules.core.PermissionListener
16
+ import expo.modules.core.interfaces.ReactActivityLifecycleListener
15
17
  import java.lang.reflect.Method
16
18
 
17
19
  class ReactActivityDelegateWrapper(
@@ -20,6 +22,8 @@ class ReactActivityDelegateWrapper(
20
22
  ) : ReactActivityDelegate(activity, null) {
21
23
  private val reactActivityLifecycleListeners = ExpoModulesPackage.packageList
22
24
  .flatMap { it.createReactActivityLifecycleListeners(activity) }
25
+ private val reactActivityHandlers = ExpoModulesPackage.packageList
26
+ .flatMap { it.createReactActivityHandlers(activity) }
23
27
  private val methodMap: ArrayMap<String, Method> = ArrayMap()
24
28
 
25
29
  //region ReactActivityDelegate
@@ -29,7 +33,9 @@ class ReactActivityDelegateWrapper(
29
33
  }
30
34
 
31
35
  override fun createRootView(): ReactRootView {
32
- return invokeDelegateMethod("createRootView")
36
+ return reactActivityHandlers.asSequence()
37
+ .mapNotNull { it.createReactRootView(activity) }
38
+ .firstOrNull() ?: invokeDelegateMethod("createRootView")
33
39
  }
34
40
 
35
41
  override fun getReactNativeHost(): ReactNativeHost {
@@ -40,7 +46,7 @@ class ReactActivityDelegateWrapper(
40
46
  return delegate.reactInstanceManager
41
47
  }
42
48
 
43
- override fun getMainComponentName(): String {
49
+ override fun getMainComponentName(): String? {
44
50
  return delegate.mainComponentName
45
51
  }
46
52
 
@@ -49,7 +55,24 @@ class ReactActivityDelegateWrapper(
49
55
  }
50
56
 
51
57
  override fun onCreate(savedInstanceState: Bundle?) {
52
- invokeDelegateMethod<Unit, Bundle?>("onCreate", arrayOf(Bundle::class.java), arrayOf(savedInstanceState))
58
+ // Since we just wrap `ReactActivityDelegate` but not inherit it, in its `onCreate`,
59
+ // the calls to `createRootView()` or `getMainComponentName()` have no chances to be our wrapped methods.
60
+ // Instead we intercept `ReactActivityDelegate.onCreate` and replace the `mReactDelegate` with our version.
61
+ // That's not ideal but works.
62
+ val reactDelegate = object : ReactDelegate(
63
+ plainActivity, reactNativeHost, mainComponentName, launchOptions
64
+ ) {
65
+ override fun createRootView(): ReactRootView {
66
+ return this@ReactActivityDelegateWrapper.createRootView()
67
+ }
68
+ }
69
+ val mReactDelegate = ReactActivityDelegate::class.java.getDeclaredField("mReactDelegate")
70
+ mReactDelegate.isAccessible = true
71
+ mReactDelegate.set(delegate, reactDelegate)
72
+ if (mainComponentName != null) {
73
+ loadApp(mainComponentName)
74
+ }
75
+
53
76
  reactActivityLifecycleListeners.forEach { listener ->
54
77
  listener.onCreate(activity, savedInstanceState)
55
78
  }
@@ -93,11 +116,19 @@ class ReactActivityDelegateWrapper(
93
116
  }
94
117
 
95
118
  override fun onBackPressed(): Boolean {
96
- return delegate.onBackPressed()
119
+ val listenerResult = reactActivityLifecycleListeners
120
+ .map(ReactActivityLifecycleListener::onBackPressed)
121
+ .fold(false) { accu, current -> accu || current }
122
+ val delegateResult = delegate.onBackPressed()
123
+ return listenerResult || delegateResult
97
124
  }
98
125
 
99
126
  override fun onNewIntent(intent: Intent?): Boolean {
100
- return delegate.onNewIntent(intent)
127
+ val listenerResult = reactActivityLifecycleListeners
128
+ .map { it.onNewIntent(intent) }
129
+ .fold(false) { accu, current -> accu || current }
130
+ val delegateResult = delegate.onNewIntent(intent)
131
+ return listenerResult || delegateResult
101
132
  }
102
133
 
103
134
  override fun onWindowFocusChanged(hasFocus: Boolean) {
@@ -124,6 +155,7 @@ class ReactActivityDelegateWrapper(
124
155
 
125
156
  //region Internals
126
157
 
158
+ @Suppress("UNCHECKED_CAST")
127
159
  private fun <T> invokeDelegateMethod(name: String): T {
128
160
  var method = methodMap[name]
129
161
  if (method == null) {
@@ -134,6 +166,7 @@ class ReactActivityDelegateWrapper(
134
166
  return method!!.invoke(delegate) as T
135
167
  }
136
168
 
169
+ @Suppress("UNCHECKED_CAST")
137
170
  private fun <T, A> invokeDelegateMethod(
138
171
  name: String,
139
172
  argTypes: Array<Class<*>>,
@@ -12,7 +12,6 @@ import com.facebook.react.bridge.JavaScriptContextHolder
12
12
  import com.facebook.react.bridge.JavaScriptExecutorFactory
13
13
  import com.facebook.react.bridge.ReactApplicationContext
14
14
  import com.facebook.react.devsupport.RedBoxHandler
15
- import com.facebook.react.uimanager.UIImplementationProvider
16
15
  import java.lang.reflect.Method
17
16
 
18
17
  class ReactNativeHostWrapper(
@@ -24,11 +23,20 @@ class ReactNativeHostWrapper(
24
23
  private val methodMap: ArrayMap<String, Method> = ArrayMap()
25
24
 
26
25
  override fun createReactInstanceManager(): ReactInstanceManager {
27
- // map() without asSequence() gives a chance for handlers
28
- // to get noticed before createReactInstanceManager()
29
- return reactNativeHostHandlers
30
- .map { it.createReactInstanceManager(useDeveloperSupport) }
26
+ val developerSupport = useDeveloperSupport
27
+ reactNativeHostHandlers.forEach { handler ->
28
+ handler.onWillCreateReactInstanceManager(developerSupport)
29
+ }
30
+
31
+ val result = reactNativeHostHandlers.asSequence()
32
+ .mapNotNull { it.createReactInstanceManager(developerSupport) }
31
33
  .firstOrNull() ?: super.createReactInstanceManager()
34
+
35
+ reactNativeHostHandlers.forEach { handler ->
36
+ handler.onDidCreateReactInstanceManager(result, developerSupport)
37
+ }
38
+
39
+ return result
32
40
  }
33
41
 
34
42
  override fun getRedBoxHandler(): RedBoxHandler? {
@@ -39,7 +47,8 @@ class ReactNativeHostWrapper(
39
47
  return invokeDelegateMethod("getJavaScriptExecutorFactory")
40
48
  }
41
49
 
42
- override fun getUIImplementationProvider(): UIImplementationProvider {
50
+ @Suppress("DEPRECATION")
51
+ override fun getUIImplementationProvider(): com.facebook.react.uimanager.UIImplementationProvider {
43
52
  return invokeDelegateMethod("getUIImplementationProvider")
44
53
  }
45
54
 
@@ -54,13 +63,13 @@ class ReactNativeHostWrapper(
54
63
 
55
64
  override fun getJSBundleFile(): String? {
56
65
  return reactNativeHostHandlers.asSequence()
57
- .map { it.getJSBundleFile(useDeveloperSupport) }
66
+ .mapNotNull { it.getJSBundleFile(useDeveloperSupport) }
58
67
  .firstOrNull() ?: invokeDelegateMethod<String?>("getJSBundleFile")
59
68
  }
60
69
 
61
70
  override fun getBundleAssetName(): String? {
62
71
  return reactNativeHostHandlers.asSequence()
63
- .map { it.getBundleAssetName(useDeveloperSupport) }
72
+ .mapNotNull { it.getBundleAssetName(useDeveloperSupport) }
64
73
  .firstOrNull() ?: invokeDelegateMethod<String?>("getBundleAssetName")
65
74
  }
66
75
 
@@ -90,6 +99,7 @@ class ReactNativeHostWrapper(
90
99
  }
91
100
  }
92
101
 
102
+ @Suppress("UNCHECKED_CAST")
93
103
  private fun <T> invokeDelegateMethod(name: String): T {
94
104
  var method = methodMap[name]
95
105
  if (method == null) {
@@ -0,0 +1,109 @@
1
+ package expo.modules
2
+
3
+ import android.content.Context
4
+ import android.content.Intent
5
+ import com.facebook.react.ReactActivity
6
+ import com.facebook.react.ReactActivityDelegate
7
+ import com.google.common.truth.Truth.assertThat
8
+ import expo.modules.core.interfaces.Package
9
+ import expo.modules.core.interfaces.ReactActivityHandler
10
+ import expo.modules.core.interfaces.ReactActivityLifecycleListener
11
+ import io.mockk.MockKAnnotations
12
+ import io.mockk.every
13
+ import io.mockk.impl.annotations.RelaxedMockK
14
+ import io.mockk.mockk
15
+ import io.mockk.mockkObject
16
+ import io.mockk.unmockkAll
17
+ import io.mockk.verify
18
+ import org.junit.After
19
+ import org.junit.Before
20
+ import org.junit.Test
21
+
22
+ internal class ReactActivityDelegateWrapperTest {
23
+ lateinit var mockPackage0: MockPackage
24
+
25
+ lateinit var mockPackage1: MockPackage
26
+
27
+ @RelaxedMockK
28
+ lateinit var activity: ReactActivity
29
+
30
+ @RelaxedMockK
31
+ lateinit var delegate: ReactActivityDelegate
32
+
33
+ @Before
34
+ fun setUp() {
35
+ mockPackage0 = MockPackage()
36
+ mockPackage1 = MockPackage()
37
+ MockKAnnotations.init(this)
38
+ mockkObject(ExpoModulesPackage.Companion)
39
+ every { ExpoModulesPackage.Companion.packageList } returns listOf(mockPackage0, mockPackage1)
40
+ }
41
+
42
+ @After
43
+ fun tearDown() {
44
+ unmockkAll()
45
+ }
46
+
47
+ @Test
48
+ fun `onBackPressed should call each handler's callback just once`() {
49
+ val delegateWrapper = ReactActivityDelegateWrapper(activity, delegate)
50
+ every { mockPackage0.reactActivityLifecycleListener.onBackPressed() } returns true
51
+
52
+ delegateWrapper.onBackPressed()
53
+
54
+ verify(exactly = 1) { mockPackage0.reactActivityLifecycleListener.onBackPressed() }
55
+ verify(exactly = 1) { mockPackage1.reactActivityLifecycleListener.onBackPressed() }
56
+ verify(exactly = 1) { delegate.onBackPressed() }
57
+ }
58
+
59
+ @Test
60
+ fun `onBackPressed should return true if someone returns true`() {
61
+ val delegateWrapper = ReactActivityDelegateWrapper(activity, delegate)
62
+ every { mockPackage0.reactActivityLifecycleListener.onBackPressed() } returns false
63
+ every { mockPackage1.reactActivityLifecycleListener.onBackPressed() } returns true
64
+ every { delegate.onBackPressed() } returns false
65
+
66
+ val result = delegateWrapper.onBackPressed()
67
+ assertThat(result).isTrue()
68
+ }
69
+
70
+ @Test
71
+ fun `onNewIntent should call each handler's callback just once`() {
72
+ val intent = mockk<Intent>()
73
+ val delegateWrapper = ReactActivityDelegateWrapper(activity, delegate)
74
+ every { mockPackage0.reactActivityLifecycleListener.onNewIntent(intent) } returns false
75
+ every { mockPackage1.reactActivityLifecycleListener.onNewIntent(intent) } returns true
76
+ every { delegate.onNewIntent(intent) } returns false
77
+
78
+ delegateWrapper.onNewIntent(intent)
79
+
80
+ verify(exactly = 1) { mockPackage0.reactActivityLifecycleListener.onNewIntent(any()) }
81
+ verify(exactly = 1) { mockPackage1.reactActivityLifecycleListener.onNewIntent(any()) }
82
+ verify(exactly = 1) { delegate.onNewIntent(any()) }
83
+ }
84
+
85
+ @Test
86
+ fun `onNewIntent should return true if someone returns true`() {
87
+ val intent = mockk<Intent>()
88
+ val delegateWrapper = ReactActivityDelegateWrapper(activity, delegate)
89
+ every { mockPackage0.reactActivityLifecycleListener.onNewIntent(intent) } returns false
90
+ every { mockPackage1.reactActivityLifecycleListener.onNewIntent(intent) } returns true
91
+ every { delegate.onNewIntent(intent) } returns false
92
+
93
+ val result = delegateWrapper.onNewIntent(intent)
94
+ assertThat(result).isTrue()
95
+ }
96
+ }
97
+
98
+ internal class MockPackage : Package {
99
+ val reactActivityLifecycleListener = mockk<ReactActivityLifecycleListener>(relaxed = true)
100
+ val reactActivityHandler = mockk<ReactActivityHandler>(relaxed = true)
101
+
102
+ override fun createReactActivityLifecycleListeners(activityContext: Context?): List<ReactActivityLifecycleListener> {
103
+ return listOf(reactActivityLifecycleListener)
104
+ }
105
+
106
+ override fun createReactActivityHandlers(activityContext: Context?): List<ReactActivityHandler> {
107
+ return listOf(reactActivityHandler)
108
+ }
109
+ }
package/build/Expo.fx.js CHANGED
@@ -19,21 +19,6 @@ const isManagedEnvironment = Constants.executionEnvironment === ExecutionEnviron
19
19
  if (StyleSheet.setStyleAttributePreprocessor) {
20
20
  StyleSheet.setStyleAttributePreprocessor('fontFamily', Font.processFontFamily);
21
21
  }
22
- // Add warning about removed navigator.geolocation polyfill.
23
- if (Platform.OS !== 'web' && !window.navigator?.geolocation) {
24
- const logLocationPolyfillWarning = (method) => {
25
- return () => {
26
- console.warn(`window.navigator.geolocation.${method} is not available. Import and execute installWebGeolocationPolyfill() from expo-location to add it, or use the expo-location APIs instead.`);
27
- };
28
- };
29
- // @ts-ignore
30
- window.navigator.geolocation = {
31
- getCurrentPosition: logLocationPolyfillWarning('getCurrentPosition'),
32
- watchPosition: logLocationPolyfillWarning('watchPostion'),
33
- clearWatch: () => { },
34
- stopObserving: () => { },
35
- };
36
- }
37
22
  // Asserts if bare workflow isn't setup correctly.
38
23
  if (NativeModulesProxy.ExpoUpdates?.isMissingRuntimeVersion) {
39
24
  const message = 'expo-updates is installed but there is no runtime or SDK version configured. ' +
@@ -1 +1 @@
1
- {"version":3,"file":"Expo.fx.js","sourceRoot":"","sources":["../src/Expo.fx.tsx"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AACnC,wEAAwE;AACxE,OAAO,0BAA0B,CAAC;AAClC,OAAO,oCAAoC,CAAC;AAC5C,mFAAmF;AACnF,OAAO,YAAY,CAAC;AAEpB,OAAO,SAAS,EAAE,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAE5D,sGAAsG;AACtG,gGAAgG;AAChG,6EAA6E;AAC7E,MAAM,oBAAoB,GACxB,SAAS,CAAC,oBAAoB,KAAK,oBAAoB,CAAC,UAAU;IAClE,SAAS,CAAC,oBAAoB,KAAK,oBAAoB,CAAC,WAAW,CAAC;AAEtE,4FAA4F;AAC5F,IAAI,UAAU,CAAC,6BAA6B,EAAE;IAC5C,UAAU,CAAC,6BAA6B,CAAC,YAAY,EAAE,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b,WAAW,CAAC,2BAA2B,GAAG,CAAC,QAAQ,EAAE,EAAE;YACrD,SAAS,wBAAwB,CAAC,KAAU;gBAC1C,MAAM,iBAAiB,GAAG,QAAQ,EAAE,CAAC;gBAErC,OAAO,CACL,oBAAC,eAAe;oBACd,oBAAC,iBAAiB,OAAK,KAAK,GAAI,CAChB,CACnB,CAAC;YACJ,CAAC;YAED,mCAAmC,CAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC,CAAC;QACtE,CAAC,CAAC;KACH;CACF","sourcesContent":["import './environment/validate.fx';\n// load remote logging for compatibility with custom development clients\nimport './environment/logging.fx';\nimport './environment/react-native-logs.fx';\n// load expo-asset immediately to set a custom `source` transformer in React Native\nimport 'expo-asset';\n\nimport Constants, { ExecutionEnvironment } from 'expo-constants';\nimport * as Font from 'expo-font';\nimport { NativeModulesProxy, Platform } from 'expo-modules-core';\nimport React from 'react';\nimport { AppRegistry, StyleSheet } from 'react-native';\n\nimport DevAppContainer from './environment/DevAppContainer';\n\n// Represents an app running in the store client or an app built with the legacy `expo build` command.\n// `false` when running in bare workflow, custom dev clients, or `eas build`s (managed or bare).\n// This should be used to ensure code that _should_ exist is treated as such.\nconst isManagedEnvironment =\n Constants.executionEnvironment === ExecutionEnvironment.Standalone ||\n Constants.executionEnvironment === ExecutionEnvironment.StoreClient;\n\n// If expo-font is installed and the style preprocessor is available, use it to parse fonts.\nif (StyleSheet.setStyleAttributePreprocessor) {\n StyleSheet.setStyleAttributePreprocessor('fontFamily', Font.processFontFamily);\n}\n\n// Add warning about removed navigator.geolocation polyfill.\nif (Platform.OS !== 'web' && !window.navigator?.geolocation) {\n const logLocationPolyfillWarning = (method: string) => {\n return () => {\n console.warn(\n `window.navigator.geolocation.${method} is not available. Import and execute installWebGeolocationPolyfill() from expo-location to add it, or use the expo-location APIs instead.`\n );\n };\n };\n\n // @ts-ignore\n window.navigator.geolocation = {\n getCurrentPosition: logLocationPolyfillWarning('getCurrentPosition'),\n watchPosition: logLocationPolyfillWarning('watchPostion'),\n clearWatch: () => {},\n stopObserving: () => {},\n };\n}\n\n// Asserts if bare workflow isn't setup correctly.\nif (NativeModulesProxy.ExpoUpdates?.isMissingRuntimeVersion) {\n const message =\n 'expo-updates is installed but there is no runtime or SDK version configured. ' +\n \"You'll need to configure one of these two properties in \" +\n Platform.select({ ios: 'Expo.plist', android: 'AndroidManifest.xml' }) +\n ' before OTA updates will work properly.';\n if (__DEV__) {\n console.warn(message);\n } else {\n throw new Error(message);\n }\n}\n\n// Having two if statements will enable terser to remove the entire block.\nif (__DEV__) {\n // Only enable the fast refresh indicator for managed iOS apps in dev mode.\n if (isManagedEnvironment && Platform.OS === 'ios') {\n // add the dev app container wrapper component on ios\n // @ts-ignore\n AppRegistry.setWrapperComponentProvider(() => DevAppContainer);\n\n // @ts-ignore\n const originalSetWrapperComponentProvider = AppRegistry.setWrapperComponentProvider;\n\n // @ts-ignore\n AppRegistry.setWrapperComponentProvider = (provider) => {\n function PatchedProviderComponent(props: any) {\n const ProviderComponent = provider();\n\n return (\n <DevAppContainer>\n <ProviderComponent {...props} />\n </DevAppContainer>\n );\n }\n\n originalSetWrapperComponentProvider(() => PatchedProviderComponent);\n };\n }\n}\n"]}
1
+ {"version":3,"file":"Expo.fx.js","sourceRoot":"","sources":["../src/Expo.fx.tsx"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AACnC,wEAAwE;AACxE,OAAO,0BAA0B,CAAC;AAClC,OAAO,oCAAoC,CAAC;AAC5C,mFAAmF;AACnF,OAAO,YAAY,CAAC;AAEpB,OAAO,SAAS,EAAE,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA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ACnB,CAAC;YACJ,CAAC;YAED,mCAAmC,CAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC,CAAC;QACtE,CAAC,CAAC;KACH;CACF","sourcesContent":["import './environment/validate.fx';\n// load remote logging for compatibility with custom development clients\nimport './environment/logging.fx';\nimport './environment/react-native-logs.fx';\n// load expo-asset immediately to set a custom `source` transformer in React Native\nimport 'expo-asset';\n\nimport Constants, { ExecutionEnvironment } from 'expo-constants';\nimport * as Font from 'expo-font';\nimport { NativeModulesProxy, Platform } from 'expo-modules-core';\nimport React from 'react';\nimport { AppRegistry, StyleSheet } from 'react-native';\n\nimport DevAppContainer from './environment/DevAppContainer';\n\n// Represents an app running in the store client or an app built with the legacy `expo build` command.\n// `false` when running in bare workflow, custom dev clients, or `eas build`s (managed or bare).\n// This should be used to ensure code that _should_ exist is treated as such.\nconst isManagedEnvironment =\n Constants.executionEnvironment === ExecutionEnvironment.Standalone ||\n Constants.executionEnvironment === ExecutionEnvironment.StoreClient;\n\n// If expo-font is installed and the style preprocessor is available, use it to parse fonts.\nif (StyleSheet.setStyleAttributePreprocessor) {\n StyleSheet.setStyleAttributePreprocessor('fontFamily', Font.processFontFamily);\n}\n\n// Asserts if bare workflow isn't setup correctly.\nif (NativeModulesProxy.ExpoUpdates?.isMissingRuntimeVersion) {\n const message =\n 'expo-updates is installed but there is no runtime or SDK version configured. ' +\n \"You'll need to configure one of these two properties in \" +\n Platform.select({ ios: 'Expo.plist', android: 'AndroidManifest.xml' }) +\n ' before OTA updates will work properly.';\n if (__DEV__) {\n console.warn(message);\n } else {\n throw new Error(message);\n }\n}\n\n// Having two if statements will enable terser to remove the entire block.\nif (__DEV__) {\n // Only enable the fast refresh indicator for managed iOS apps in dev mode.\n if (isManagedEnvironment && Platform.OS === 'ios') {\n // add the dev app container wrapper component on ios\n // @ts-ignore\n AppRegistry.setWrapperComponentProvider(() => DevAppContainer);\n\n // @ts-ignore\n const originalSetWrapperComponentProvider = AppRegistry.setWrapperComponentProvider;\n\n // @ts-ignore\n AppRegistry.setWrapperComponentProvider = (provider) => {\n function PatchedProviderComponent(props: any) {\n const ProviderComponent = provider();\n\n return (\n <DevAppContainer>\n <ProviderComponent {...props} />\n </DevAppContainer>\n );\n }\n\n originalSetWrapperComponentProvider(() => PatchedProviderComponent);\n };\n }\n}\n"]}
@@ -1,112 +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.3",
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",
22
- "expo-application": "~4.0.0",
23
- "expo-asset": "~8.4.3",
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",
20
+ "expo-app-loading": "~1.3.0",
21
+ "expo-apple-authentication": "~4.1.0",
22
+ "expo-application": "~4.0.1",
23
+ "expo-asset": "~8.4.4",
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.1.3",
38
- "expo-contacts": "~10.0.3",
39
- "expo-crypto": "~10.0.3",
40
- "expo-dev-client": "~0.6.3",
41
- "expo-device": "~4.0.3",
42
- "expo-document-picker": "~10.0.3",
43
- "expo-error-recovery": "~3.0.3",
44
- "expo-face-detector": "~11.0.3",
45
- "expo-facebook": "~12.0.3",
46
- "expo-file-system": "~13.0.3",
47
- "expo-firebase-analytics": "~5.0.3",
48
- "expo-firebase-core": "~4.0.3",
49
- "expo-firebase-recaptcha": "~2.0.2",
50
- "expo-font": "~10.0.3",
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",
61
- "expo-keep-awake": "~10.0.0",
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.4.9",
71
- "expo-navigation-bar": "~1.0.0",
72
- "expo-network": "~4.0.3",
73
- "expo-notifications": "~0.13.3",
74
- "expo-permissions": "~13.0.3",
75
- "expo-print": "~11.0.4",
76
- "expo-random": "~12.0.1",
77
- "expo-screen-orientation": "~4.0.3",
78
- "expo-secure-store": "~11.0.3",
79
- "expo-sensors": "~11.0.3",
80
- "expo-sharing": "~10.0.3",
81
- "expo-sms": "~10.0.3",
82
- "expo-speech": "~10.0.3",
83
- "expo-splash-screen": "~0.13.5",
84
- "expo-sqlite": "~10.0.3",
85
- "expo-status-bar": "~1.1.0",
86
- "expo-store-review": "~5.0.3",
87
- "expo-system-ui": "~1.0.0",
88
- "expo-task-manager": "~10.0.3",
89
- "expo-tracking-transparency": "~2.0.3",
90
- "expo-updates": "~0.10.15",
91
- "expo-video-thumbnails": "~6.0.3",
92
- "expo-web-browser": "~10.0.3",
93
- "lottie-react-native": "4.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.1",
40
+ "expo-dev-client": "~0.7.2",
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.1",
45
+ "expo-facebook": "~12.1.0",
46
+ "expo-file-system": "~13.1.0",
47
+ "expo-firebase-analytics": "~6.0.0",
48
+ "expo-firebase-core": "~4.1.0",
49
+ "expo-firebase-recaptcha": "~2.1.0",
50
+ "expo-font": "~10.0.4",
51
+ "expo-gl": "~11.1.1",
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.1",
59
+ "expo-in-app-purchases": "~12.1.0",
60
+ "expo-intent-launcher": "~10.1.0",
61
+ "expo-keep-awake": "~10.0.1",
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.1",
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.2",
71
+ "expo-navigation-bar": "~1.1.1",
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.1",
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.2",
91
+ "expo-video-thumbnails": "~6.1.0",
92
+ "expo-web-browser": "~10.1.0",
93
+ "lottie-react-native": "5.0.1",
94
94
  "react-native-appearance": "~0.3.3",
95
95
  "react-native-branch": "5.0.0",
96
- "react-native-gesture-handler": "~1.10.2",
96
+ "react-native-gesture-handler": "~2.1.0",
97
97
  "react-native-get-random-values": "~1.7.0",
98
- "react-native-maps": "0.28.1",
99
- "react-native-pager-view": "5.4.6",
100
- "react-native-reanimated": "~2.2.0",
98
+ "react-native-maps": "0.29.4",
99
+ "react-native-pager-view": "5.4.9",
100
+ "react-native-reanimated": "~2.3.1",
101
101
  "react-native-safe-area-context": "3.3.2",
102
- "react-native-screens": "~3.8.0",
103
- "react-native-shared-element": "0.8.2",
102
+ "react-native-screens": "~3.10.1",
103
+ "react-native-shared-element": "0.8.3",
104
104
  "react-native-svg": "12.1.1",
105
105
  "react-native-unimodules": "~0.15.0",
106
106
  "react-native-view-shot": "3.1.2",
107
- "react-native-webview": "11.13.0",
107
+ "react-native-webview": "11.15.0",
108
108
  "sentry-expo": "^4.0.0",
109
109
  "unimodules-app-loader": "~3.0.0",
110
110
  "unimodules-image-loader-interface": "~6.1.0",
111
- "unimodules-task-manager-interface": "~7.0.3"
111
+ "unimodules-task-manager-interface": "~7.1.0"
112
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": "43.0.4",
3
+ "version": "44.0.0-beta.2",
4
4
  "description": "The Expo SDK",
5
5
  "main": "build/Expo.js",
6
6
  "module": "build/Expo.js",
@@ -55,39 +55,38 @@
55
55
  "homepage": "https://github.com/expo/expo/tree/master/packages/expo",
56
56
  "dependencies": {
57
57
  "@babel/runtime": "^7.14.0",
58
- "@expo/metro-config": "~0.1.84",
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.2",
61
61
  "cross-spawn": "^6.0.5",
62
- "expo-application": "~4.0.0",
63
- "expo-asset": "~8.4.3",
64
- "expo-constants": "~12.1.3",
65
- "expo-file-system": "~13.0.3",
66
- "expo-font": "~10.0.3",
67
- "expo-keep-awake": "~10.0.0",
68
- "expo-modules-autolinking": "~0.3.4",
69
- "expo-modules-core": "~0.4.9",
62
+ "expo-application": "~4.0.1",
63
+ "expo-asset": "~8.4.4",
64
+ "expo-constants": "~13.0.0",
65
+ "expo-file-system": "~13.1.0",
66
+ "expo-font": "~10.0.4",
67
+ "expo-keep-awake": "~10.0.1",
68
+ "expo-modules-autolinking": "0.5.1",
69
+ "expo-modules-core": "0.6.2",
70
70
  "fbemitter": "^2.1.1",
71
- "invariant": "^2.2.2",
71
+ "invariant": "^2.2.4",
72
72
  "md5-file": "^3.2.3",
73
- "pretty-format": "^26.4.0",
73
+ "pretty-format": "^26.5.2",
74
74
  "uuid": "^3.4.0"
75
75
  },
76
76
  "optionalDependencies": {
77
- "expo-error-recovery": "~3.0.3"
77
+ "expo-error-recovery": "~3.0.4"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@types/fbemitter": "^2.0.32",
81
- "@types/invariant": "^2.2.29",
82
- "@types/react": "^17.0.18",
81
+ "@types/invariant": "^2.2.33",
82
+ "@types/react": "~17.0.21",
83
83
  "@types/react-native": "~0.64.12",
84
84
  "@types/react-test-renderer": "^17.0.1",
85
85
  "@types/uuid": "^3.4.7",
86
- "expo-location": "^13.0.4",
87
86
  "expo-module-scripts": "^2.0.0",
88
87
  "react": "17.0.1",
89
88
  "react-dom": "17.0.1",
90
89
  "react-native": "0.64.3"
91
90
  },
92
- "gitHead": "f7c098741da677fe83d7c554631c6447d14a2366"
91
+ "gitHead": "779a011c9a6a436d3e69df0f8f7d1a4703fb297a"
93
92
  }
@@ -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 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AI,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"]}