expo-dev-menu 5.0.3 → 5.0.5
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 +12 -0
- package/android/build.gradle +2 -2
- package/android/src/debug/java/expo/modules/devmenu/DevMenuReactHost.kt +24 -0
- package/ios/DevClientRootViewFactory.h +18 -0
- package/ios/DevClientRootViewFactory.mm +51 -0
- package/ios/DevMenuRCTBridge.mm +0 -19
- package/ios/EXDevMenuDevSettings.swift +1 -3
- package/ios/ReactNativeCompatibles/ReactNative/DevClientAppDelegate.mm +22 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,18 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 5.0.5 — 2024-04-24
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug fixes
|
|
16
|
+
|
|
17
|
+
- Fixed "Missing transform.routerRoot option in Metro bundling request" error when loading the bundle. ([#28428](https://github.com/expo/expo/pull/28428) by [@kudo](https://github.com/kudo))
|
|
18
|
+
|
|
19
|
+
## 5.0.4 — 2024-04-24
|
|
20
|
+
|
|
21
|
+
### 🐛 Bug fixes
|
|
22
|
+
|
|
23
|
+
- [iOS] Fix JS Debugger not using the correct app target. ([#28373](https://github.com/expo/expo/pull/28373) by [@gabrieldonadel](https://github.com/gabrieldonadel))
|
|
24
|
+
|
|
13
25
|
## 5.0.3 — 2024-04-23
|
|
14
26
|
|
|
15
27
|
_This version does not introduce any user-facing changes._
|
package/android/build.gradle
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
2
|
|
|
3
3
|
group = 'host.exp.exponent'
|
|
4
|
-
version = '5.0.
|
|
4
|
+
version = '5.0.5'
|
|
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.
|
|
23
|
+
versionName '5.0.5'
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
buildTypes {
|
|
@@ -23,6 +23,8 @@ import com.facebook.soloader.SoLoader
|
|
|
23
23
|
import devmenu.com.th3rdwave.safeareacontext.SafeAreaProviderManager
|
|
24
24
|
import expo.modules.adapters.react.ModuleRegistryAdapter
|
|
25
25
|
import expo.modules.adapters.react.ReactModuleRegistryProvider
|
|
26
|
+
import expo.modules.devmenu.helpers.getPrivateDeclaredFieldValue
|
|
27
|
+
import expo.modules.devmenu.helpers.setPrivateDeclaredFieldValue
|
|
26
28
|
import expo.modules.devmenu.modules.DevMenuInternalModule
|
|
27
29
|
import expo.modules.devmenu.modules.DevMenuPreferences
|
|
28
30
|
import expo.modules.kotlin.ModulesProvider
|
|
@@ -55,6 +57,10 @@ object DevMenuReactHost {
|
|
|
55
57
|
val reactJsExceptionHandler = ReactJsExceptionHandler { _ -> }
|
|
56
58
|
val componentFactory = ComponentFactory()
|
|
57
59
|
DefaultComponentsRegistry.register(componentFactory)
|
|
60
|
+
var originalDevFlag: Boolean? = null
|
|
61
|
+
if (!useDeveloperSupport) {
|
|
62
|
+
originalDevFlag = injectDevFlag(false)
|
|
63
|
+
}
|
|
58
64
|
val reactHost = ReactHostImpl(
|
|
59
65
|
application,
|
|
60
66
|
defaultReactHostDelegate,
|
|
@@ -66,6 +72,9 @@ object DevMenuReactHost {
|
|
|
66
72
|
.apply {
|
|
67
73
|
jsEngineResolutionAlgorithm = jsResolutionAlgorithm
|
|
68
74
|
}
|
|
75
|
+
if (originalDevFlag != null) {
|
|
76
|
+
injectDevFlag(originalDevFlag)
|
|
77
|
+
}
|
|
69
78
|
if (useDeveloperSupport) {
|
|
70
79
|
injectDevServerSettings(application.applicationContext, reactHost)
|
|
71
80
|
}
|
|
@@ -145,4 +154,19 @@ object DevMenuReactHost {
|
|
|
145
154
|
Log.e(DEV_MENU_TAG, "Couldn't inject DevSettings object.", e)
|
|
146
155
|
}
|
|
147
156
|
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* TODO: Remove this after React Native 0.74.1
|
|
160
|
+
*/
|
|
161
|
+
private fun injectDevFlag(devFlag: Boolean): Boolean {
|
|
162
|
+
val reactHostClass = ReactHostImpl::class.java
|
|
163
|
+
val originalDevFlag: Boolean =
|
|
164
|
+
reactHostClass.getPrivateDeclaredFieldValue("DEV", reactHostClass)
|
|
165
|
+
reactHostClass.setPrivateDeclaredFieldValue(
|
|
166
|
+
"DEV",
|
|
167
|
+
reactHostClass,
|
|
168
|
+
devFlag
|
|
169
|
+
)
|
|
170
|
+
return originalDevFlag
|
|
171
|
+
}
|
|
148
172
|
}
|
|
@@ -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
|
package/ios/DevMenuRCTBridge.mm
CHANGED
|
@@ -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.
|
|
3
|
+
"version": "5.0.5",
|
|
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": "
|
|
73
|
+
"gitHead": "8b4cb45563b85c2ec91b1b249d136661bf6e8981"
|
|
74
74
|
}
|