expo 44.0.5 → 45.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.
Files changed (74) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/android/build.gradle +73 -34
  3. package/android/proguard-rules.pro +4 -1
  4. package/android/src/legacyReactNativeHostWrapper/expo/modules/ReactNativeHostWrapper.kt +9 -0
  5. package/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt +65 -19
  6. package/android/src/main/java/expo/modules/{ReactNativeHostWrapper.kt → ReactNativeHostWrapperBase.kt} +10 -6
  7. package/android/src/reactNativeHostWrapper/expo/modules/ReactNativeHostWrapper.kt +32 -0
  8. package/android/src/test/AndroidManifest.xml +18 -0
  9. package/bin/cli.js +12 -6
  10. package/build/Expo.d.ts +1 -0
  11. package/build/Expo.d.ts.map +1 -0
  12. package/build/Expo.fx.d.ts +1 -0
  13. package/build/Expo.fx.d.ts.map +1 -0
  14. package/build/Expo.fx.web.d.ts +1 -0
  15. package/build/Expo.fx.web.d.ts.map +1 -0
  16. package/build/environment/DevAppContainer.d.ts +1 -0
  17. package/build/environment/DevAppContainer.d.ts.map +1 -0
  18. package/build/environment/DevLoadingView.d.ts +1 -0
  19. package/build/environment/DevLoadingView.d.ts.map +1 -0
  20. package/build/environment/DevLoadingView.js +8 -10
  21. package/build/environment/DevLoadingView.js.map +1 -1
  22. package/build/environment/getInstallationIdAsync.android.d.ts +1 -0
  23. package/build/environment/getInstallationIdAsync.android.d.ts.map +1 -0
  24. package/build/environment/getInstallationIdAsync.d.ts +1 -0
  25. package/build/environment/getInstallationIdAsync.d.ts.map +1 -0
  26. package/build/environment/getInstallationIdAsync.web.d.ts +1 -0
  27. package/build/environment/getInstallationIdAsync.web.d.ts.map +1 -0
  28. package/build/environment/getInstallationIdAsync.web.js +1 -1
  29. package/build/environment/getInstallationIdAsync.web.js.map +1 -1
  30. package/build/environment/logging.fx.d.ts +1 -0
  31. package/build/environment/logging.fx.d.ts.map +1 -0
  32. package/build/environment/logging.fx.js +6 -13
  33. package/build/environment/logging.fx.js.map +1 -1
  34. package/build/environment/react-native-logs.fx.d.ts +1 -0
  35. package/build/environment/react-native-logs.fx.d.ts.map +1 -0
  36. package/build/environment/react-native-logs.fx.js +1 -1
  37. package/build/environment/react-native-logs.fx.js.map +1 -1
  38. package/build/environment/validate.fx.d.ts +1 -0
  39. package/build/environment/validate.fx.d.ts.map +1 -0
  40. package/build/environment/validate.fx.js +3 -3
  41. package/build/environment/validate.fx.js.map +1 -1
  42. package/build/environment/validatorState.d.ts +1 -0
  43. package/build/environment/validatorState.d.ts.map +1 -0
  44. package/build/launch/RecoveryProps.d.ts +1 -0
  45. package/build/launch/RecoveryProps.d.ts.map +1 -0
  46. package/build/launch/registerRootComponent.d.ts +1 -0
  47. package/build/launch/registerRootComponent.d.ts.map +1 -0
  48. package/build/launch/withExpoRoot.d.ts +1 -0
  49. package/build/launch/withExpoRoot.d.ts.map +1 -0
  50. package/build/launch/withExpoRoot.types.d.ts +1 -0
  51. package/build/launch/withExpoRoot.types.d.ts.map +1 -0
  52. package/build/launch/withExpoRoot.web.d.ts +1 -0
  53. package/build/launch/withExpoRoot.web.d.ts.map +1 -0
  54. package/build/logs/LogSerialization.d.ts +1 -0
  55. package/build/logs/LogSerialization.d.ts.map +1 -0
  56. package/build/logs/LogSerialization.js +1 -1
  57. package/build/logs/LogSerialization.js.map +1 -1
  58. package/build/logs/Logs.d.ts +1 -0
  59. package/build/logs/Logs.d.ts.map +1 -0
  60. package/build/logs/Logs.web.d.ts +1 -0
  61. package/build/logs/Logs.web.d.ts.map +1 -0
  62. package/build/logs/RemoteConsole.d.ts +1 -0
  63. package/build/logs/RemoteConsole.d.ts.map +1 -0
  64. package/build/logs/RemoteLogging.d.ts +1 -0
  65. package/build/logs/RemoteLogging.d.ts.map +1 -0
  66. package/build/logs/format/ReactNodeFormatter.d.ts +1 -0
  67. package/build/logs/format/ReactNodeFormatter.d.ts.map +1 -0
  68. package/build/timer/polyfillNextTick.d.ts +1 -0
  69. package/build/timer/polyfillNextTick.d.ts.map +1 -0
  70. package/bundledNativeModules.json +96 -94
  71. package/ios/EXAppDefinesLoader.m +6 -0
  72. package/package.json +22 -22
  73. package/requiresExtraSetup.json +2 -2
  74. package/scripts/resolveAppEntry.js +38 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,25 @@
1
+ # Changelog
2
+
3
+ ## Unpublished
4
+
5
+ ### 🛠 Breaking changes
6
+
7
+ ### 🎉 New features
8
+
9
+ ### 🐛 Bug fixes
10
+
11
+ ### 💡 Others
12
+
13
+ ## 45.0.0-beta.2 — 2022-04-20
14
+
15
+ ### 🎉 New features
16
+
17
+ - Add `ReactNativeHostHandler.getUseDeveloperSupport()` to allow `expo-dev-launcher` to override this value at runtime. ([#17069](https://github.com/expo/expo/pull/17069) by [@esamelson](https://github.com/esamelson))
18
+
19
+ ## 45.0.0-beta.1 — 2022-04-18
20
+
21
+ ### 🎉 New features
22
+
23
+ - Add `EXPO_USE_BETA_CLI` to utilize the new `@expo/cli` versioned package. ([#17007](https://github.com/expo/expo/pull/17007) by [@EvanBacon](https://github.com/EvanBacon))
24
+ - Added Android `ReactNativeHostHandler.getJavaScriptExecutorFactory()` for a module to override the `JavaScriptExecutorFactory`. ([#17005](https://github.com/expo/expo/pull/17005) by [@kudo](https://github.com/kudo))
25
+ - Add `react`, `react-native`, `react-dom`, and `react-native-web` to `bundledNativeModules.json`. ([#17048](https://github.com/expo/expo/pull/17048) by [@EvanBacon](https://github.com/EvanBacon))
@@ -1,76 +1,115 @@
1
1
  apply plugin: 'com.android.library'
2
2
  apply plugin: 'kotlin-android'
3
- apply plugin: 'maven'
3
+ apply plugin: 'maven-publish'
4
4
 
5
5
  // Import autolinking script
6
6
  apply from: "../scripts/autolinking.gradle"
7
7
 
8
+ static def versionToNumber(major, minor, patch) {
9
+ return patch * 100 + minor * 10000 + major * 1000000
10
+ }
11
+
12
+ def getRNVersion() {
13
+ def nodeModulesVersion = [
14
+ "node",
15
+ "-e",
16
+ "console.log(require('react-native/package.json').version);"
17
+ ]
18
+ .execute([], projectDir)
19
+ .text
20
+ .trim()
21
+
22
+ def version = safeExtGet("reactNativeVersion", nodeModulesVersion)
23
+ def coreVersion = version.split("-")[0]
24
+ def (major, minor, patch) = coreVersion.tokenize('.').collect { it.toInteger() }
25
+
26
+ return versionToNumber(
27
+ major,
28
+ minor,
29
+ patch
30
+ )
31
+ }
32
+
8
33
  ensureDependeciesWereEvaluated(project)
9
34
 
10
35
  group = 'host.exp.exponent'
11
- version = '44.0.5'
36
+ version = '45.0.0-beta.2'
12
37
 
13
38
  buildscript {
39
+ def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
40
+ if (expoModulesCorePlugin.exists()) {
41
+ apply from: expoModulesCorePlugin
42
+ applyKotlinExpoModulesCorePlugin()
43
+ }
44
+
14
45
  // Simple helper that allows the root project to override versions declared by this library.
15
46
  ext.safeExtGet = { prop, fallback ->
16
47
  rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
17
48
  }
18
49
 
50
+ // Ensures backward compatibility
51
+ ext.getKotlinVersion = {
52
+ if (ext.has("kotlinVersion")) {
53
+ ext.kotlinVersion()
54
+ } else {
55
+ ext.safeExtGet("kotlinVersion", "1.6.10")
56
+ }
57
+ }
58
+
19
59
  repositories {
20
60
  mavenCentral()
21
61
  }
22
62
 
23
63
  dependencies {
24
- classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.4.21')}")
64
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
25
65
  }
26
66
  }
27
67
 
28
- //Upload android library to maven with javadoc and android sources
29
- configurations {
30
- deployerJars
31
- }
32
-
33
- //Creating sources with comments
68
+ // Creating sources with comments
34
69
  task androidSourcesJar(type: Jar) {
35
70
  classifier = 'sources'
36
71
  from android.sourceSets.main.java.srcDirs
37
72
  }
38
73
 
39
- //Put the androidSources and javadoc to the artifacts
40
- artifacts {
41
- archives androidSourcesJar
42
- }
43
-
44
- uploadArchives {
45
- repositories {
46
- mavenDeployer {
47
- configuration = configurations.deployerJars
48
- repository(url: mavenLocal().url)
74
+ afterEvaluate {
75
+ publishing {
76
+ publications {
77
+ release(MavenPublication) {
78
+ from components.release
79
+ // Add additional sourcesJar to artifacts
80
+ artifact(androidSourcesJar)
81
+ }
82
+ }
83
+ repositories {
84
+ maven {
85
+ url = mavenLocal().url
86
+ }
49
87
  }
50
88
  }
51
89
  }
52
90
 
53
91
  android {
54
- compileSdkVersion safeExtGet("compileSdkVersion", 30)
92
+ compileSdkVersion safeExtGet("compileSdkVersion", 31)
55
93
 
56
94
  compileOptions {
57
- sourceCompatibility JavaVersion.VERSION_1_8
58
- targetCompatibility JavaVersion.VERSION_1_8
95
+ sourceCompatibility JavaVersion.VERSION_11
96
+ targetCompatibility JavaVersion.VERSION_11
97
+ }
98
+
99
+ kotlinOptions {
100
+ jvmTarget = JavaVersion.VERSION_11.majorVersion
59
101
  }
60
102
 
61
103
  defaultConfig {
62
104
  minSdkVersion safeExtGet("minSdkVersion", 21)
63
- targetSdkVersion safeExtGet("targetSdkVersion", 30)
105
+ targetSdkVersion safeExtGet("targetSdkVersion", 31)
64
106
  versionCode 1
65
- versionName "44.0.5"
107
+ versionName "45.0.0-beta.2"
66
108
  consumerProguardFiles("proguard-rules.pro")
67
109
  }
68
110
  lintOptions {
69
111
  abortOnError false
70
112
  }
71
- kotlinOptions {
72
- jvmTarget = '1.8'
73
- }
74
113
  testOptions {
75
114
  unitTests.includeAndroidResources = true
76
115
  }
@@ -79,16 +118,16 @@ android {
79
118
  main {
80
119
  java {
81
120
  srcDirs += new File(project.buildDir, generatedFilesSrcDir)
121
+
122
+ def rnVersion = getRNVersion()
123
+ if (rnVersion >= versionToNumber(0, 67, 0)) {
124
+ srcDirs += "src/reactNativeHostWrapper"
125
+ } else {
126
+ srcDirs += "src/legacyReactNativeHostWrapper"
127
+ }
82
128
  }
83
129
  }
84
130
  }
85
-
86
- unitTestVariants.all {
87
- it.mergedFlavor.manifestPlaceholders = [
88
- // Fix expo-app-auth manifest merger issue for unit test
89
- appAuthRedirectScheme: "test"
90
- ]
91
- }
92
131
  }
93
132
 
94
133
  dependencies { dependencyHandler ->
@@ -1,8 +1,11 @@
1
- # For ReactNativeDelegateWrapper
1
+ # For ReactActivityDelegateWrapper
2
2
  -keepclassmembers public class com.facebook.react.ReactActivityDelegate {
3
3
  protected *;
4
4
  private ReactDelegate mReactDelegate;
5
5
  }
6
+ -keepclassmembers public class com.facebook.react.ReactActivity {
7
+ private final ReactActivityDelegate mDelegate;
8
+ }
6
9
 
7
10
  # For ReactNativeHostWrapper
8
11
  -keepclassmembers public class com.facebook.react.ReactNativeHost {
@@ -0,0 +1,9 @@
1
+ package expo.modules
2
+
3
+ import android.app.Application
4
+ import com.facebook.react.ReactNativeHost
5
+
6
+ class ReactNativeHostWrapper(
7
+ application: Application,
8
+ host: ReactNativeHost
9
+ ) : ReactNativeHostWrapperBase(application, host)
@@ -5,6 +5,7 @@ import android.content.Context
5
5
  import android.content.Intent
6
6
  import android.os.Bundle
7
7
  import android.view.KeyEvent
8
+ import android.view.ViewGroup
8
9
  import androidx.collection.ArrayMap
9
10
  import com.facebook.react.ReactActivity
10
11
  import com.facebook.react.ReactActivityDelegate
@@ -14,12 +15,18 @@ import com.facebook.react.ReactNativeHost
14
15
  import com.facebook.react.ReactRootView
15
16
  import com.facebook.react.modules.core.PermissionListener
16
17
  import expo.modules.core.interfaces.ReactActivityLifecycleListener
18
+ import java.lang.reflect.Field
17
19
  import java.lang.reflect.Method
20
+ import java.lang.reflect.Modifier
18
21
 
19
22
  class ReactActivityDelegateWrapper(
20
23
  private val activity: ReactActivity,
21
- private val delegate: ReactActivityDelegate
24
+ private val isNewArchitectureEnabled: Boolean,
25
+ private var delegate: ReactActivityDelegate
22
26
  ) : ReactActivityDelegate(activity, null) {
27
+ constructor(activity: ReactActivity, delegate: ReactActivityDelegate) :
28
+ this(activity, false, delegate)
29
+
23
30
  private val reactActivityLifecycleListeners = ExpoModulesPackage.packageList
24
31
  .flatMap { it.createReactActivityLifecycleListeners(activity) }
25
32
  private val reactActivityHandlers = ExpoModulesPackage.packageList
@@ -33,9 +40,11 @@ class ReactActivityDelegateWrapper(
33
40
  }
34
41
 
35
42
  override fun createRootView(): ReactRootView {
36
- return reactActivityHandlers.asSequence()
43
+ val rootView = reactActivityHandlers.asSequence()
37
44
  .mapNotNull { it.createReactRootView(activity) }
38
45
  .firstOrNull() ?: invokeDelegateMethod("createRootView")
46
+ rootView.setIsFabric(isNewArchitectureEnabled)
47
+ return rootView
39
48
  }
40
49
 
41
50
  override fun getReactNativeHost(): ReactNativeHost {
@@ -51,26 +60,59 @@ class ReactActivityDelegateWrapper(
51
60
  }
52
61
 
53
62
  override fun loadApp(appKey: String?) {
54
- return invokeDelegateMethod("loadApp", arrayOf(String::class.java), arrayOf(appKey))
63
+ // Give modules a chance to wrap the ReactRootView in a container ViewGroup. If some module
64
+ // wants to do this, we override the functionality of `loadApp` and call `setContentView` with
65
+ // the new container view instead.
66
+ val rootViewContainer = reactActivityHandlers.asSequence()
67
+ .mapNotNull { it.createReactRootViewContainer(activity) }
68
+ .firstOrNull()
69
+ if (rootViewContainer != null) {
70
+ val mReactDelegate = ReactActivityDelegate::class.java.getDeclaredField("mReactDelegate")
71
+ mReactDelegate.isAccessible = true
72
+ val reactDelegate = mReactDelegate[delegate] as ReactDelegate
73
+
74
+ reactDelegate.loadApp(appKey)
75
+ rootViewContainer.addView(reactDelegate.reactRootView, ViewGroup.LayoutParams.MATCH_PARENT)
76
+ activity.setContentView(rootViewContainer)
77
+ } else {
78
+ return invokeDelegateMethod("loadApp", arrayOf(String::class.java), arrayOf(appKey))
79
+ }
55
80
  }
56
81
 
57
82
  override fun onCreate(savedInstanceState: Bundle?) {
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()
83
+ // Give handlers a chance as early as possible to replace the wrapped delegate object.
84
+ // If they do, we call the new wrapped delegate's `onCreate` instead of overriding it here.
85
+ val newDelegate = reactActivityHandlers.asSequence()
86
+ .mapNotNull { it.onDidCreateReactActivityDelegate(activity, this) }
87
+ .firstOrNull()
88
+ if (newDelegate != null && newDelegate != this) {
89
+ val mDelegateField = ReactActivity::class.java.getDeclaredField("mDelegate")
90
+ mDelegateField.isAccessible = true
91
+ val modifiers = Field::class.java.getDeclaredField("accessFlags")
92
+ modifiers.isAccessible = true
93
+ modifiers.setInt(mDelegateField, mDelegateField.modifiers and Modifier.FINAL.inv())
94
+ mDelegateField.set(activity, newDelegate)
95
+ delegate = newDelegate
96
+
97
+ invokeDelegateMethod<Unit, Bundle?>("onCreate", arrayOf(Bundle::class.java), arrayOf(savedInstanceState))
98
+ } else {
99
+ // Since we just wrap `ReactActivityDelegate` but not inherit it, in its `onCreate`,
100
+ // the calls to `createRootView()` or `getMainComponentName()` have no chances to be our wrapped methods.
101
+ // Instead we intercept `ReactActivityDelegate.onCreate` and replace the `mReactDelegate` with our version.
102
+ // That's not ideal but works.
103
+ val reactDelegate = object : ReactDelegate(
104
+ plainActivity, reactNativeHost, mainComponentName, launchOptions
105
+ ) {
106
+ override fun createRootView(): ReactRootView {
107
+ return this@ReactActivityDelegateWrapper.createRootView()
108
+ }
109
+ }
110
+ val mReactDelegate = ReactActivityDelegate::class.java.getDeclaredField("mReactDelegate")
111
+ mReactDelegate.isAccessible = true
112
+ mReactDelegate.set(delegate, reactDelegate)
113
+ if (mainComponentName != null) {
114
+ loadApp(mainComponentName)
67
115
  }
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
116
  }
75
117
 
76
118
  reactActivityLifecycleListeners.forEach { listener ->
@@ -108,7 +150,11 @@ class ReactActivityDelegateWrapper(
108
150
  }
109
151
 
110
152
  override fun onKeyUp(keyCode: Int, event: KeyEvent?): Boolean {
111
- return delegate.onKeyUp(keyCode, event)
153
+ // if any of the handlers return true, intentionally consume the event instead of passing it
154
+ // through to the delegate
155
+ return reactActivityHandlers
156
+ .map { it.onKeyUp(keyCode, event) }
157
+ .fold(false) { accu, current -> accu || current } || delegate.onKeyUp(keyCode, event)
112
158
  }
113
159
 
114
160
  override fun onKeyLongPress(keyCode: Int, event: KeyEvent?): Boolean {
@@ -14,11 +14,11 @@ import com.facebook.react.bridge.ReactApplicationContext
14
14
  import com.facebook.react.devsupport.RedBoxHandler
15
15
  import java.lang.reflect.Method
16
16
 
17
- class ReactNativeHostWrapper(
17
+ open class ReactNativeHostWrapperBase(
18
18
  application: Application,
19
- private val host: ReactNativeHost
19
+ protected val host: ReactNativeHost
20
20
  ) : ReactNativeHost(application) {
21
- private val reactNativeHostHandlers = ExpoModulesPackage.packageList
21
+ internal val reactNativeHostHandlers = ExpoModulesPackage.packageList
22
22
  .flatMap { it.createReactNativeHostHandlers(application) }
23
23
  private val methodMap: ArrayMap<String, Method> = ArrayMap()
24
24
 
@@ -44,7 +44,9 @@ class ReactNativeHostWrapper(
44
44
  }
45
45
 
46
46
  override fun getJavaScriptExecutorFactory(): JavaScriptExecutorFactory? {
47
- return invokeDelegateMethod("getJavaScriptExecutorFactory")
47
+ return reactNativeHostHandlers.asSequence()
48
+ .mapNotNull { it.javaScriptExecutorFactory }
49
+ .firstOrNull() ?: invokeDelegateMethod("getJavaScriptExecutorFactory")
48
50
  }
49
51
 
50
52
  @Suppress("DEPRECATION")
@@ -74,7 +76,9 @@ class ReactNativeHostWrapper(
74
76
  }
75
77
 
76
78
  override fun getUseDeveloperSupport(): Boolean {
77
- return host.useDeveloperSupport
79
+ return reactNativeHostHandlers.asSequence()
80
+ .mapNotNull { it.useDeveloperSupport }
81
+ .firstOrNull() ?: host.useDeveloperSupport
78
82
  }
79
83
 
80
84
  override fun getPackages(): MutableList<ReactPackage> {
@@ -100,7 +104,7 @@ class ReactNativeHostWrapper(
100
104
  }
101
105
 
102
106
  @Suppress("UNCHECKED_CAST")
103
- private fun <T> invokeDelegateMethod(name: String): T {
107
+ internal fun <T> invokeDelegateMethod(name: String): T {
104
108
  var method = methodMap[name]
105
109
  if (method == null) {
106
110
  method = ReactNativeHost::class.java.getDeclaredMethod(name)
@@ -0,0 +1,32 @@
1
+ package expo.modules
2
+
3
+ import android.app.Application
4
+ import com.facebook.react.ReactNativeHost
5
+ import com.facebook.react.ReactPackageTurboModuleManagerDelegate
6
+ import com.facebook.react.common.SurfaceDelegateFactory
7
+ import com.facebook.react.devsupport.DevSupportManagerFactory
8
+
9
+ class ReactNativeHostWrapper(
10
+ application: Application,
11
+ host: ReactNativeHost
12
+ ) : ReactNativeHostWrapperBase(application, host) {
13
+ override fun getDevSupportManagerFactory(): DevSupportManagerFactory? {
14
+ return reactNativeHostHandlers
15
+ .asSequence()
16
+ .mapNotNull { it.devSupportManagerFactory }
17
+ .firstOrNull() as DevSupportManagerFactory?
18
+ ?: invokeDelegateMethod("getDevSupportManagerFactory")
19
+ }
20
+
21
+ override fun getReactPackageTurboModuleManagerDelegateBuilder(): ReactPackageTurboModuleManagerDelegate.Builder? {
22
+ return invokeDelegateMethod("getReactPackageTurboModuleManagerDelegateBuilder")
23
+ }
24
+
25
+ override fun getShouldRequireActivity(): Boolean {
26
+ return host.shouldRequireActivity
27
+ }
28
+
29
+ override fun getSurfaceDelegateFactory(): SurfaceDelegateFactory {
30
+ return host.surfaceDelegateFactory
31
+ }
32
+ }
@@ -0,0 +1,18 @@
1
+ <manifest package="expo.modules.appauth"
2
+ xmlns:android="http://schemas.android.com/apk/res/android"
3
+ xmlns:tools="http://schemas.android.com/tools">
4
+ <application>
5
+
6
+ <!-- Fix unit test manifestMerger build error from expo -> autolinked expo-app-auth -> net.openid.appauth -->
7
+ <activity
8
+ android:name="net.openid.appauth.RedirectUriReceiverActivity"
9
+ android:exported="true" tools:node="replace">
10
+ <intent-filter>
11
+ <action android:name="android.intent.action.VIEW" />
12
+ <category android:name="android.intent.category.DEFAULT" />
13
+ <category android:name="android.intent.category.BROWSABLE" />
14
+ <data android:scheme="test" />
15
+ </intent-filter>
16
+ </activity>
17
+ </application>
18
+ </manifest>
package/bin/cli.js CHANGED
@@ -1,21 +1,27 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
- var spawn = require('cross-spawn').spawn;
3
+ const spawn = require('cross-spawn').spawn;
4
+ const { boolish } = require('getenv');
4
5
 
5
6
  run();
6
7
 
7
8
  function run() {
9
+ // Use new beta CLI.
10
+ if (boolish('EXPO_USE_BETA_CLI', false)) {
11
+ return spawn(require.resolve('@expo/cli'), process.argv.slice(2), { stdio: 'inherit' });
12
+ }
13
+
8
14
  spawn('expo-cli', process.argv.slice(2), { stdio: 'inherit' })
9
- .on('exit', function(code) {
15
+ .on('exit', function (code) {
10
16
  process.exit(code);
11
17
  })
12
- .on('error', function() {
18
+ .on('error', function () {
13
19
  console.warn('This command requires Expo CLI.');
14
- var rl = require('readline').createInterface({
20
+ const rl = require('readline').createInterface({
15
21
  input: process.stdin,
16
22
  output: process.stdout,
17
23
  });
18
- rl.question('Do you want to install it globally [Y/n]? ', function(answer) {
24
+ rl.question('Do you want to install it globally [Y/n]? ', function (answer) {
19
25
  rl.close();
20
26
  if (/^n/i.test(answer.trim())) {
21
27
  process.exit(1);
@@ -23,7 +29,7 @@ function run() {
23
29
  console.log("Installing the package 'expo-cli'...");
24
30
  spawn('npm', ['install', '--global', '--loglevel', 'error', 'expo-cli'], {
25
31
  stdio: ['inherit', 'ignore', 'inherit'],
26
- }).on('close', function(code) {
32
+ }).on('close', function (code) {
27
33
  if (code !== 0) {
28
34
  console.error('Installing Expo CLI failed. You can install it manually with:');
29
35
  console.error(' npm install --global expo-cli');
package/build/Expo.d.ts CHANGED
@@ -2,3 +2,4 @@ import './Expo.fx';
2
2
  import * as Logs from './logs/Logs';
3
3
  export { Logs };
4
4
  export { default as registerRootComponent } from './launch/registerRootComponent';
5
+ //# sourceMappingURL=Expo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Expo.d.ts","sourceRoot":"","sources":["../src/Expo.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,CAAC;AAEnB,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAC"}
@@ -2,3 +2,4 @@ import './environment/validate.fx';
2
2
  import './environment/logging.fx';
3
3
  import './environment/react-native-logs.fx';
4
4
  import 'expo-asset';
5
+ //# sourceMappingURL=Expo.fx.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Expo.fx.d.ts","sourceRoot":"","sources":["../src/Expo.fx.tsx"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AAEnC,OAAO,0BAA0B,CAAC;AAClC,OAAO,oCAAoC,CAAC;AAE5C,OAAO,YAAY,CAAC"}
@@ -1 +1,2 @@
1
1
  import './environment/react-native-logs.fx';
2
+ //# sourceMappingURL=Expo.fx.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Expo.fx.web.d.ts","sourceRoot":"","sources":["../src/Expo.fx.web.ts"],"names":[],"mappings":"AAAA,OAAO,oCAAoC,CAAC"}
@@ -2,3 +2,4 @@ import * as React from 'react';
2
2
  export default class DevAppContainer extends React.Component {
3
3
  render(): JSX.Element;
4
4
  }
5
+ //# sourceMappingURL=DevAppContainer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DevAppContainer.d.ts","sourceRoot":"","sources":["../../src/environment/DevAppContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,KAAK,CAAC,SAAS;IAC1D,MAAM;CAQP"}
@@ -1 +1,2 @@
1
1
  export default function DevLoadingView(): JSX.Element | null;
2
+ //# sourceMappingURL=DevLoadingView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DevLoadingView.d.ts","sourceRoot":"","sources":["../../src/environment/DevLoadingView.tsx"],"names":[],"mappings":"AAWA,MAAM,CAAC,OAAO,UAAU,cAAc,uBAuFrC"}
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useState, useRef, useMemo } from 'react';
2
- import { Animated, StyleSheet, Text, NativeModules, NativeEventEmitter, UIManager, View, } from 'react-native';
2
+ import { Animated, StyleSheet, Text, NativeModules, NativeEventEmitter, TurboModuleRegistry, View, } from 'react-native';
3
3
  export default function DevLoadingView() {
4
4
  const [isDevLoading, setIsDevLoading] = useState(false);
5
5
  const [isAnimating, setIsAnimating] = useState(false);
@@ -45,11 +45,11 @@ export default function DevLoadingView() {
45
45
  }
46
46
  });
47
47
  }
48
- emitter.addListener('devLoadingView:showMessage', handleShowMessage);
49
- emitter.addListener('devLoadingView:hide', handleHide);
48
+ const showMessageSubscription = emitter.addListener('devLoadingView:showMessage', handleShowMessage);
49
+ const hideSubscription = emitter.addListener('devLoadingView:hide', handleHide);
50
50
  return function cleanup() {
51
- emitter.removeListener('devLoadingView:showMessage', handleShowMessage);
52
- emitter.removeListener('devLoadingView:hide', handleHide);
51
+ showMessageSubscription.remove();
52
+ hideSubscription.remove();
53
53
  };
54
54
  }, [translateY, emitter]);
55
55
  if (isDevLoading || isAnimating) {
@@ -67,12 +67,10 @@ export default function DevLoadingView() {
67
67
  }
68
68
  /**
69
69
  * This is a hack to get the safe area insets without explicitly depending on react-native-safe-area-context.
70
- * The following code is lifted from: https://git.io/Jzk4k
71
- *
72
- * TODO: This will need to be updated for Fabric/TurboModules.
73
70
  **/
74
- const RNCSafeAreaProviderConfig = UIManager.getViewManagerConfig('RNCSafeAreaProvider');
75
- const initialWindowMetrics = RNCSafeAreaProviderConfig?.Constants?.initialWindowMetrics;
71
+ const RNCSafeAreaContext = TurboModuleRegistry.get('RNCSafeAreaContext');
72
+ // @ts-ignore: we're not using the spec so the return type of getConstants() is {}
73
+ const initialWindowMetrics = RNCSafeAreaContext?.getConstants().initialWindowMetrics;
76
74
  const styles = StyleSheet.create({
77
75
  animatedContainer: {
78
76
  position: 'absolute',
@@ -1 +1 @@
1
- {"version":3,"file":"DevLoadingView.js","sourceRoot":"","sources":["../../src/environment/DevLoadingView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,EACL,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,aAAa,EACb,kBAAkB,EAClB,SAAS,EACT,IAAI,GACL,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,OAAO,UAAU,cAAc;IACpC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IACzD,MAAM,OAAO,GAAG,OAAO,CAAqB,GAAG,EAAE;QAC/C,IAAI;YACF,OAAO,IAAI,kBAAkB,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;SAC7D;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,IAAI,KAAK,CACb,oHAAoH;g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;QACP,QAAQ,EAAE,SAAS;QACnB,eAAe,EAAE,kBAAkB;QACnC,aAAa,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;KACzD;IACD,gBAAgB,EAAE;QAChB,IAAI,EAAE,CAAC;QACP,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,CAAC;QAChB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,SAAS,EAAE,QAAQ;KACpB;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,EAAE;KACb;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,uBAAuB;KAC/B;CACF,CAAC,CAAC","sourcesContent":["import React, { useEffect, useState, useRef, useMemo } from 'react';\nimport {\n Animated,\n StyleSheet,\n Text,\n NativeModules,\n NativeEventEmitter,\n UIManager,\n View,\n} from 'react-native';\n\nexport default function DevLoadingView() {\n const [isDevLoading, setIsDevLoading] = useState(false);\n const [isAnimating, setIsAnimating] = useState(false);\n const translateY = useRef(new Animated.Value(0)).current;\n const emitter = useMemo<NativeEventEmitter>(() => {\n try {\n return new NativeEventEmitter(NativeModules.DevLoadingView);\n } catch (error) {\n throw new Error(\n 'Failed to instantiate native emitter in `DevLoadingView` because the native module `DevLoadingView` is undefined: ' +\n error.message\n );\n }\n }, []);\n\n useEffect(() => {\n if (!emitter) return;\n\n function handleShowMessage({ message }) {\n // \"Refreshing...\" is the standard fast refresh message and it's the\n // only time we want to display this overlay.\n if (message !== 'Refreshing...') {\n return;\n }\n\n // TODO: if we show the refreshing banner and don't get a hide message\n // for 3 seconds, warn the user that it's taking a while and suggest\n // they reload\n\n translateY.setValue(0);\n setIsDevLoading(true);\n }\n\n function handleHide() {\n // TODO: if we showed the 'refreshing' banner less than 250ms ago, delay\n // switching to the 'finished' banner\n\n setIsAnimating(true);\n setIsDevLoading(false);\n Animated.timing(translateY, {\n toValue: 150,\n delay: 1000,\n duration: 350,\n useNativeDriver: true,\n }).start(({ finished }) => {\n if (finished) {\n setIsAnimating(false);\n translateY.setValue(0);\n }\n });\n }\n\n emitter.addListener('devLoadingView:showMessage', handleShowMessage);\n emitter.addListener('devLoadingView:hide', handleHide);\n\n return function cleanup() {\n emitter.removeListener('devLoadingView:showMessage', handleShowMessage);\n emitter.removeListener('devLoadingView:hide', handleHide);\n };\n }, [translateY, emitter]);\n\n if (isDevLoading || isAnimating) {\n return (\n <Animated.View\n style={[styles.animatedContainer, { transform: [{ translateY }] }]}\n pointerEvents=\"none\">\n <View style={styles.banner}>\n <View style={styles.contentContainer}>\n <View style={{ flexDirection: 'row' }}>\n <Text style={styles.text}>{isDevLoading ? 'Refreshing...' : 'Refreshed'}</Text>\n </View>\n\n <View style={{ flex: 1 }}>\n <Text style={styles.subtitle}>\n {isDevLoading ? 'Using Fast Refresh' : \"Don't see your changes? Reload the app\"}\n </Text>\n </View>\n </View>\n </View>\n </Animated.View>\n );\n } else {\n return null;\n }\n}\n\n/**\n * This is a hack to get the safe area insets without explicitly depending on react-native-safe-area-context.\n * The following code is lifted from: https://git.io/Jzk4k\n *\n * TODO: This will need to be updated for Fabric/TurboModules.\n **/\nconst RNCSafeAreaProviderConfig = UIManager.getViewManagerConfig('RNCSafeAreaProvider') as any;\nconst initialWindowMetrics = RNCSafeAreaProviderConfig?.Constants?.initialWindowMetrics as\n | { insets: { bottom: number } }\n | undefined;\n\nconst styles = StyleSheet.create({\n animatedContainer: {\n position: 'absolute',\n bottom: 0,\n left: 0,\n right: 0,\n zIndex: 42, // arbitrary\n },\n banner: {\n flex: 1,\n overflow: 'visible',\n backgroundColor: 'rgba(0,0,0,0.75)',\n paddingBottom: initialWindowMetrics?.insets?.bottom ?? 0,\n },\n contentContainer: {\n flex: 1,\n paddingTop: 10,\n paddingBottom: 5,\n alignItems: 'center',\n justifyContent: 'center',\n textAlign: 'center',\n },\n text: {\n color: '#fff',\n fontSize: 15,\n },\n subtitle: {\n color: 'rgba(255,255,255,0.8)',\n },\n});\n"]}
1
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["import React, { useEffect, useState, useRef, useMemo } from 'react';\nimport {\n Animated,\n StyleSheet,\n Text,\n NativeModules,\n NativeEventEmitter,\n TurboModuleRegistry,\n View,\n} from 'react-native';\n\nexport default function DevLoadingView() {\n const [isDevLoading, setIsDevLoading] = useState(false);\n const [isAnimating, setIsAnimating] = useState(false);\n const translateY = useRef(new Animated.Value(0)).current;\n const emitter = useMemo<NativeEventEmitter>(() => {\n try {\n return new NativeEventEmitter(NativeModules.DevLoadingView);\n } catch (error) {\n throw new Error(\n 'Failed to instantiate native emitter in `DevLoadingView` because the native module `DevLoadingView` is undefined: ' +\n error.message\n );\n }\n }, []);\n\n useEffect(() => {\n if (!emitter) return;\n\n function handleShowMessage({ message }) {\n // \"Refreshing...\" is the standard fast refresh message and it's the\n // only time we want to display this overlay.\n if (message !== 'Refreshing...') {\n return;\n }\n\n // TODO: if we show the refreshing banner and don't get a hide message\n // for 3 seconds, warn the user that it's taking a while and suggest\n // they reload\n\n translateY.setValue(0);\n setIsDevLoading(true);\n }\n\n function handleHide() {\n // TODO: if we showed the 'refreshing' banner less than 250ms ago, delay\n // switching to the 'finished' banner\n\n setIsAnimating(true);\n setIsDevLoading(false);\n Animated.timing(translateY, {\n toValue: 150,\n delay: 1000,\n duration: 350,\n useNativeDriver: true,\n }).start(({ finished }) => {\n if (finished) {\n setIsAnimating(false);\n translateY.setValue(0);\n }\n });\n }\n\n const showMessageSubscription = emitter.addListener(\n 'devLoadingView:showMessage',\n handleShowMessage\n );\n const hideSubscription = emitter.addListener('devLoadingView:hide', handleHide);\n\n return function cleanup() {\n showMessageSubscription.remove();\n hideSubscription.remove();\n };\n }, [translateY, emitter]);\n\n if (isDevLoading || isAnimating) {\n return (\n <Animated.View\n style={[styles.animatedContainer, { transform: [{ translateY }] }]}\n pointerEvents=\"none\">\n <View style={styles.banner}>\n <View style={styles.contentContainer}>\n <View style={{ flexDirection: 'row' }}>\n <Text style={styles.text}>{isDevLoading ? 'Refreshing...' : 'Refreshed'}</Text>\n </View>\n\n <View style={{ flex: 1 }}>\n <Text style={styles.subtitle}>\n {isDevLoading ? 'Using Fast Refresh' : \"Don't see your changes? Reload the app\"}\n </Text>\n </View>\n </View>\n </View>\n </Animated.View>\n );\n } else {\n return null;\n }\n}\n\n/**\n * This is a hack to get the safe area insets without explicitly depending on react-native-safe-area-context.\n **/\nconst RNCSafeAreaContext = TurboModuleRegistry.get('RNCSafeAreaContext');\n\n// @ts-ignore: we're not using the spec so the return type of getConstants() is {}\nconst initialWindowMetrics = RNCSafeAreaContext?.getConstants().initialWindowMetrics;\n\nconst styles = StyleSheet.create({\n animatedContainer: {\n position: 'absolute',\n bottom: 0,\n left: 0,\n right: 0,\n zIndex: 42, // arbitrary\n },\n\n banner: {\n flex: 1,\n overflow: 'visible',\n backgroundColor: 'rgba(0,0,0,0.75)',\n paddingBottom: initialWindowMetrics?.insets?.bottom ?? 0,\n },\n contentContainer: {\n flex: 1,\n paddingTop: 10,\n paddingBottom: 5,\n alignItems: 'center',\n justifyContent: 'center',\n textAlign: 'center',\n },\n text: {\n color: '#fff',\n fontSize: 15,\n },\n subtitle: {\n color: 'rgba(255,255,255,0.8)',\n },\n});\n"]}
@@ -1 +1,2 @@
1
1
  export default function getInstallationIdAsync(): string;
2
+ //# sourceMappingURL=getInstallationIdAsync.android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getInstallationIdAsync.android.d.ts","sourceRoot":"","sources":["../../src/environment/getInstallationIdAsync.android.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,sBAAsB,WAE7C"}
@@ -1 +1,2 @@
1
1
  export default function getInstallationIdAsync(): Promise<string>;
2
+ //# sourceMappingURL=getInstallationIdAsync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getInstallationIdAsync.d.ts","sourceRoot":"","sources":["../../src/environment/getInstallationIdAsync.ts"],"names":[],"mappings":"AAMA,wBAA8B,sBAAsB,oBAmBnD"}
@@ -1 +1,2 @@
1
1
  export default function getInstallationIdAsync(): Promise<string>;
2
+ //# sourceMappingURL=getInstallationIdAsync.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getInstallationIdAsync.web.d.ts","sourceRoot":"","sources":["../../src/environment/getInstallationIdAsync.web.ts"],"names":[],"mappings":"AAMA,wBAA8B,sBAAsB,oBA2BnD"}
@@ -13,7 +13,7 @@ export default async function getInstallationIdAsync() {
13
13
  return installationId;
14
14
  }
15
15
  }
16
- catch (error) {
16
+ catch {
17
17
  // If we weren't able to fetch one (for whatever reason)
18
18
  // let's create a new one.
19
19
  }