expo 49.0.0-alpha.3 → 49.0.0-alpha.4

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.
@@ -33,7 +33,7 @@ def getRNVersion() {
33
33
  ensureDependeciesWereEvaluated(project)
34
34
 
35
35
  group = 'host.exp.exponent'
36
- version = '49.0.0-alpha.3'
36
+ version = '49.0.0-alpha.4'
37
37
 
38
38
  buildscript {
39
39
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
@@ -65,19 +65,11 @@ buildscript {
65
65
  }
66
66
  }
67
67
 
68
- // Creating sources with comments
69
- task androidSourcesJar(type: Jar) {
70
- classifier = 'sources'
71
- from android.sourceSets.main.java.srcDirs
72
- }
73
-
74
68
  afterEvaluate {
75
69
  publishing {
76
70
  publications {
77
71
  release(MavenPublication) {
78
72
  from components.release
79
- // Add additional sourcesJar to artifacts
80
- artifact(androidSourcesJar)
81
73
  }
82
74
  }
83
75
  repositories {
@@ -100,11 +92,12 @@ android {
100
92
  jvmTarget = JavaVersion.VERSION_11.majorVersion
101
93
  }
102
94
 
95
+ namespace "expo.core"
103
96
  defaultConfig {
104
97
  minSdkVersion safeExtGet("minSdkVersion", 21)
105
98
  targetSdkVersion safeExtGet("targetSdkVersion", 33)
106
99
  versionCode 1
107
- versionName "49.0.0-alpha.3"
100
+ versionName "49.0.0-alpha.4"
108
101
  consumerProguardFiles("proguard-rules.pro")
109
102
  }
110
103
  lintOptions {
@@ -132,13 +125,18 @@ android {
132
125
  }
133
126
  }
134
127
  }
128
+ publishing {
129
+ singleVariant("release") {
130
+ withSourcesJar()
131
+ }
132
+ }
135
133
  }
136
134
 
137
135
  dependencies { dependencyHandler ->
138
136
  //noinspection GradleDynamicVersion
139
137
  implementation 'com.facebook.react:react-native:+'
140
138
 
141
- testImplementation 'junit:junit:4.13.1'
139
+ testImplementation 'junit:junit:4.13.2'
142
140
  testImplementation 'androidx.test:core:1.4.0'
143
141
  testImplementation "com.google.truth:truth:1.1.2"
144
142
  testImplementation 'io.mockk:mockk:1.12.0'
@@ -1,3 +1,3 @@
1
- <manifest package="expo.core">
1
+ <manifest>
2
2
 
3
3
  </manifest>
@@ -34,6 +34,14 @@ class ReactActivityDelegateWrapper(
34
34
  private val reactActivityHandlers = ExpoModulesPackage.packageList
35
35
  .flatMap { it.createReactActivityHandlers(activity) }
36
36
  private val methodMap: ArrayMap<String, Method> = ArrayMap()
37
+ private val host: ReactNativeHost by lazy {
38
+ invokeDelegateMethod("getReactNativeHost")
39
+ }
40
+ /**
41
+ * When the app delay for `loadApp`, the ReactInstanceManager's lifecycle will be disrupted.
42
+ * This flag indicates we should emit `onResume` after `loadApp`.
43
+ */
44
+ private var shouldEmitPendingResume = false
37
45
 
38
46
  //region ReactActivityDelegate
39
47
 
@@ -50,7 +58,7 @@ class ReactActivityDelegateWrapper(
50
58
  }
51
59
 
52
60
  override fun getReactNativeHost(): ReactNativeHost {
53
- return invokeDelegateMethod("getReactNativeHost")
61
+ return host
54
62
  }
55
63
 
56
64
  override fun getReactInstanceManager(): ReactInstanceManager {
@@ -76,9 +84,23 @@ class ReactActivityDelegateWrapper(
76
84
  reactDelegate.loadApp(appKey)
77
85
  rootViewContainer.addView(reactDelegate.reactRootView, ViewGroup.LayoutParams.MATCH_PARENT)
78
86
  activity.setContentView(rootViewContainer)
79
- } else {
80
- return invokeDelegateMethod("loadApp", arrayOf(String::class.java), arrayOf(appKey))
87
+ return
81
88
  }
89
+
90
+ val delayLoadAppHandler = reactActivityHandlers.asSequence()
91
+ .mapNotNull { it.getDelayLoadAppHandler(activity, host) }
92
+ .firstOrNull()
93
+ if (delayLoadAppHandler != null) {
94
+ delayLoadAppHandler.whenReady {
95
+ invokeDelegateMethod<Unit, String?>("loadApp", arrayOf(String::class.java), arrayOf(appKey))
96
+ if (shouldEmitPendingResume) {
97
+ onResume()
98
+ }
99
+ }
100
+ return
101
+ }
102
+
103
+ return invokeDelegateMethod("loadApp", arrayOf(String::class.java), arrayOf(appKey))
82
104
  }
83
105
 
84
106
  override fun onCreate(savedInstanceState: Bundle?) {
@@ -123,13 +145,23 @@ class ReactActivityDelegateWrapper(
123
145
  }
124
146
 
125
147
  override fun onResume() {
148
+ if (!host.hasInstance()) {
149
+ shouldEmitPendingResume = true
150
+ return
151
+ }
126
152
  invokeDelegateMethod<Unit>("onResume")
127
153
  reactActivityLifecycleListeners.forEach { listener ->
128
154
  listener.onResume(activity)
129
155
  }
156
+ shouldEmitPendingResume = false
130
157
  }
131
158
 
132
159
  override fun onPause() {
160
+ // If app is stopped before delayed `loadApp`, we should cancel the pending resume
161
+ shouldEmitPendingResume = false
162
+ if (!host.hasInstance()) {
163
+ return
164
+ }
133
165
  reactActivityLifecycleListeners.forEach { listener ->
134
166
  listener.onPause(activity)
135
167
  }
@@ -137,6 +169,11 @@ class ReactActivityDelegateWrapper(
137
169
  }
138
170
 
139
171
  override fun onDestroy() {
172
+ // If app is stopped before delayed `loadApp`, we should cancel the pending resume
173
+ shouldEmitPendingResume = false
174
+ if (!host.hasInstance()) {
175
+ return
176
+ }
140
177
  reactActivityLifecycleListeners.forEach { listener ->
141
178
  listener.onDestroy(activity)
142
179
  }
@@ -1,5 +1,4 @@
1
- <manifest package="expo.modules.appauth"
2
- xmlns:android="http://schemas.android.com/apk/res/android"
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
2
  xmlns:tools="http://schemas.android.com/tools">
4
3
  <application>
5
4
 
@@ -13,49 +13,49 @@
13
13
  "expo-app-auth": "~11.1.0",
14
14
  "expo-app-loader-provider": "~8.0.0",
15
15
  "expo-apple-authentication": "~6.1.0",
16
- "expo-application": "~5.2.0",
17
- "expo-asset": "~8.9.2",
16
+ "expo-application": "~5.3.0",
17
+ "expo-asset": "~8.10.0",
18
18
  "expo-auth-session": "~4.1.0",
19
19
  "expo-av": "~13.3.0",
20
20
  "expo-background-fetch": "~11.2.0",
21
- "expo-barcode-scanner": "~12.4.0",
22
- "expo-battery": "~7.2.0",
23
- "expo-blur": "~12.3.1",
21
+ "expo-barcode-scanner": "~12.5.0",
22
+ "expo-battery": "~7.3.0",
23
+ "expo-blur": "~12.3.2",
24
24
  "expo-brightness": "~11.3.0",
25
25
  "expo-build-properties": "~0.7.0",
26
26
  "expo-calendar": "~11.2.0",
27
- "expo-camera": "~13.3.0",
27
+ "expo-camera": "~13.4.0",
28
28
  "expo-cellular": "~5.2.0",
29
29
  "expo-checkbox": "~2.4.0",
30
30
  "expo-clipboard": "~4.2.0",
31
- "expo-constants": "~14.3.0",
31
+ "expo-constants": "~14.4.0",
32
32
  "expo-contacts": "~12.1.0",
33
- "expo-crypto": "~12.3.0",
33
+ "expo-crypto": "~12.4.0",
34
34
  "expo-dev-client": "~2.3.0",
35
35
  "expo-device": "~5.3.0",
36
36
  "expo-document-picker": "~11.4.0",
37
37
  "expo-face-detector": "~12.1.2",
38
- "expo-file-system": "~15.3.0",
39
- "expo-font": "~11.2.0",
40
- "expo-gl": "~12.5.0",
38
+ "expo-file-system": "~15.4.0",
39
+ "expo-font": "~11.3.0",
40
+ "expo-gl": "~13.0.0",
41
41
  "expo-google-app-auth": "~8.3.0",
42
42
  "expo-haptics": "~12.3.0",
43
- "expo-image": "~1.2.2",
44
- "expo-image-loader": "~4.2.0",
43
+ "expo-image": "~1.3.0",
44
+ "expo-image-loader": "~4.3.0",
45
45
  "expo-image-manipulator": "~11.2.0",
46
- "expo-image-picker": "~14.2.0",
46
+ "expo-image-picker": "~14.3.0",
47
47
  "expo-in-app-purchases": "~14.2.0",
48
48
  "expo-intent-launcher": "~10.6.0",
49
- "expo-keep-awake": "~12.1.0",
49
+ "expo-keep-awake": "~12.2.0",
50
50
  "expo-linear-gradient": "~12.2.0",
51
51
  "expo-linking": "~4.1.0",
52
- "expo-local-authentication": "~13.4.0",
52
+ "expo-local-authentication": "~13.4.1",
53
53
  "expo-localization": "~14.2.0",
54
- "expo-location": "~15.2.0",
54
+ "expo-location": "~15.3.0",
55
55
  "expo-mail-composer": "~12.2.0",
56
56
  "expo-media-library": "~15.3.0",
57
57
  "expo-module-template": "~10.7.19",
58
- "expo-modules-core": "~1.3.2",
58
+ "expo-modules-core": "~1.4.0",
59
59
  "expo-navigation-bar": "~2.2.0",
60
60
  "expo-network": "~5.3.0",
61
61
  "expo-notifications": "~0.19.0",
@@ -63,8 +63,8 @@
63
63
  "expo-print": "~12.3.0",
64
64
  "expo-random": "~13.1.2",
65
65
  "expo-screen-capture": "~5.2.0",
66
- "expo-screen-orientation": "~5.2.0",
67
- "expo-secure-store": "~12.2.0",
66
+ "expo-screen-orientation": "~6.0.0-beta.1",
67
+ "expo-secure-store": "~12.3.0",
68
68
  "expo-sensors": "~12.2.0",
69
69
  "expo-sharing": "~11.4.0",
70
70
  "expo-sms": "~11.3.0",
@@ -82,24 +82,24 @@
82
82
  "lottie-react-native": "5.1.4",
83
83
  "react": "18.2.0",
84
84
  "react-dom": "18.2.0",
85
- "react-native": "0.71.7",
85
+ "react-native": "0.72.0-rc.5",
86
86
  "react-native-web": "~0.18.10",
87
87
  "react-native-branch": "^5.4.0",
88
- "react-native-gesture-handler": "~2.9.0",
88
+ "react-native-gesture-handler": "~2.10.1",
89
89
  "react-native-get-random-values": "~1.8.0",
90
90
  "react-native-maps": "1.3.2",
91
91
  "react-native-pager-view": "6.1.2",
92
- "react-native-reanimated": "~3.0.2",
92
+ "react-native-reanimated": "~3.1.0",
93
93
  "react-native-screens": "~3.20.0",
94
94
  "react-native-safe-area-context": "4.5.0",
95
95
  "react-native-shared-element": "0.8.8",
96
96
  "react-native-svg": "13.4.0",
97
97
  "react-native-view-shot": "3.5.0",
98
98
  "react-native-webview": "11.26.0",
99
- "sentry-expo": "~6.1.0",
99
+ "sentry-expo": "~6.2.0",
100
100
  "unimodules-app-loader": "~4.1.2",
101
101
  "unimodules-image-loader-interface": "~6.1.0",
102
102
  "@shopify/react-native-skia": "0.1.172",
103
103
  "@shopify/flash-list": "1.4.0",
104
- "@sentry/react-native": "4.13.0"
104
+ "@sentry/react-native": "4.15.2"
105
105
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo",
3
- "version": "49.0.0-alpha.3",
3
+ "version": "49.0.0-alpha.4",
4
4
  "description": "The Expo SDK",
5
5
  "main": "build/Expo.js",
6
6
  "module": "build/Expo.js",
@@ -58,19 +58,19 @@
58
58
  "homepage": "https://github.com/expo/expo/tree/main/packages/expo",
59
59
  "dependencies": {
60
60
  "@babel/runtime": "^7.20.0",
61
- "@expo/cli": "0.8.0",
61
+ "@expo/cli": "0.9.1",
62
62
  "@expo/vector-icons": "^13.0.0",
63
- "@expo/config-plugins": "7.0.0",
63
+ "@expo/config-plugins": "7.1.0",
64
64
  "@expo/config": "8.0.4",
65
- "babel-preset-expo": "~9.4.0",
66
- "expo-application": "~5.2.0",
67
- "expo-asset": "~8.9.2",
68
- "expo-constants": "~14.3.0",
69
- "expo-file-system": "~15.3.0",
70
- "expo-font": "~11.2.0",
71
- "expo-keep-awake": "~12.1.0",
72
- "expo-modules-autolinking": "1.3.0",
73
- "expo-modules-core": "1.3.2",
65
+ "babel-preset-expo": "~9.4.1",
66
+ "expo-application": "~5.3.0",
67
+ "expo-asset": "~8.10.0",
68
+ "expo-constants": "~14.4.0",
69
+ "expo-file-system": "~15.4.0",
70
+ "expo-font": "~11.3.0",
71
+ "expo-keep-awake": "~12.2.0",
72
+ "expo-modules-autolinking": "1.4.0",
73
+ "expo-modules-core": "1.4.0",
74
74
  "fbemitter": "^3.0.0",
75
75
  "invariant": "^2.2.4",
76
76
  "md5-file": "^3.2.3",
@@ -84,10 +84,10 @@
84
84
  "@types/react": "~18.0.14",
85
85
  "@types/react-test-renderer": "^18.0.0",
86
86
  "@types/uuid": "^3.4.7",
87
- "expo-module-scripts": "^3.0.8",
87
+ "expo-module-scripts": "^3.0.9",
88
88
  "react": "18.2.0",
89
89
  "react-dom": "18.2.0",
90
- "react-native": "0.71.7"
90
+ "react-native": "0.72.0-rc.5"
91
91
  },
92
- "gitHead": "66ba892e6d9d66854308f91ee566074924025d4d"
92
+ "gitHead": "3ccd2edee9cbfed217557675cb50f0ba5e55a9e4"
93
93
  }
@@ -1,12 +1,56 @@
1
+ const findProjectRoot = require('@react-native-community/cli-tools').findProjectRoot;
2
+ const fs = require('fs');
1
3
  const path = require('path');
2
4
 
5
+ const projectRoot = findProjectRoot();
6
+
7
+ function isMatchedInFile(filePath, regexp) {
8
+ const contents = fs.readFileSync(filePath, 'utf8');
9
+ return !!contents.match(regexp);
10
+ }
11
+
12
+ /**
13
+ * Checks if expo-modules-autolinking is setup on iOS
14
+ */
15
+ function isExpoModulesInstalledIos(projectRoot) {
16
+ const podfilePath = path.join(projectRoot, 'ios', 'Podfile');
17
+ if (!fs.existsSync(podfilePath)) {
18
+ // Assumes true for managed apps
19
+ return true;
20
+ }
21
+ return isMatchedInFile(
22
+ podfilePath,
23
+ /^\s*require File.join\(File\.dirname\(`node --print "require\.resolve\('expo\/package\.json'\)"`\), "scripts\/autolinking"\)\s*$/m
24
+ );
25
+ }
26
+
27
+ /**
28
+ * Checks if expo-modules-autolinking is setup on Android
29
+ */
30
+ function isExpoModulesInstalledAndroid(projectRoot) {
31
+ const gradlePath = path.join(projectRoot, 'android', 'settings.gradle');
32
+ if (!fs.existsSync(gradlePath)) {
33
+ // Assumes true for managed apps
34
+ return true;
35
+ }
36
+ return isMatchedInFile(
37
+ gradlePath,
38
+ /^\s*apply from: (new File|file)\(\["node", "--print", "require\.resolve\('expo\/package.json'\)"\]\.execute\(null, rootDir\)\.text\.trim\(\), "\.\.\/scripts\/autolinking\.gradle"\);?\s*$/m
39
+ );
40
+ }
41
+
3
42
  module.exports = {
4
43
  dependency: {
5
44
  platforms: {
6
- ios: {},
7
- android: {
8
- packageImportPath: 'import expo.modules.ExpoModulesPackage;',
9
- },
45
+ // To make Expo CLI works on bare react-native projects without installing Expo Modules, we disable autolinking in this case.
46
+ ios: !isExpoModulesInstalledIos(projectRoot) ? null : {},
47
+ android: !isExpoModulesInstalledAndroid(projectRoot)
48
+ ? null
49
+ : {
50
+ packageImportPath: 'import expo.modules.ExpoModulesPackage;',
51
+ },
52
+ macos: null,
53
+ windows: null,
10
54
  },
11
55
  },
12
56
  };