expo-dev-menu 5.0.2 → 5.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,16 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 5.0.4 — 2024-04-24
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - [iOS] Fix JS Debugger not using the correct app target. ([#28373](https://github.com/expo/expo/pull/28373) by [@gabrieldonadel](https://github.com/gabrieldonadel))
18
+
19
+ ## 5.0.3 — 2024-04-23
20
+
21
+ _This version does not introduce any user-facing changes._
22
+
13
23
  ## 5.0.2 — 2024-04-22
14
24
 
15
25
  _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 = '5.0.2'
4
+ version = '5.0.4'
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 '5.0.2'
23
+ versionName '5.0.4'
24
24
  }
25
25
 
26
26
  buildTypes {
@@ -0,0 +1,18 @@
1
+ // Copyright 2018-present 650 Industries. All rights reserved.
2
+
3
+ #pragma once
4
+
5
+ #if __has_include(<React-RCTAppDelegate/RCTRootViewFactory.h>)
6
+ #import <React-RCTAppDelegate/RCTRootViewFactory.h>
7
+ #elif __has_include(<React_RCTAppDelegate/RCTRootViewFactory.h>)
8
+ // for importing the header from framework, the dash will be transformed to underscore
9
+ #import <React_RCTAppDelegate/RCTRootViewFactory.h>
10
+ #endif
11
+
12
+ NS_ASSUME_NONNULL_BEGIN
13
+
14
+ @interface DevClientRootViewFactory : RCTRootViewFactory
15
+
16
+ @end
17
+
18
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,51 @@
1
+ // Copyright 2018-present 650 Industries. All rights reserved.
2
+
3
+ #import "DevClientRootViewFactory.h"
4
+
5
+ #if __has_include(<React-RCTAppDelegate/RCTAppDelegate.h>)
6
+ #import <React-RCTAppDelegate/RCTAppDelegate.h>
7
+ #elif __has_include(<React_RCTAppDelegate/RCTAppDelegate.h>)
8
+ // for importing the header from framework, the dash will be transformed to underscore
9
+ #import <React_RCTAppDelegate/RCTAppDelegate.h>
10
+ #endif
11
+ #if __has_include(<reacthermes/HermesExecutorFactory.h>)
12
+ #import <reacthermes/HermesExecutorFactory.h>
13
+ #endif
14
+
15
+ #import <React/RCTCxxBridgeDelegate.h>
16
+ #import <react/renderer/runtimescheduler/RuntimeScheduler.h>
17
+ #import <react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h>
18
+
19
+ @interface RCTRootViewFactory () <RCTCxxBridgeDelegate> {
20
+ std::shared_ptr<facebook::react::RuntimeScheduler> _runtimeScheduler;
21
+ }
22
+ @end
23
+
24
+ @implementation DevClientRootViewFactory
25
+
26
+ - (void)createBridgeIfNeeded:(NSDictionary *)launchOptions
27
+ {
28
+ if (self.bridge != nil) {
29
+ return;
30
+ }
31
+
32
+ self.bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
33
+ }
34
+
35
+ #pragma mark - RCTCxxBridgeDelegate
36
+ - (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge
37
+ {
38
+ std::unique_ptr<facebook::react::JSExecutorFactory> executorFactory = [super jsExecutorFactoryForBridge:bridge];
39
+
40
+ #if __has_include(<reacthermes/HermesExecutorFactory.h>)
41
+ auto rawExecutorFactory = executorFactory.get();
42
+ auto hermesExecFactory = dynamic_cast<facebook::react::HermesExecutorFactory*>(rawExecutorFactory);
43
+ if (hermesExecFactory != nullptr) {
44
+ hermesExecFactory->setEnableDebugger(false);
45
+ }
46
+ #endif
47
+
48
+ return executorFactory;
49
+ }
50
+
51
+ @end
@@ -123,9 +123,6 @@
123
123
 
124
124
  @interface DevClientAppDelegate (DevMenuRCTAppDelegate)
125
125
 
126
- #ifdef __cplusplus
127
- - (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge;
128
- #endif
129
126
  @end
130
127
 
131
128
  @implementation DevMenuRCTAppDelegate
@@ -136,20 +133,4 @@
136
133
  return [[DevMenuRCTBridge alloc] initWithDelegate:delegate launchOptions:launchOptions];
137
134
  }
138
135
 
139
- #pragma mark - RCTCxxBridgeDelegate
140
- - (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge
141
- {
142
- std::unique_ptr<facebook::react::JSExecutorFactory> executorFactory = [super jsExecutorFactoryForBridge:bridge];
143
-
144
- #if __has_include(<reacthermes/HermesExecutorFactory.h>)
145
- auto rawExecutorFactory = executorFactory.get();
146
- auto hermesExecFactory = dynamic_cast<facebook::react::HermesExecutorFactory*>(rawExecutorFactory);
147
- if (hermesExecFactory != nullptr) {
148
- hermesExecFactory->setEnableDebugger(false);
149
- }
150
- #endif
151
-
152
- return executorFactory;
153
- }
154
-
155
136
  @end
@@ -35,9 +35,7 @@ class EXDevMenuDevSettings: NSObject {
35
35
  devSettings["isRemoteDebuggingAvailable"] = bridgeSettings.isRemoteDebuggingAvailable
36
36
  devSettings["isHotLoadingAvailable"] = bridgeSettings.isHotLoadingAvailable
37
37
  devSettings["isPerfMonitorAvailable"] = isPerfMonitorAvailable
38
-
39
- // bridge mode has the `bridge.batched` and the bridgeless mode references the later.
40
- devSettings["isJSInspectorAvailable"] = bridge.batched?.isInspectable ?? bridge.isInspectable
38
+ devSettings["isJSInspectorAvailable"] = bridgeSettings.isDeviceDebuggingAvailable
41
39
 
42
40
  let isElementInspectorAvailable = manager.currentManifest?.isDevelopmentMode()
43
41
  devSettings["isElementInspectorAvailable"] = isElementInspectorAvailable
@@ -1,4 +1,5 @@
1
1
  #import <EXDevMenu/DevClientAppDelegate.h>
2
+ #import <EXDevMenu/DevClientRootViewFactory.h>
2
3
 
3
4
  #import <React/RCTBundleURLProvider.h>
4
5
  #import <React/RCTCxxBridgeDelegate.h>
@@ -28,12 +29,31 @@
28
29
 
29
30
  @interface RCTAppDelegate () <RCTComponentViewFactoryComponentProvider, RCTTurboModuleManagerDelegate>
30
31
 
31
- - (RCTRootViewFactory *)createRCTRootViewFactory;
32
-
33
32
  @end
34
33
 
35
34
  @implementation DevClientAppDelegate
36
35
 
36
+ - (RCTRootViewFactory *)createRCTRootViewFactory
37
+ {
38
+ RCTRootViewFactoryConfiguration *configuration =
39
+ [[RCTRootViewFactoryConfiguration alloc] initWithBundleURL:self.bundleURL
40
+ newArchEnabled:self.fabricEnabled
41
+ turboModuleEnabled:self.turboModuleEnabled
42
+ bridgelessEnabled:self.bridgelessEnabled];
43
+
44
+ __weak __typeof(self) weakSelf = self;
45
+ configuration.createRootViewWithBridge = ^UIView *(RCTBridge *bridge, NSString *moduleName, NSDictionary *initProps)
46
+ {
47
+ return [weakSelf createRootViewWithBridge:bridge moduleName:moduleName initProps:initProps];
48
+ };
49
+
50
+ configuration.createBridgeWithDelegate = ^RCTBridge *(id<RCTBridgeDelegate> bridge, NSDictionary *launchOptions)
51
+ {
52
+ return [weakSelf createBridgeWithDelegate:bridge launchOptions:launchOptions];
53
+ };
54
+
55
+ return [[DevClientRootViewFactory alloc] initWithConfiguration:configuration andTurboModuleManagerDelegate:self];
56
+ }
37
57
 
38
58
  - (void)initRootViewFactory {
39
59
  RCTSetNewArchEnabled([self newArchEnabled]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-dev-menu",
3
- "version": "5.0.2",
3
+ "version": "5.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",
@@ -70,5 +70,5 @@
70
70
  "peerDependencies": {
71
71
  "expo": "*"
72
72
  },
73
- "gitHead": "0897aeadb926491a457bcd67d83360956994ee82"
73
+ "gitHead": "f8f9d041c6467f325b58c7913e0f5ed1af102e11"
74
74
  }