expo-dev-menu 6.0.9 → 6.0.10

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,12 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 6.0.10 — 2024-11-15
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - [iOS] Fixed issue where `UIWindow` was called on off the main thread. ([#29559](https://github.com/expo/expo/pull/29559) by [@hakonk](https://github.com/hakonk))
18
+
13
19
  ## 6.0.9 — 2024-11-14
14
20
 
15
21
  _This version does not introduce any user-facing changes._
@@ -1,7 +1,7 @@
1
1
  apply plugin: 'com.android.library'
2
2
 
3
3
  group = 'host.exp.exponent'
4
- version = '6.0.9'
4
+ version = '6.0.10'
5
5
 
6
6
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
7
7
  apply from: expoModulesCorePlugin
@@ -20,7 +20,7 @@ android {
20
20
  namespace "expo.modules.devmenu"
21
21
  defaultConfig {
22
22
  versionCode 10
23
- versionName '6.0.9'
23
+ versionName '6.0.10'
24
24
  }
25
25
 
26
26
  buildTypes {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-dev-menu",
3
- "version": "6.0.9",
3
+ "version": "6.0.10",
4
4
  "description": "Expo/React Native module with the developer menu.",
5
5
  "main": "build/DevMenu.js",
6
6
  "types": "build/DevMenu.d.ts",
@@ -67,5 +67,5 @@
67
67
  "peerDependencies": {
68
68
  "expo": "*"
69
69
  },
70
- "gitHead": "9ff989048e66f85facda048e4be78329d8665e7c"
70
+ "gitHead": "dc2f6d254174599c74ebc2a20523d09b57a628fc"
71
71
  }
@@ -1,6 +1,6 @@
1
1
  import ExpoModulesCore
2
2
 
3
- public class RNCSafeAreaProviderManager: Module {
3
+ public final class RNCSafeAreaProviderManager: Module {
4
4
  public func definition() -> ModuleDefinition {
5
5
  Name("RNCSafeAreaProvider")
6
6
  Constants([
@@ -13,25 +13,36 @@ public class RNCSafeAreaProviderManager: Module {
13
13
  }
14
14
 
15
15
  private var initialWindowMetrics: [String: Any]? {
16
- guard let window = UIApplication.shared.keyWindow else {
17
- return [:]
18
- }
16
+ syncOnMain {
17
+ guard let window = UIApplication.shared.keyWindow else {
18
+ return [:]
19
+ }
19
20
 
20
- let safeAreaInsets = window.safeAreaInsets
21
+ let safeAreaInsets = window.safeAreaInsets
21
22
 
22
- return [
23
- "insets": [
24
- "top": safeAreaInsets.top,
25
- "right": safeAreaInsets.right,
26
- "bottom": safeAreaInsets.bottom,
27
- "left": safeAreaInsets.left
28
- ],
29
- "frame": [
30
- "x": window.frame.origin.x,
31
- "y": window.frame.origin.y,
32
- "width": window.frame.size.width,
33
- "height": window.frame.size.height
23
+ return [
24
+ "insets": [
25
+ "top": safeAreaInsets.top,
26
+ "right": safeAreaInsets.right,
27
+ "bottom": safeAreaInsets.bottom,
28
+ "left": safeAreaInsets.left
29
+ ],
30
+ "frame": [
31
+ "x": window.frame.origin.x,
32
+ "y": window.frame.origin.y,
33
+ "width": window.frame.size.width,
34
+ "height": window.frame.size.height
35
+ ]
34
36
  ]
35
- ]
37
+ }
38
+ }
39
+ }
40
+
41
+ private func syncOnMain<T>(_ closure: () -> T) -> T {
42
+ if !Thread.isMainThread {
43
+ return DispatchQueue.main.sync {
44
+ closure()
45
+ }
36
46
  }
47
+ return closure()
37
48
  }