9
9
#include < Shared/DevSettings.h>
10
10
11
11
#include < Executors/WebSocketJSExecutor.h>
12
+ #include " FuseboxInspectorPackagerConnectionDelegate.h"
12
13
#include " PackagerConnection.h"
13
14
14
15
#include " Unicode.h"
15
16
#include " Utilities.h"
16
17
17
18
#include < Utils/CppWinrtLessExceptions.h>
19
+ #include < jsinspector-modern/InspectorFlags.h>
18
20
#include < winrt/Windows.Foundation.h>
19
21
#include < winrt/Windows.Security.Cryptography.Core.h>
20
22
#include < winrt/Windows.Security.Cryptography.h>
@@ -273,12 +275,10 @@ void DevSupportManager::EnsureHermesInspector(
273
275
[[maybe_unused]] const uint16_t packagerPort,
274
276
[[maybe_unused]] const std::string &bundleAppId) noexcept {
275
277
static std::once_flag once;
276
- std::call_once (once, [this , &packagerHost, packagerPort, &jsBundleName]() {
277
- // TODO: should we use the bundleAppId as the app param if available?
278
-
278
+ std::call_once (once, [this , &packagerHost, packagerPort, &bundleAppId]() {
279
279
std::string packageName{bundleAppId};
280
- if (packageName == " " ) {
281
- std::string packageName ( " RNW" ) ;
280
+ if (packageName. empty () ) {
281
+ packageName = " RNW" ;
282
282
wchar_t fullName[PACKAGE_FULL_NAME_MAX_LENGTH]{};
283
283
UINT32 size = ARRAYSIZE (fullName);
284
284
if (SUCCEEDED (GetCurrentPackageFullName (&size, fullName))) {
@@ -294,11 +294,20 @@ void DevSupportManager::EnsureHermesInspector(
294
294
}
295
295
296
296
const auto deviceId = GetDeviceId (packageName);
297
- m_inspectorPackagerConnection = std::make_shared<InspectorPackagerConnection>(
298
- facebook::react::DevServerHelper::get_InspectorDeviceUrl (
299
- packagerHost, packagerPort, deviceName, packageName, deviceId),
300
- m_BundleStatusProvider);
301
- m_inspectorPackagerConnection->connectAsync ();
297
+ auto inspectorUrl = facebook::react::DevServerHelper::get_InspectorDeviceUrl (
298
+ packagerHost, packagerPort, deviceName, packageName, deviceId);
299
+ auto &inspectorFlags = jsinspector_modern::InspectorFlags::getInstance ();
300
+ if (inspectorFlags.getEnableCxxInspectorPackagerConnection ()) {
301
+ m_fuseboxInspectorPackagerConnection = std::make_unique<jsinspector_modern::InspectorPackagerConnection>(
302
+ inspectorUrl,
303
+ packageName,
304
+ std::make_unique<Microsoft::ReactNative::FuseboxInspectorPackagerConnectionDelegate>());
305
+ m_fuseboxInspectorPackagerConnection->connect ();
306
+ } else {
307
+ m_inspectorPackagerConnection =
308
+ std::make_shared<InspectorPackagerConnection>(std::move (inspectorUrl), m_BundleStatusProvider);
309
+ m_inspectorPackagerConnection->connectAsync ();
310
+ }
302
311
});
303
312
}
304
313
0 commit comments