expo-dev-menu 57.0.3 → 57.0.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.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,10 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 57.0.4 — 2026-07-01
14
+
15
+ _This version does not introduce any user-facing changes._
16
+
13
17
  ## 57.0.3 — 2026-06-30
14
18
 
15
19
  _This version does not introduce any user-facing changes._
@@ -12,7 +12,7 @@ apply plugin: 'expo-module-gradle-plugin'
12
12
  apply plugin: 'org.jetbrains.kotlin.plugin.compose'
13
13
 
14
14
  group = 'host.exp.exponent'
15
- version = '57.0.3'
15
+ version = '57.0.4'
16
16
 
17
17
  def hasDevLauncher = findProject(":expo-dev-launcher") != null
18
18
  def configureInRelease = findProperty("expo.devmenu.configureInRelease") == "true"
@@ -29,7 +29,7 @@ android {
29
29
 
30
30
  defaultConfig {
31
31
  versionCode 10
32
- versionName '57.0.3'
32
+ versionName '57.0.4'
33
33
  }
34
34
 
35
35
  buildTypes {
@@ -110,6 +110,9 @@ open class DevMenuManager: NSObject {
110
110
 
111
111
  private var isNavigatingHome = false
112
112
 
113
+ private var isReloading = false
114
+ private var lastReloadEventAt: Date?
115
+
113
116
  weak var hostDelegate: DevMenuHostDelegate?
114
117
 
115
118
  @objc
@@ -214,6 +217,8 @@ open class DevMenuManager: NSObject {
214
217
  public func setAppContext(_ appContext: AppContext?) {
215
218
  currentAppContext = appContext
216
219
  if appContext != nil {
220
+ isReloading = false
221
+ lastReloadEventAt = Date()
217
222
  isNavigatingHome = false
218
223
  isReactAppRunning = true
219
224
  // Re-run packager connection setup now that the app context (and devSettings) is available.
@@ -225,6 +230,20 @@ open class DevMenuManager: NSObject {
225
230
  updateAutoLaunchObserver()
226
231
  }
227
232
 
233
+ /**
234
+ Clears the app context, but only if `context` is still the active one.
235
+ On reload the incoming context's `OnCreate` can run before the outgoing context's
236
+ `OnDestroy`, so an unconditional reset would wipe the new context and leave the dev
237
+ menu unable to open.
238
+ */
239
+ @objc
240
+ public func clearAppContext(current context: AppContext?) {
241
+ if currentAppContext != nil && currentAppContext !== context {
242
+ return
243
+ }
244
+ setAppContext(nil)
245
+ }
246
+
228
247
  @objc
229
248
  public func updateCurrentManifest(_ manifest: Manifest?, manifestURL: URL?) {
230
249
  currentManifest = manifest
@@ -524,8 +543,21 @@ open class DevMenuManager: NSObject {
524
543
  }
525
544
 
526
545
  func reload() {
527
- let devToolsDelegate = getDevToolsDelegate()
528
- devToolsDelegate?.reload()
546
+ let now = Date()
547
+ if isReloading || (lastReloadEventAt.map { now.timeIntervalSince($0) < 0.5 } ?? false) {
548
+ lastReloadEventAt = now
549
+ return
550
+ }
551
+ guard let devToolsDelegate = getDevToolsDelegate() else {
552
+ return
553
+ }
554
+ isReloading = true
555
+ lastReloadEventAt = now
556
+ // Clear the guard even if a new app context never registers, for example a failed reload.
557
+ DispatchQueue.main.asyncAfter(deadline: .now() + 5) { [weak self] in
558
+ self?.isReloading = false
559
+ }
560
+ devToolsDelegate.reload()
529
561
  }
530
562
 
531
563
  func togglePerformanceMonitor() {
@@ -92,7 +92,7 @@ class DevMenuPackagerConnectionHandler {
92
92
 
93
93
  switch command {
94
94
  case "reload":
95
- devDelegate.reload()
95
+ manager.reload()
96
96
  case "toggleDevMenu":
97
97
  self.manager?.toggleMenu()
98
98
  case "toggleElementInspector":
@@ -10,7 +10,7 @@ open class DevMenuModule: Module {
10
10
  }
11
11
 
12
12
  OnDestroy {
13
- DevMenuManager.shared.setAppContext(nil)
13
+ DevMenuManager.shared.clearAppContext(current: self.appContext)
14
14
  // Cleanup registered callbacks when the module is destroyed to prevent leaking into other bridges.
15
15
  if DevMenuManager.wasInitilized {
16
16
  DevMenuManager.shared.registeredCallbacks = []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-dev-menu",
3
- "version": "57.0.3",
3
+ "version": "57.0.4",
4
4
  "description": "Expo/React Native module with the developer menu.",
5
5
  "main": "build/DevMenu.js",
6
6
  "types": "build/DevMenu.d.ts",
@@ -32,15 +32,15 @@
32
32
  "@types/node": "^22.14.0",
33
33
  "react": "19.2.3",
34
34
  "react-native": "0.86.0",
35
+ "expo": "57.0.1",
35
36
  "babel-preset-expo": "57.0.1",
36
- "expo": "57.0.0",
37
37
  "expo-module-scripts": "56.0.3"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "expo": "*",
41
41
  "react-native": "*"
42
42
  },
43
- "gitHead": "ab82681fbcef61d5283c1938290ba5cfe42e9cfd",
43
+ "gitHead": "4dea3f51f1db63368bbfcda7a0ddcecb0fb6f6e2",
44
44
  "scripts": {
45
45
  "build": "expo-module build",
46
46
  "clean": "expo-module clean",
@@ -0,0 +1 @@
1
+ {"root":["./src/index.ts","./src/withdevmenu.ts"],"version":"6.0.3"}