expo-dev-launcher 4.0.27 → 4.0.29

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/CHANGELOG.md CHANGED
@@ -10,6 +10,16 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 4.0.29 — 2024-11-06
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - [Android] Fixed mutiple reload when pressing `r` in CLI on react-native old architecture mode. ([#32532](https://github.com/expo/expo/pull/32532) by [@kudo](https://github.com/kudo))
18
+
19
+ ## 4.0.28 — 2024-10-08
20
+
21
+ _This version does not introduce any user-facing changes._
22
+
13
23
  ## 4.0.27 — 2024-08-23
14
24
 
15
25
  _This version does not introduce any user-facing changes._
@@ -17,7 +17,7 @@ android {
17
17
  namespace "expo.modules.devlauncher"
18
18
  defaultConfig {
19
19
  versionCode 9
20
- versionName "4.0.27"
20
+ versionName "4.0.29"
21
21
  }
22
22
 
23
23
  buildTypes {
@@ -85,7 +85,7 @@ class DevLauncherController private constructor() :
85
85
  override val devClientHost by lazy {
86
86
  ReactHostWrapper(
87
87
  reactNativeHost = DevLauncherReactNativeHost(context as Application, DEV_LAUNCHER_HOST),
88
- reactHost = DevLauncherReactHost.create(context as Application, DEV_LAUNCHER_HOST)
88
+ reactHostProvider = { DevLauncherReactHost.create(context as Application, DEV_LAUNCHER_HOST) }
89
89
  )
90
90
  }
91
91
 
@@ -427,7 +427,7 @@ class DevLauncherController private constructor() :
427
427
 
428
428
  @JvmStatic
429
429
  fun initialize(reactApplication: ReactApplication, additionalPackages: List<ReactPackage>? = null, launcherClass: Class<*>? = null) {
430
- initialize(reactApplication as Context, ReactHostWrapper(reactApplication.reactNativeHost, reactApplication.reactHost))
430
+ initialize(reactApplication as Context, ReactHostWrapper(reactApplication.reactNativeHost, { reactApplication.reactHost }))
431
431
  sAdditionalPackages = additionalPackages
432
432
  sLauncherClass = launcherClass
433
433
  }
@@ -10,6 +10,8 @@ import com.facebook.react.ReactInstanceEventListener
10
10
  import com.facebook.react.bridge.ReactContext
11
11
  import expo.interfaces.devmenu.ReactHostWrapper
12
12
  import expo.modules.devlauncher.launcher.DevLauncherControllerInterface
13
+ import kotlinx.coroutines.Dispatchers
14
+ import kotlinx.coroutines.withContext
13
15
  import kotlin.coroutines.Continuation
14
16
  import kotlin.coroutines.resume
15
17
  import kotlin.coroutines.suspendCoroutine
@@ -70,8 +72,8 @@ abstract class DevLauncherAppLoader(
70
72
  }
71
73
  }
72
74
 
73
- open suspend fun launch(intent: Intent): Boolean {
74
- return suspendCoroutine { callback ->
75
+ open suspend fun launch(intent: Intent): Boolean = withContext(Dispatchers.Main) {
76
+ suspendCoroutine { callback ->
75
77
  if (injectBundleLoader()) {
76
78
  continuation = callback
77
79
  launchIntent(intent)
@@ -222,11 +222,17 @@ fun injectDevServerHelper(context: Context, devSupportManager: DevSupportManager
222
222
  devSettings = devSettings,
223
223
  packagerConnection = devSettings.public_getPackagerConnectionSettings()
224
224
  )
225
+ val oldDevServerHelper: DevServerHelper = DevSupportManagerBase::class.java.getProtectedFieldValue(
226
+ devSupportManager,
227
+ "mDevServerHelper"
228
+ )
225
229
  DevSupportManagerBase::class.java.setProtectedDeclaredField(
226
230
  devSupportManager,
227
231
  "mDevServerHelper",
228
232
  devLauncherDevServerHelper
229
233
  )
234
+ oldDevServerHelper.closePackagerConnection()
235
+ oldDevServerHelper.closeInspectorConnection()
230
236
  }
231
237
 
232
238
  fun findDevMenuPackage(): ReactPackage? {
@@ -111,7 +111,7 @@ class DevLauncherController private constructor() : DevLauncherControllerInterfa
111
111
 
112
112
  @JvmStatic
113
113
  fun initialize(reactApplication: ReactApplication, additionalPackages: List<*>? = null, launcherClass: Class<*>? = null) {
114
- initialize(reactApplication as Context, ReactHostWrapper(reactApplication.reactNativeHost, reactApplication.reactHost))
114
+ initialize(reactApplication as Context, ReactHostWrapper(reactApplication.reactNativeHost, { reactApplication.reactHost }))
115
115
  }
116
116
 
117
117
  @JvmStatic
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "expo-dev-launcher",
3
3
  "title": "Expo Development Launcher",
4
- "version": "4.0.27",
4
+ "version": "4.0.29",
5
5
  "description": "Pre-release version of the Expo development launcher package for testing.",
6
6
  "main": "build/DevLauncher.js",
7
7
  "types": "build/DevLauncher.d.ts",
@@ -31,7 +31,7 @@
31
31
  "homepage": "https://docs.expo.dev",
32
32
  "dependencies": {
33
33
  "ajv": "8.11.0",
34
- "expo-dev-menu": "5.0.21",
34
+ "expo-dev-menu": "5.0.23",
35
35
  "expo-manifests": "~0.14.0",
36
36
  "resolve-from": "^5.0.0",
37
37
  "semver": "^7.6.0"
@@ -45,7 +45,7 @@
45
45
  "@testing-library/jest-native": "^4.0.4",
46
46
  "@testing-library/react-native": "^8.0.0",
47
47
  "babel-plugin-module-resolver": "^5.0.0",
48
- "babel-preset-expo": "~11.0.0",
48
+ "babel-preset-expo": "~11.0.15",
49
49
  "date-fns": "^2.28.0",
50
50
  "expo-dev-client-components": "1.8.1",
51
51
  "expo-module-scripts": "^3.0.0",
@@ -66,5 +66,5 @@
66
66
  "./setupTests.ts"
67
67
  ]
68
68
  },
69
- "gitHead": "5518f556e076c2a4e433ffd83ef144f6b5715e62"
69
+ "gitHead": "6583b7c637a965a9a9872efee9905b11ea806e28"
70
70
  }