expo 44.0.0-beta.0 → 44.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/android/build.gradle +17 -2
- package/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt +12 -3
- package/android/src/test/java/expo/modules/ReactActivityDelegateWrapperTest.kt +109 -0
- package/bundledNativeModules.json +16 -16
- package/package.json +6 -6
- package/scripts/autolinking.rb +10 -0
package/android/build.gradle
CHANGED
|
@@ -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.
|
|
11
|
+
version = '44.0.1'
|
|
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.
|
|
65
|
+
versionName "44.0.1"
|
|
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)
|
|
@@ -13,6 +13,7 @@ import com.facebook.react.ReactInstanceManager
|
|
|
13
13
|
import com.facebook.react.ReactNativeHost
|
|
14
14
|
import com.facebook.react.ReactRootView
|
|
15
15
|
import com.facebook.react.modules.core.PermissionListener
|
|
16
|
+
import expo.modules.core.interfaces.ReactActivityLifecycleListener
|
|
16
17
|
import java.lang.reflect.Method
|
|
17
18
|
|
|
18
19
|
class ReactActivityDelegateWrapper(
|
|
@@ -45,7 +46,7 @@ class ReactActivityDelegateWrapper(
|
|
|
45
46
|
return delegate.reactInstanceManager
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
override fun getMainComponentName(): String {
|
|
49
|
+
override fun getMainComponentName(): String? {
|
|
49
50
|
return delegate.mainComponentName
|
|
50
51
|
}
|
|
51
52
|
|
|
@@ -115,11 +116,19 @@ class ReactActivityDelegateWrapper(
|
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
override fun onBackPressed(): Boolean {
|
|
118
|
-
|
|
119
|
+
val listenerResult = reactActivityLifecycleListeners
|
|
120
|
+
.map(ReactActivityLifecycleListener::onBackPressed)
|
|
121
|
+
.fold(false) { accu, current -> accu || current }
|
|
122
|
+
val delegateResult = delegate.onBackPressed()
|
|
123
|
+
return listenerResult || delegateResult
|
|
119
124
|
}
|
|
120
125
|
|
|
121
126
|
override fun onNewIntent(intent: Intent?): Boolean {
|
|
122
|
-
|
|
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
|
|
123
132
|
}
|
|
124
133
|
|
|
125
134
|
override fun onWindowFocusChanged(hasFocus: Boolean) {
|
|
@@ -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
|
+
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"expo-app-loading": "~1.3.0",
|
|
21
21
|
"expo-apple-authentication": "~4.1.0",
|
|
22
22
|
"expo-application": "~4.0.1",
|
|
23
|
-
"expo-asset": "~8.4.
|
|
23
|
+
"expo-asset": "~8.4.5",
|
|
24
24
|
"expo-auth-session": "~3.5.0",
|
|
25
25
|
"expo-av": "~10.2.0",
|
|
26
26
|
"expo-background-fetch": "~10.1.0",
|
|
@@ -36,26 +36,26 @@
|
|
|
36
36
|
"expo-clipboard": "~2.1.0",
|
|
37
37
|
"expo-constants": "~13.0.0",
|
|
38
38
|
"expo-contacts": "~10.1.0",
|
|
39
|
-
"expo-crypto": "~10.1.
|
|
40
|
-
"expo-dev-client": "~0.7.
|
|
39
|
+
"expo-crypto": "~10.1.1",
|
|
40
|
+
"expo-dev-client": "~0.7.2",
|
|
41
41
|
"expo-device": "~4.1.0",
|
|
42
42
|
"expo-document-picker": "~10.1.0",
|
|
43
43
|
"expo-error-recovery": "~3.0.4",
|
|
44
|
-
"expo-face-detector": "~11.1.
|
|
44
|
+
"expo-face-detector": "~11.1.1",
|
|
45
45
|
"expo-facebook": "~12.1.0",
|
|
46
46
|
"expo-file-system": "~13.1.0",
|
|
47
47
|
"expo-firebase-analytics": "~6.0.0",
|
|
48
48
|
"expo-firebase-core": "~4.1.0",
|
|
49
49
|
"expo-firebase-recaptcha": "~2.1.0",
|
|
50
50
|
"expo-font": "~10.0.4",
|
|
51
|
-
"expo-gl": "~11.1.
|
|
51
|
+
"expo-gl": "~11.1.1",
|
|
52
52
|
"expo-gl-cpp": "~11.1.0",
|
|
53
53
|
"expo-google-app-auth": "~8.3.0",
|
|
54
54
|
"expo-google-sign-in": "~10.1.0",
|
|
55
55
|
"expo-haptics": "~11.1.0",
|
|
56
56
|
"expo-image-loader": "~3.1.0",
|
|
57
57
|
"expo-image-manipulator": "~10.2.0",
|
|
58
|
-
"expo-image-picker": "~12.0.
|
|
58
|
+
"expo-image-picker": "~12.0.1",
|
|
59
59
|
"expo-in-app-purchases": "~12.1.0",
|
|
60
60
|
"expo-intent-launcher": "~10.1.0",
|
|
61
61
|
"expo-keep-awake": "~10.0.1",
|
|
@@ -63,43 +63,43 @@
|
|
|
63
63
|
"expo-linking": "~3.0.0",
|
|
64
64
|
"expo-local-authentication": "~12.1.0",
|
|
65
65
|
"expo-localization": "~12.0.0",
|
|
66
|
-
"expo-location": "~14.0.
|
|
66
|
+
"expo-location": "~14.0.1",
|
|
67
67
|
"expo-mail-composer": "~11.1.0",
|
|
68
68
|
"expo-media-library": "~14.0.0",
|
|
69
69
|
"expo-module-template": "~10.1.0",
|
|
70
|
-
"expo-modules-core": "~0.6.
|
|
71
|
-
"expo-navigation-bar": "~1.1.
|
|
70
|
+
"expo-modules-core": "~0.6.3",
|
|
71
|
+
"expo-navigation-bar": "~1.1.1",
|
|
72
72
|
"expo-network": "~4.1.0",
|
|
73
73
|
"expo-notifications": "~0.14.0",
|
|
74
74
|
"expo-permissions": "~13.1.0",
|
|
75
75
|
"expo-print": "~11.1.0",
|
|
76
|
-
"expo-random": "~12.1.
|
|
77
|
-
"expo-screen-orientation": "~4.1.
|
|
76
|
+
"expo-random": "~12.1.1",
|
|
77
|
+
"expo-screen-orientation": "~4.1.1",
|
|
78
78
|
"expo-secure-store": "~11.1.0",
|
|
79
79
|
"expo-sensors": "~11.1.0",
|
|
80
80
|
"expo-sharing": "~10.1.0",
|
|
81
81
|
"expo-sms": "~10.1.0",
|
|
82
82
|
"expo-speech": "~10.1.0",
|
|
83
|
-
"expo-splash-screen": "~0.14.
|
|
83
|
+
"expo-splash-screen": "~0.14.1",
|
|
84
84
|
"expo-sqlite": "~10.1.0",
|
|
85
85
|
"expo-status-bar": "~1.2.0",
|
|
86
86
|
"expo-store-review": "~5.1.0",
|
|
87
87
|
"expo-system-ui": "~1.1.0",
|
|
88
88
|
"expo-task-manager": "~10.1.0",
|
|
89
89
|
"expo-tracking-transparency": "~2.1.0",
|
|
90
|
-
"expo-updates": "~0.11.
|
|
90
|
+
"expo-updates": "~0.11.3",
|
|
91
91
|
"expo-video-thumbnails": "~6.1.0",
|
|
92
92
|
"expo-web-browser": "~10.1.0",
|
|
93
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": "~2.
|
|
96
|
+
"react-native-gesture-handler": "~2.1.0",
|
|
97
97
|
"react-native-get-random-values": "~1.7.0",
|
|
98
98
|
"react-native-maps": "0.29.4",
|
|
99
99
|
"react-native-pager-view": "5.4.9",
|
|
100
|
-
"react-native-reanimated": "~2.
|
|
100
|
+
"react-native-reanimated": "~2.3.1",
|
|
101
101
|
"react-native-safe-area-context": "3.3.2",
|
|
102
|
-
"react-native-screens": "~3.
|
|
102
|
+
"react-native-screens": "~3.10.1",
|
|
103
103
|
"react-native-shared-element": "0.8.3",
|
|
104
104
|
"react-native-svg": "12.1.1",
|
|
105
105
|
"react-native-unimodules": "~0.15.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo",
|
|
3
|
-
"version": "44.0.
|
|
3
|
+
"version": "44.0.1",
|
|
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": "~9.0.
|
|
60
|
+
"babel-preset-expo": "~9.0.2",
|
|
61
61
|
"cross-spawn": "^6.0.5",
|
|
62
62
|
"expo-application": "~4.0.1",
|
|
63
|
-
"expo-asset": "~8.4.
|
|
63
|
+
"expo-asset": "~8.4.5",
|
|
64
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.5.
|
|
69
|
-
"expo-modules-core": "0.6.
|
|
68
|
+
"expo-modules-autolinking": "0.5.2",
|
|
69
|
+
"expo-modules-core": "0.6.3",
|
|
70
70
|
"fbemitter": "^2.1.1",
|
|
71
71
|
"invariant": "^2.2.4",
|
|
72
72
|
"md5-file": "^3.2.3",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"react-dom": "17.0.1",
|
|
89
89
|
"react-native": "0.64.3"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "5145f283481b62ea2a12cc98c308ca9b9aef3899"
|
|
92
92
|
}
|
package/scripts/autolinking.rb
CHANGED
|
@@ -3,6 +3,7 @@ require 'pathname'
|
|
|
3
3
|
require 'colored2' # dependency of CocoaPods
|
|
4
4
|
|
|
5
5
|
require File.join(File.dirname(`node --print "require.resolve('expo-modules-autolinking/package.json')"`), "scripts/ios/autolinking_manager")
|
|
6
|
+
require File.join(File.dirname(`node --print "require.resolve('expo-modules-autolinking/package.json')"`), "scripts/ios/react_import_patcher")
|
|
6
7
|
|
|
7
8
|
def use_expo_modules!(options = {})
|
|
8
9
|
# When run from the Podfile, `self` points to Pod::Podfile object
|
|
@@ -14,3 +15,12 @@ def use_expo_modules!(options = {})
|
|
|
14
15
|
|
|
15
16
|
@current_target_definition.autolinking_manager = Expo::AutolinkingManager.new(self, @current_target_definition, options).use_expo_modules!
|
|
16
17
|
end
|
|
18
|
+
|
|
19
|
+
def expo_patch_react_imports!(installer, options = {})
|
|
20
|
+
unless installer.is_a?(Pod::Installer)
|
|
21
|
+
Pod::UI.warn 'expo_patch_react_imports!() - Invalid `installer` parameter'.red
|
|
22
|
+
return
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
Expo::ReactImportPatcher.new(installer, options).run!
|
|
26
|
+
end
|