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>
@@ -257,9 +259,10 @@ void DevSupportManager::StopPollingLiveReload() {
257
259
void DevSupportManager::EnsureHermesInspector (
258
260
[[maybe_unused]] const std::string &packagerHost,
259
261
[[maybe_unused]] const uint16_t packagerPort,
260
- [[maybe_unused]] const std::string &jsBundleName) noexcept {
262
+ [[maybe_unused]] const std::string &jsBundleName,
263
+ [[maybe_unused]] const std::shared_ptr<Mso::DispatchQueue> &inspectorThread) noexcept {
261
264
static std::once_flag once;
262
- std::call_once (once, [this , &packagerHost, packagerPort, &jsBundleName]() {
265
+ std::call_once (once, [this , &packagerHost, packagerPort, &jsBundleName, &inspectorThread ]() {
263
266
// TODO: should we use the bundleAppId as the app param if available?
264
267
std::string packageName (" RNW" );
265
268
wchar_t fullName[PACKAGE_FULL_NAME_MAX_LENGTH]{};
@@ -276,11 +279,22 @@ void DevSupportManager::EnsureHermesInspector(
276
279
}
277
280
278
281
const auto deviceId = GetDeviceId (jsBundleName);
279
- m_inspectorPackagerConnection = std::make_shared<InspectorPackagerConnection>(
280
- facebook::react::DevServerHelper::get_InspectorDeviceUrl (
281
- packagerHost, packagerPort, deviceName, packageName, deviceId),
282
- m_BundleStatusProvider);
283
- m_inspectorPackagerConnection->connectAsync ();
282
+ auto inspectorUrl = facebook::react::DevServerHelper::get_InspectorDeviceUrl (
283
+ packagerHost, packagerPort, deviceName, packageName, deviceId);
284
+ auto &inspectorFlags = jsinspector_modern::InspectorFlags::getInstance ();
285
+ if (inspectorFlags.getEnableCxxInspectorPackagerConnection ()) {
286
+ m_fuseboxInspectorPackagerConnection = std::make_unique<jsinspector_modern::InspectorPackagerConnection>(
287
+ inspectorUrl,
288
+ std::string{jsBundleName},
289
+ std::make_unique<Microsoft::ReactNative::FuseboxInspectorPackagerConnectionDelegate>(inspectorThread));
290
+ m_fuseboxInspectorPackagerConnection->connect ();
291
+ } else {
292
+ m_inspectorPackagerConnection = std::make_shared<InspectorPackagerConnection>(
293
+ facebook::react::DevServerHelper::get_InspectorDeviceUrl (
294
+ packagerHost, packagerPort, deviceName, packageName, deviceId),
295
+ m_BundleStatusProvider);
296
+ m_inspectorPackagerConnection->connectAsync ();
297
+ }
284
298
});
285
299
}
286
300
0 commit comments