diff --git a/change/@react-native-windows-automation-channel-524d7cf3-6b4c-44e0-bd90-8a81df7adb50.json b/change/@react-native-windows-automation-channel-524d7cf3-6b4c-44e0-bd90-8a81df7adb50.json
new file mode 100644
index 00000000000..734b571b185
--- /dev/null
+++ b/change/@react-native-windows-automation-channel-524d7cf3-6b4c-44e0-bd90-8a81df7adb50.json
@@ -0,0 +1,7 @@
+{
+ "type": "patch",
+ "comment": "Use Hermes version 0.0.0-2511.7001-d7ca19b3",
+ "packageName": "@react-native-windows/automation-channel",
+ "email": "vmorozov@microsoft.com",
+ "dependentChangeType": "patch"
+}
diff --git a/change/@react-native-windows-automation-channel-7f6dfa91-4d3b-439f-8d57-9cf3c37f1ad3.json b/change/@react-native-windows-automation-channel-7f6dfa91-4d3b-439f-8d57-9cf3c37f1ad3.json
new file mode 100644
index 00000000000..643f199ea31
--- /dev/null
+++ b/change/@react-native-windows-automation-channel-7f6dfa91-4d3b-439f-8d57-9cf3c37f1ad3.json
@@ -0,0 +1,7 @@
+{
+ "type": "patch",
+ "comment": "Use hermes-windows version 0.0.0-2511.3001-9e4cf518",
+ "packageName": "@react-native-windows/automation-channel",
+ "email": "vmorozov@microsoft.com",
+ "dependentChangeType": "patch"
+}
diff --git a/change/react-native-windows-79cca7af-9c52-411a-b80d-65a9ab472300.json b/change/react-native-windows-79cca7af-9c52-411a-b80d-65a9ab472300.json
new file mode 100644
index 00000000000..d26e8cebf95
--- /dev/null
+++ b/change/react-native-windows-79cca7af-9c52-411a-b80d-65a9ab472300.json
@@ -0,0 +1,7 @@
+{
+ "type": "prerelease",
+ "comment": "Use Hermes version 0.0.0-2511.7001-d7ca19b3",
+ "packageName": "react-native-windows",
+ "email": "vmorozov@microsoft.com",
+ "dependentChangeType": "patch"
+}
diff --git a/change/react-native-windows-96f33c2e-d47a-4ff4-bcfc-20490d838ad9.json b/change/react-native-windows-96f33c2e-d47a-4ff4-bcfc-20490d838ad9.json
new file mode 100644
index 00000000000..833fab8f9d5
--- /dev/null
+++ b/change/react-native-windows-96f33c2e-d47a-4ff4-bcfc-20490d838ad9.json
@@ -0,0 +1,7 @@
+{
+ "type": "prerelease",
+ "comment": "Added support for modern inspector",
+ "packageName": "react-native-windows",
+ "email": "vmorozov@microsoft.com",
+ "dependentChangeType": "patch"
+}
diff --git a/change/react-native-windows-a33b4f99-5470-4c01-915a-b219da123630.json b/change/react-native-windows-a33b4f99-5470-4c01-915a-b219da123630.json
new file mode 100644
index 00000000000..4299e10c4eb
--- /dev/null
+++ b/change/react-native-windows-a33b4f99-5470-4c01-915a-b219da123630.json
@@ -0,0 +1,7 @@
+{
+ "type": "prerelease",
+ "comment": "Use hermes-windows version 0.0.0-2511.3001-9e4cf518",
+ "packageName": "react-native-windows",
+ "email": "vmorozov@microsoft.com",
+ "dependentChangeType": "patch"
+}
diff --git a/docs/modern-inspector-details.md b/docs/modern-inspector-details.md
new file mode 100644
index 00000000000..bf55e0611d8
--- /dev/null
+++ b/docs/modern-inspector-details.md
@@ -0,0 +1,70 @@
+# Modern Inspector Support in React Native for Windows
+
+## Overview
+The modern inspector is the Chrome DevTools–based debugging experience that ships with the latest
+versions of React Native. This experience now works end-to-end for React Native for Windows (RNW)
+applications, enabling parity with Android and iOS. The integration provides a unified way to inspect
+JavaScript execution, evaluate console expressions, profile CPU and memory usage, and visualize the
+component hierarchy for both the Paper and Composition UI stacks.
+
+## Modern Inspector Building Blocks
+- **Host Target** – One per `ReactHost`; surfaces metadata, reload requests, pause overlays, and
+ implements the CDP-facing delegate (`ReactInspectorHostTargetDelegate`).
+- **Instance Target** – Created for each React instance; registers runtime targets, tracks instance
+ lifecycle, and unregisters cleanly on reload.
+- **Runtime Target & Agent** – Runtime targets map to JavaScript VMs; agents are per-session objects
+ that translate Chrome DevTools Protocol (CDP) messages into engine calls. RNW mirrors upstream
+ lifetimes so reloads tear everything down deterministically.
+- **Frontend Channel** – Delivers JSON CDP payloads between the RNW host and DevTools.
+- **Inspector Thread** – A single `ReactInspectorThread` ensures CDP work is serialized away from
+ the UI and JS queues. (iOS and Andrtoid use UI thread.)
+- **Debugger Notifications** – `DebuggerNotifications.h` broadcasts pause/resume events so view
+ hosts can react (e.g., showing overlays or resuming when the debugger continues).
+
+## Windows Integration Points
+- **ReactHost & ReactOptions** – `ReactHost` creates the `HostTarget`, exposes it through
+ `ReactOptions::InspectorHostTarget`, and implements reload/pause hooks. This is the jump-off point
+ for all inspector traffic. The inspector supported only if the `UseDirectDebugger` is true.
+- **ReactInstanceWin / OInstance** – Register and unregister instance/runtime targets around runtime
+ creation, keeping the inspector aligned with bridgeless and legacy bridge lifecycles.
+- **DevSupportManager & Packager** – `DevSupportManager` now spins up
+ `ReactInspectorPackagerConnectionDelegate`, allowing Metro to broker modern inspector connections
+ and reuse the existing websocket infrastructure.
+- **Dev Console Shortcut** – Metro’s `J` shortcut launches the inspector for Windows apps, matching
+ upstream behavior.
+
+## UI Overlays
+- **Composition** – `DebuggerUIIsland` renders pause overlays, focus chrome, and selection adorners
+ whenever the runtime is paused.
+- **Paper** – `ReactRootView` updates provide the same pause/selection affordances.
+
+## Hermes Runtime Integration
+- `HermesRuntimeTargetDelegate` and `HermesRuntimeAgentDelegate` wrap the hermes-windows C debug API
+ so we can re-use upstream modern inspector code.
+- `RuntimeHolder`/`HermesRuntimeHolder` surface a `createRuntimeTargetDelegate` hook that instantiates
+ delegates only when the inspector is enabled, and safely tears them down during reloads.
+
+## Packager & Console Integration
+- `ReactInspectorPackagerConnectionDelegate` maps the Metro websocket APIs to the modern inspector
+ handshake.
+- Console output, CPU sampling, and memory profiling are forwarded through the Hermes inspector
+ plumbing automatically once a session is active.
+
+## Using the Modern Inspector with RNW
+1. Start your Metro bundler (`npx react-native start` or `yarn start`).
+2. Launch your RNW app (Paper or Composition).
+3. In the Metro console, press `J` to open the modern inspector URL in a browser.
+4. Chrome DevTools will connect to the Hermes runtime. Pause execution, explore the component tree,
+ and capture profiles as needed.
+5. When execution is paused, the corresponding overlay is rendered in the app window; resume to clear
+ the overlay.
+
+## Known Limitations & Follow-Up Work
+- **Network profiling** – The `NetworkIOAgent` is not wired up yet for Windows. The integration point
+ is the `ReactInspectorHostTargetDelegate` in
+ `vnext/Microsoft.ReactNative/ReactHost/ReactHost.cpp`; override `loadNetworkResource` there to
+ forward requests through a Windows HTTP helper (similar to `GetJavaScriptFromServerAsync`) and
+ stream results back via the provided `NetworkRequestListener`. Until this happens, the Network tab
+ in DevTools stays empty.
+- **Legacy Chakra runtime** – Modern inspector support currently targets Hermes. Chakra-based apps
+ continue to rely on legacy debugging flows.
diff --git a/packages/@react-native-windows/automation-channel/windows/AutomationChannel/packages.chakra.lock.json b/packages/@react-native-windows/automation-channel/windows/AutomationChannel/packages.chakra.lock.json
index b03148bd7f7..006baa72de2 100644
--- a/packages/@react-native-windows/automation-channel/windows/AutomationChannel/packages.chakra.lock.json
+++ b/packages/@react-native-windows/automation-channel/windows/AutomationChannel/packages.chakra.lock.json
@@ -29,8 +29,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -72,7 +72,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.UI.Xaml": "[2.8.0, )",
"ReactCommon": "[1.0.0, )",
diff --git a/packages/@react-native-windows/automation-channel/windows/AutomationChannel/packages.lock.json b/packages/@react-native-windows/automation-channel/windows/AutomationChannel/packages.lock.json
index b03148bd7f7..006baa72de2 100644
--- a/packages/@react-native-windows/automation-channel/windows/AutomationChannel/packages.lock.json
+++ b/packages/@react-native-windows/automation-channel/windows/AutomationChannel/packages.lock.json
@@ -29,8 +29,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -72,7 +72,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.UI.Xaml": "[2.8.0, )",
"ReactCommon": "[1.0.0, )",
diff --git a/packages/@react-native-windows/automation-channel/windows/AutomationChannel/packages.newarch.lock.json b/packages/@react-native-windows/automation-channel/windows/AutomationChannel/packages.newarch.lock.json
index c75c19e4982..4e71702ddc6 100644
--- a/packages/@react-native-windows/automation-channel/windows/AutomationChannel/packages.newarch.lock.json
+++ b/packages/@react-native-windows/automation-channel/windows/AutomationChannel/packages.newarch.lock.json
@@ -37,8 +37,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -85,7 +85,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.WindowsAppSDK": "[1.7.250401001, )",
"ReactCommon": "[1.0.0, )",
diff --git a/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric.Package/packages.lock.json b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric.Package/packages.lock.json
index 3d84b0d94d0..9ba83dc5121 100644
--- a/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric.Package/packages.lock.json
+++ b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric.Package/packages.lock.json
@@ -14,8 +14,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -85,7 +85,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.WindowsAppSDK": "[1.7.250401001, )",
"ReactCommon": "[1.0.0, )",
@@ -103,7 +103,7 @@
"type": "Project",
"dependencies": {
"AutomationChannel": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.ReactNative": "[1.0.0, )",
"Microsoft.VCRTForwarders.140": "[1.0.2-rc, )",
"Microsoft.WindowsAppSDK": "[1.7.250401001, )",
diff --git a/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/packages.lock.json b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/packages.lock.json
index 7dc9ca253a6..43da89c8432 100644
--- a/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/packages.lock.json
+++ b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/packages.lock.json
@@ -10,9 +10,9 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Direct",
- "requested": "[0.0.0-2507.21007-eda7aef6, )",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "requested": "[0.0.0-2511.7001-d7ca19b3, )",
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.VCRTForwarders.140": {
"type": "Direct",
@@ -95,7 +95,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.WindowsAppSDK": "[1.7.250401001, )",
"ReactCommon": "[1.0.0, )",
diff --git a/packages/e2e-test-app/windows/RNTesterApp/packages.chakra.lock.json b/packages/e2e-test-app/windows/RNTesterApp/packages.chakra.lock.json
index 6e6f96b837c..8f5b69d29b1 100644
--- a/packages/e2e-test-app/windows/RNTesterApp/packages.chakra.lock.json
+++ b/packages/e2e-test-app/windows/RNTesterApp/packages.chakra.lock.json
@@ -46,8 +46,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.Net.Native.Compiler": {
"type": "Transitive",
@@ -197,7 +197,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.UI.Xaml": "[2.8.0, )",
"ReactCommon": "[1.0.0, )",
diff --git a/packages/e2e-test-app/windows/RNTesterApp/packages.lock.json b/packages/e2e-test-app/windows/RNTesterApp/packages.lock.json
index 9c620c7784a..9526d7f5461 100644
--- a/packages/e2e-test-app/windows/RNTesterApp/packages.lock.json
+++ b/packages/e2e-test-app/windows/RNTesterApp/packages.lock.json
@@ -4,9 +4,9 @@
"UAP,Version=v10.0.17763": {
"Microsoft.JavaScript.Hermes": {
"type": "Direct",
- "requested": "[0.0.0-2507.21007-eda7aef6, )",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "requested": "[0.0.0-2511.7001-d7ca19b3, )",
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.NETCore.UniversalWindowsPlatform": {
"type": "Direct",
@@ -198,7 +198,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.UI.Xaml": "[2.8.0, )",
"ReactCommon": "[1.0.0, )",
diff --git a/packages/integration-test-app/windows/InteropTestModuleCS/packages.chakra.lock.json b/packages/integration-test-app/windows/InteropTestModuleCS/packages.chakra.lock.json
index dbe95b7993b..1d3d9a8eb72 100644
--- a/packages/integration-test-app/windows/InteropTestModuleCS/packages.chakra.lock.json
+++ b/packages/integration-test-app/windows/InteropTestModuleCS/packages.chakra.lock.json
@@ -26,8 +26,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.Net.Native.Compiler": {
"type": "Transitive",
@@ -178,7 +178,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.UI.Xaml": "[2.8.0, )",
"ReactCommon": "[1.0.0, )",
diff --git a/packages/integration-test-app/windows/InteropTestModuleCS/packages.lock.json b/packages/integration-test-app/windows/InteropTestModuleCS/packages.lock.json
index dbe95b7993b..1d3d9a8eb72 100644
--- a/packages/integration-test-app/windows/InteropTestModuleCS/packages.lock.json
+++ b/packages/integration-test-app/windows/InteropTestModuleCS/packages.lock.json
@@ -26,8 +26,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.Net.Native.Compiler": {
"type": "Transitive",
@@ -178,7 +178,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.UI.Xaml": "[2.8.0, )",
"ReactCommon": "[1.0.0, )",
diff --git a/packages/integration-test-app/windows/integrationtest/packages.chakra.lock.json b/packages/integration-test-app/windows/integrationtest/packages.chakra.lock.json
index 94c113f9e5e..24399a4161c 100644
--- a/packages/integration-test-app/windows/integrationtest/packages.chakra.lock.json
+++ b/packages/integration-test-app/windows/integrationtest/packages.chakra.lock.json
@@ -29,8 +29,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.Net.Native.Compiler": {
"type": "Transitive",
@@ -199,7 +199,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.UI.Xaml": "[2.8.0, )",
"ReactCommon": "[1.0.0, )",
diff --git a/packages/integration-test-app/windows/integrationtest/packages.lock.json b/packages/integration-test-app/windows/integrationtest/packages.lock.json
index 7a378ca4108..58b00ed3a30 100644
--- a/packages/integration-test-app/windows/integrationtest/packages.lock.json
+++ b/packages/integration-test-app/windows/integrationtest/packages.lock.json
@@ -4,9 +4,9 @@
"native,Version=v0.0": {
"Microsoft.JavaScript.Hermes": {
"type": "Direct",
- "requested": "[0.0.0-2507.21007-eda7aef6, )",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "requested": "[0.0.0-2511.7001-d7ca19b3, )",
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.UI.Xaml": {
"type": "Direct",
@@ -200,7 +200,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.UI.Xaml": "[2.8.0, )",
"ReactCommon": "[1.0.0, )",
diff --git a/packages/playground/windows/PlaygroundNativeModules/packages.lock.json b/packages/playground/windows/PlaygroundNativeModules/packages.lock.json
index b03148bd7f7..006baa72de2 100644
--- a/packages/playground/windows/PlaygroundNativeModules/packages.lock.json
+++ b/packages/playground/windows/PlaygroundNativeModules/packages.lock.json
@@ -29,8 +29,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -72,7 +72,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.UI.Xaml": "[2.8.0, )",
"ReactCommon": "[1.0.0, )",
diff --git a/packages/playground/windows/playground-composition.Package/packages.experimentalwinui3.lock.json b/packages/playground/windows/playground-composition.Package/packages.experimentalwinui3.lock.json
index fb48358cca5..8472064b28f 100644
--- a/packages/playground/windows/playground-composition.Package/packages.experimentalwinui3.lock.json
+++ b/packages/playground/windows/playground-composition.Package/packages.experimentalwinui3.lock.json
@@ -14,8 +14,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -76,7 +76,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.WindowsAppSDK": "[1.7.250127003-experimental3, )",
"ReactCommon": "[1.0.0, )",
@@ -86,7 +86,7 @@
"playground-composition": {
"type": "Project",
"dependencies": {
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.ReactNative": "[1.0.0, )",
"Microsoft.VCRTForwarders.140": "[1.0.2-rc, )",
"Microsoft.WindowsAppSDK": "[1.7.250127003-experimental3, )",
diff --git a/packages/playground/windows/playground-composition.Package/packages.lock.json b/packages/playground/windows/playground-composition.Package/packages.lock.json
index 5ba393d90b0..ea87593a461 100644
--- a/packages/playground/windows/playground-composition.Package/packages.lock.json
+++ b/packages/playground/windows/playground-composition.Package/packages.lock.json
@@ -14,8 +14,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -76,7 +76,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.WindowsAppSDK": "[1.7.250401001, )",
"ReactCommon": "[1.0.0, )",
@@ -86,7 +86,7 @@
"playground-composition": {
"type": "Project",
"dependencies": {
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.ReactNative": "[1.0.0, )",
"Microsoft.VCRTForwarders.140": "[1.0.2-rc, )",
"Microsoft.WindowsAppSDK": "[1.7.250401001, )",
diff --git a/packages/playground/windows/playground-composition/packages.experimentalwinui3.lock.json b/packages/playground/windows/playground-composition/packages.experimentalwinui3.lock.json
index 94726df0b7e..dc0e73813b3 100644
--- a/packages/playground/windows/playground-composition/packages.experimentalwinui3.lock.json
+++ b/packages/playground/windows/playground-composition/packages.experimentalwinui3.lock.json
@@ -10,9 +10,9 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Direct",
- "requested": "[0.0.0-2507.21007-eda7aef6, )",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "requested": "[0.0.0-2511.7001-d7ca19b3, )",
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.VCRTForwarders.140": {
"type": "Direct",
@@ -86,7 +86,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.WindowsAppSDK": "[1.7.250127003-experimental3, )",
"ReactCommon": "[1.0.0, )",
diff --git a/packages/playground/windows/playground-composition/packages.lock.json b/packages/playground/windows/playground-composition/packages.lock.json
index f4230c213c4..8fb2da00945 100644
--- a/packages/playground/windows/playground-composition/packages.lock.json
+++ b/packages/playground/windows/playground-composition/packages.lock.json
@@ -10,9 +10,9 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Direct",
- "requested": "[0.0.0-2507.21007-eda7aef6, )",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "requested": "[0.0.0-2511.7001-d7ca19b3, )",
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.VCRTForwarders.140": {
"type": "Direct",
@@ -86,7 +86,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.WindowsAppSDK": "[1.7.250401001, )",
"ReactCommon": "[1.0.0, )",
diff --git a/packages/playground/windows/playground/packages.lock.json b/packages/playground/windows/playground/packages.lock.json
index 412dd5a619c..9da2e1f071b 100644
--- a/packages/playground/windows/playground/packages.lock.json
+++ b/packages/playground/windows/playground/packages.lock.json
@@ -4,9 +4,9 @@
"native,Version=v0.0": {
"Microsoft.JavaScript.Hermes": {
"type": "Direct",
- "requested": "[0.0.0-2507.21007-eda7aef6, )",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "requested": "[0.0.0-2511.7001-d7ca19b3, )",
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.UI.Xaml": {
"type": "Direct",
@@ -73,7 +73,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.UI.Xaml": "[2.8.0, )",
"ReactCommon": "[1.0.0, )",
diff --git a/packages/sample-app-fabric/windows/SampleAppFabric.Package/packages.lock.json b/packages/sample-app-fabric/windows/SampleAppFabric.Package/packages.lock.json
index 9b9d7503ec9..d64940b51e4 100644
--- a/packages/sample-app-fabric/windows/SampleAppFabric.Package/packages.lock.json
+++ b/packages/sample-app-fabric/windows/SampleAppFabric.Package/packages.lock.json
@@ -14,8 +14,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -76,7 +76,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.WindowsAppSDK": "[1.7.250401001, )",
"ReactCommon": "[1.0.0, )",
@@ -93,7 +93,7 @@
"sampleappfabric": {
"type": "Project",
"dependencies": {
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.ReactNative": "[1.0.0, )",
"Microsoft.VCRTForwarders.140": "[1.0.2-rc, )",
"Microsoft.WindowsAppSDK": "[1.7.250401001, )",
diff --git a/packages/sample-app-fabric/windows/SampleAppFabric/packages.lock.json b/packages/sample-app-fabric/windows/SampleAppFabric/packages.lock.json
index bb664372486..83d8e870d2a 100644
--- a/packages/sample-app-fabric/windows/SampleAppFabric/packages.lock.json
+++ b/packages/sample-app-fabric/windows/SampleAppFabric/packages.lock.json
@@ -10,9 +10,9 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Direct",
- "requested": "[0.0.0-2507.21007-eda7aef6, )",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "requested": "[0.0.0-2511.7001-d7ca19b3, )",
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.VCRTForwarders.140": {
"type": "Direct",
@@ -86,7 +86,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.WindowsAppSDK": "[1.7.250401001, )",
"ReactCommon": "[1.0.0, )",
diff --git a/packages/sample-apps/windows/SampleAppCPP/packages.lock.json b/packages/sample-apps/windows/SampleAppCPP/packages.lock.json
index 23f21f8c893..2d62f83e9ef 100644
--- a/packages/sample-apps/windows/SampleAppCPP/packages.lock.json
+++ b/packages/sample-apps/windows/SampleAppCPP/packages.lock.json
@@ -10,9 +10,9 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Direct",
- "requested": "[0.0.0-2507.21007-eda7aef6, )",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "requested": "[0.0.0-2511.7001-d7ca19b3, )",
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.UI.Xaml": {
"type": "Direct",
@@ -186,7 +186,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.UI.Xaml": "[2.8.0, )",
"ReactCommon": "[1.0.0, )",
diff --git a/packages/sample-apps/windows/SampleAppCS/packages.lock.json b/packages/sample-apps/windows/SampleAppCS/packages.lock.json
index 341ce38a985..7208c87546d 100644
--- a/packages/sample-apps/windows/SampleAppCS/packages.lock.json
+++ b/packages/sample-apps/windows/SampleAppCS/packages.lock.json
@@ -4,9 +4,9 @@
"UAP,Version=v10.0.17763": {
"Microsoft.JavaScript.Hermes": {
"type": "Direct",
- "requested": "[0.0.0-2507.21007-eda7aef6, )",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "requested": "[0.0.0-2511.7001-d7ca19b3, )",
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.NETCore.UniversalWindowsPlatform": {
"type": "Direct",
@@ -180,7 +180,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.UI.Xaml": "[2.8.0, )",
"ReactCommon": "[1.0.0, )",
diff --git a/packages/sample-apps/windows/SampleLibraryCPP/packages.lock.json b/packages/sample-apps/windows/SampleLibraryCPP/packages.lock.json
index b03148bd7f7..006baa72de2 100644
--- a/packages/sample-apps/windows/SampleLibraryCPP/packages.lock.json
+++ b/packages/sample-apps/windows/SampleLibraryCPP/packages.lock.json
@@ -29,8 +29,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -72,7 +72,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.UI.Xaml": "[2.8.0, )",
"ReactCommon": "[1.0.0, )",
diff --git a/packages/sample-apps/windows/SampleLibraryCS/packages.lock.json b/packages/sample-apps/windows/SampleLibraryCS/packages.lock.json
index dbe95b7993b..1d3d9a8eb72 100644
--- a/packages/sample-apps/windows/SampleLibraryCS/packages.lock.json
+++ b/packages/sample-apps/windows/SampleLibraryCS/packages.lock.json
@@ -26,8 +26,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.Net.Native.Compiler": {
"type": "Transitive",
@@ -178,7 +178,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.UI.Xaml": "[2.8.0, )",
"ReactCommon": "[1.0.0, )",
diff --git a/packages/sample-custom-component/windows/SampleCustomComponent/packages.experimentalwinui3.lock.json b/packages/sample-custom-component/windows/SampleCustomComponent/packages.experimentalwinui3.lock.json
index bb156a63118..c765f63ba80 100644
--- a/packages/sample-custom-component/windows/SampleCustomComponent/packages.experimentalwinui3.lock.json
+++ b/packages/sample-custom-component/windows/SampleCustomComponent/packages.experimentalwinui3.lock.json
@@ -37,8 +37,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -85,7 +85,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.WindowsAppSDK": "[1.7.250127003-experimental3, )",
"ReactCommon": "[1.0.0, )",
diff --git a/packages/sample-custom-component/windows/SampleCustomComponent/packages.lock.json b/packages/sample-custom-component/windows/SampleCustomComponent/packages.lock.json
index dff9be4951d..957ffef6cca 100644
--- a/packages/sample-custom-component/windows/SampleCustomComponent/packages.lock.json
+++ b/packages/sample-custom-component/windows/SampleCustomComponent/packages.lock.json
@@ -37,8 +37,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -85,7 +85,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.WindowsAppSDK": "[1.7.250401001, )",
"ReactCommon": "[1.0.0, )",
diff --git a/vnext/Desktop.ABITests/packages.experimentalwinui3.lock.json b/vnext/Desktop.ABITests/packages.experimentalwinui3.lock.json
index 6e1350accbb..05edf1a7a58 100644
--- a/vnext/Desktop.ABITests/packages.experimentalwinui3.lock.json
+++ b/vnext/Desktop.ABITests/packages.experimentalwinui3.lock.json
@@ -32,8 +32,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -96,7 +96,7 @@
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
"FollyWin32": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.Web.WebView2": "[1.0.2903.40, )",
"Microsoft.WindowsAppSDK": "[1.7.250127003-experimental3, )",
@@ -108,7 +108,7 @@
"react.windows.desktop.dll": {
"type": "Project",
"dependencies": {
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"React.Windows.Desktop": "[1.0.0, )",
"ReactNative.V8Jsi.Windows": "[0.71.8, )",
diff --git a/vnext/Desktop.ABITests/packages.lock.json b/vnext/Desktop.ABITests/packages.lock.json
index 21cd9adedd5..fb08ef502b5 100644
--- a/vnext/Desktop.ABITests/packages.lock.json
+++ b/vnext/Desktop.ABITests/packages.lock.json
@@ -32,8 +32,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -96,7 +96,7 @@
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
"FollyWin32": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.Web.WebView2": "[1.0.2903.40, )",
"Microsoft.WindowsAppSDK": "[1.7.250401001, )",
@@ -108,7 +108,7 @@
"react.windows.desktop.dll": {
"type": "Project",
"dependencies": {
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"React.Windows.Desktop": "[1.0.0, )",
"ReactNative.V8Jsi.Windows": "[0.71.8, )",
diff --git a/vnext/Desktop.DLL/packages.experimentalwinui3.lock.json b/vnext/Desktop.DLL/packages.experimentalwinui3.lock.json
index f6f102ec9b9..9c5d8fc6c14 100644
--- a/vnext/Desktop.DLL/packages.experimentalwinui3.lock.json
+++ b/vnext/Desktop.DLL/packages.experimentalwinui3.lock.json
@@ -10,9 +10,9 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Direct",
- "requested": "[0.0.0-2507.21007-eda7aef6, )",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "requested": "[0.0.0-2511.7001-d7ca19b3, )",
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.GitHub": {
"type": "Direct",
@@ -87,7 +87,7 @@
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
"FollyWin32": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.Web.WebView2": "[1.0.2903.40, )",
"Microsoft.WindowsAppSDK": "[1.7.250127003-experimental3, )",
diff --git a/vnext/Desktop.DLL/packages.lock.json b/vnext/Desktop.DLL/packages.lock.json
index 960229467b3..23d5b6288df 100644
--- a/vnext/Desktop.DLL/packages.lock.json
+++ b/vnext/Desktop.DLL/packages.lock.json
@@ -10,9 +10,9 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Direct",
- "requested": "[0.0.0-2507.21007-eda7aef6, )",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "requested": "[0.0.0-2511.7001-d7ca19b3, )",
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.GitHub": {
"type": "Direct",
@@ -87,7 +87,7 @@
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
"FollyWin32": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.Web.WebView2": "[1.0.2903.40, )",
"Microsoft.WindowsAppSDK": "[1.7.250401001, )",
diff --git a/vnext/Desktop.IntegrationTests/packages.experimentalwinui3.lock.json b/vnext/Desktop.IntegrationTests/packages.experimentalwinui3.lock.json
index 6bed977f024..595e7c3eefc 100644
--- a/vnext/Desktop.IntegrationTests/packages.experimentalwinui3.lock.json
+++ b/vnext/Desktop.IntegrationTests/packages.experimentalwinui3.lock.json
@@ -39,8 +39,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -98,7 +98,7 @@
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
"FollyWin32": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.Web.WebView2": "[1.0.2903.40, )",
"Microsoft.WindowsAppSDK": "[1.7.250127003-experimental3, )",
@@ -110,7 +110,7 @@
"react.windows.desktop.dll": {
"type": "Project",
"dependencies": {
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"React.Windows.Desktop": "[1.0.0, )",
"ReactNative.V8Jsi.Windows": "[0.71.8, )",
diff --git a/vnext/Desktop.IntegrationTests/packages.lock.json b/vnext/Desktop.IntegrationTests/packages.lock.json
index f230e543168..63475edf6d8 100644
--- a/vnext/Desktop.IntegrationTests/packages.lock.json
+++ b/vnext/Desktop.IntegrationTests/packages.lock.json
@@ -39,8 +39,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -98,7 +98,7 @@
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
"FollyWin32": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.Web.WebView2": "[1.0.2903.40, )",
"Microsoft.WindowsAppSDK": "[1.7.250401001, )",
@@ -110,7 +110,7 @@
"react.windows.desktop.dll": {
"type": "Project",
"dependencies": {
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"React.Windows.Desktop": "[1.0.0, )",
"ReactNative.V8Jsi.Windows": "[0.71.8, )",
diff --git a/vnext/Desktop.UnitTests/packages.experimentalwinui3.lock.json b/vnext/Desktop.UnitTests/packages.experimentalwinui3.lock.json
index fe3310b7b81..0adab5b3a4b 100644
--- a/vnext/Desktop.UnitTests/packages.experimentalwinui3.lock.json
+++ b/vnext/Desktop.UnitTests/packages.experimentalwinui3.lock.json
@@ -27,8 +27,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -96,7 +96,7 @@
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
"FollyWin32": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.Web.WebView2": "[1.0.2903.40, )",
"Microsoft.WindowsAppSDK": "[1.7.250127003-experimental3, )",
diff --git a/vnext/Desktop.UnitTests/packages.lock.json b/vnext/Desktop.UnitTests/packages.lock.json
index 4175393f214..d25873e3339 100644
--- a/vnext/Desktop.UnitTests/packages.lock.json
+++ b/vnext/Desktop.UnitTests/packages.lock.json
@@ -27,8 +27,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -96,7 +96,7 @@
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
"FollyWin32": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.Web.WebView2": "[1.0.2903.40, )",
"Microsoft.WindowsAppSDK": "[1.7.250401001, )",
diff --git a/vnext/Desktop/packages.experimentalwinui3.lock.json b/vnext/Desktop/packages.experimentalwinui3.lock.json
index 1d2b775f77c..53e2a97e58e 100644
--- a/vnext/Desktop/packages.experimentalwinui3.lock.json
+++ b/vnext/Desktop/packages.experimentalwinui3.lock.json
@@ -10,9 +10,9 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Direct",
- "requested": "[0.0.0-2507.21007-eda7aef6, )",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "requested": "[0.0.0-2511.7001-d7ca19b3, )",
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.GitHub": {
"type": "Direct",
diff --git a/vnext/Desktop/packages.lock.json b/vnext/Desktop/packages.lock.json
index 528fbaf236e..70e16869c0f 100644
--- a/vnext/Desktop/packages.lock.json
+++ b/vnext/Desktop/packages.lock.json
@@ -10,9 +10,9 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Direct",
- "requested": "[0.0.0-2507.21007-eda7aef6, )",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "requested": "[0.0.0-2511.7001-d7ca19b3, )",
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.GitHub": {
"type": "Direct",
diff --git a/vnext/Directory.Build.props b/vnext/Directory.Build.props
index 9985177a3e8..94e6644228c 100644
--- a/vnext/Directory.Build.props
+++ b/vnext/Directory.Build.props
@@ -34,7 +34,7 @@
10.1.0
ca2e3685b160617d3d95fcd9e789c4e06ca88
- c048668df3dcda7fef33103aac018c92cbdbe043
+ 21b47f08b762b21b1d4d970940ab23f59f43249c
$(MSBuildThisFileDirectory)stubs
- c048668df3dcda7fef33103aac018c92cbdbe043
+ 21b47f08b762b21b1d4d970940ab23f59f43249c
true
$(MSBuildThisFileDirectory)
$(ReactNativeDir)\..\..\node_modules\.node-api-jsi\node-api-jsi-$(NodeApiJsiCommitHash)\
diff --git a/vnext/Microsoft.ReactNative.IntegrationTests/packages.experimentalwinui3.lock.json b/vnext/Microsoft.ReactNative.IntegrationTests/packages.experimentalwinui3.lock.json
index 685707d2c0b..29f2cb8342e 100644
--- a/vnext/Microsoft.ReactNative.IntegrationTests/packages.experimentalwinui3.lock.json
+++ b/vnext/Microsoft.ReactNative.IntegrationTests/packages.experimentalwinui3.lock.json
@@ -33,8 +33,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -84,7 +84,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.UI.Xaml": "[2.8.0, )",
"ReactCommon": "[1.0.0, )",
diff --git a/vnext/Microsoft.ReactNative.IntegrationTests/packages.lock.json b/vnext/Microsoft.ReactNative.IntegrationTests/packages.lock.json
index 685707d2c0b..29f2cb8342e 100644
--- a/vnext/Microsoft.ReactNative.IntegrationTests/packages.lock.json
+++ b/vnext/Microsoft.ReactNative.IntegrationTests/packages.lock.json
@@ -33,8 +33,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -84,7 +84,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.UI.Xaml": "[2.8.0, )",
"ReactCommon": "[1.0.0, )",
diff --git a/vnext/Microsoft.ReactNative.IntegrationTests/packages.newarch.experimentalwinui3.lock.json b/vnext/Microsoft.ReactNative.IntegrationTests/packages.newarch.experimentalwinui3.lock.json
index 89e78855009..018fcfd93b5 100644
--- a/vnext/Microsoft.ReactNative.IntegrationTests/packages.newarch.experimentalwinui3.lock.json
+++ b/vnext/Microsoft.ReactNative.IntegrationTests/packages.newarch.experimentalwinui3.lock.json
@@ -43,8 +43,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -91,7 +91,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.WindowsAppSDK": "[1.7.250127003-experimental3, )",
"ReactCommon": "[1.0.0, )",
diff --git a/vnext/Microsoft.ReactNative.IntegrationTests/packages.newarch.lock.json b/vnext/Microsoft.ReactNative.IntegrationTests/packages.newarch.lock.json
index f32a334df1e..e9634c96aad 100644
--- a/vnext/Microsoft.ReactNative.IntegrationTests/packages.newarch.lock.json
+++ b/vnext/Microsoft.ReactNative.IntegrationTests/packages.newarch.lock.json
@@ -43,8 +43,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -91,7 +91,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.WindowsAppSDK": "[1.7.250401001, )",
"ReactCommon": "[1.0.0, )",
diff --git a/vnext/Microsoft.ReactNative.Managed.IntegrationTests/packages.lock.json b/vnext/Microsoft.ReactNative.Managed.IntegrationTests/packages.lock.json
index 8c113353188..afc979a07a8 100644
--- a/vnext/Microsoft.ReactNative.Managed.IntegrationTests/packages.lock.json
+++ b/vnext/Microsoft.ReactNative.Managed.IntegrationTests/packages.lock.json
@@ -56,8 +56,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.Net.Native.Compiler": {
"type": "Transitive",
@@ -332,7 +332,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.UI.Xaml": "[2.8.0, )",
"ReactCommon": "[1.0.0, )",
diff --git a/vnext/Microsoft.ReactNative.Managed.UnitTests/packages.lock.json b/vnext/Microsoft.ReactNative.Managed.UnitTests/packages.lock.json
index 8c113353188..afc979a07a8 100644
--- a/vnext/Microsoft.ReactNative.Managed.UnitTests/packages.lock.json
+++ b/vnext/Microsoft.ReactNative.Managed.UnitTests/packages.lock.json
@@ -56,8 +56,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.Net.Native.Compiler": {
"type": "Transitive",
@@ -332,7 +332,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.UI.Xaml": "[2.8.0, )",
"ReactCommon": "[1.0.0, )",
diff --git a/vnext/Microsoft.ReactNative.Managed/packages.lock.json b/vnext/Microsoft.ReactNative.Managed/packages.lock.json
index 63b29e93ae7..202c208c15e 100644
--- a/vnext/Microsoft.ReactNative.Managed/packages.lock.json
+++ b/vnext/Microsoft.ReactNative.Managed/packages.lock.json
@@ -36,8 +36,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.Net.Native.Compiler": {
"type": "Transitive",
@@ -179,7 +179,7 @@
"dependencies": {
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.UI.Xaml": "[2.8.0, )",
"ReactCommon": "[1.0.0, )",
diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/DebuggerUIIsland.cpp b/vnext/Microsoft.ReactNative/Fabric/Composition/DebuggerUIIsland.cpp
new file mode 100644
index 00000000000..eb23179c9ad
--- /dev/null
+++ b/vnext/Microsoft.ReactNative/Fabric/Composition/DebuggerUIIsland.cpp
@@ -0,0 +1,169 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+#include "pch.h"
+#include "DebuggerUIIsland.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include "CompositionContextHelper.h"
+#include "TextDrawing.h"
+
+namespace winrt::Microsoft::ReactNative::implementation {
+
+constexpr float debuggerUIFontSize = 10.0f;
+constexpr float debuggerTextMargin = 4.0f;
+
+DebuggerUIIsland::DebuggerUIIsland(
+ const winrt::Microsoft::UI::Composition::Compositor &compositor,
+ winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext &compContext,
+ winrt::Microsoft::ReactNative::Composition::Theme theme) noexcept
+ : m_compositor(compositor), m_compContext(compContext), m_theme(theme) {
+ m_backgroundVisual = m_compositor.CreateSpriteVisual();
+ m_backgroundVisual.RelativeSizeAdjustment({1.0f, 1.0f});
+
+ auto backgroundBrush = m_compositor.CreateColorBrush({100, 0, 0, 0});
+ m_backgroundVisual.Brush(backgroundBrush);
+
+ m_TextVisual = m_compositor.CreateSpriteVisual();
+ m_TextVisual.IsPixelSnappingEnabled(true);
+
+ m_backgroundVisual.Children().InsertAtTop(m_TextVisual);
+}
+
+DebuggerUIIsland::~DebuggerUIIsland() noexcept {
+ m_island.StateChanged(m_islandStateChangedToken);
+}
+
+void DebuggerUIIsland::Redraw() noexcept {
+ if (!m_island)
+ return;
+
+ if (m_island.ActualSize().x == 0 || m_island.ActualSize().y == 0)
+ return;
+
+ auto scaleFactor = m_island.Environment().DisplayScale();
+
+ auto attributedString = facebook::react::AttributedString{};
+ auto fragment = facebook::react::AttributedString::Fragment{};
+ fragment.string = m_message;
+ fragment.textAttributes.fontSize = debuggerUIFontSize;
+ attributedString.appendFragment(std::move(fragment));
+
+ // Resume Icon
+ auto iconFragment = facebook::react::AttributedString::Fragment{};
+ iconFragment.string = " \uF08F";
+ iconFragment.textAttributes.fontFamily = "Segoe Fluent Icons";
+ iconFragment.textAttributes.fontSize = debuggerUIFontSize;
+ attributedString.appendFragment(std::move(iconFragment));
+
+ auto attributedStringBox = facebook::react::AttributedStringBox{attributedString};
+
+ facebook::react::LayoutConstraints constraints;
+ constraints.maximumSize.width = std::max(0.0f, m_island.ActualSize().x - debuggerTextMargin * 2 * scaleFactor);
+ constraints.maximumSize.height = std::max(0.0f, m_island.ActualSize().y - debuggerTextMargin * 2 * scaleFactor);
+
+ auto textAttributes = facebook::react::TextAttributes{};
+ textAttributes.foregroundColor = facebook::react::blackColor();
+
+ winrt::com_ptr<::IDWriteTextLayout> textLayout;
+ facebook::react::WindowsTextLayoutManager::GetTextLayout(attributedStringBox, {}, constraints, textLayout);
+
+ DWRITE_TEXT_METRICS tm;
+ textLayout->GetMetrics(&tm);
+
+ winrt::Windows::Foundation::Size surfaceSize = {
+ std::ceilf(std::min(constraints.maximumSize.width, tm.width + debuggerTextMargin * 2 * scaleFactor)),
+ std::ceilf(std::min(constraints.maximumSize.height, tm.height + debuggerTextMargin * 2 * scaleFactor))};
+ auto drawingSurface = m_compContext.CreateDrawingSurfaceBrush(
+ surfaceSize,
+ winrt::Windows::Graphics::DirectX::DirectXPixelFormat::B8G8R8A8UIntNormalized,
+ winrt::Windows::Graphics::DirectX::DirectXAlphaMode::Premultiplied);
+
+ POINT offset;
+ {
+ ::Microsoft::ReactNative::Composition::AutoDrawDrawingSurface autoDraw(drawingSurface, scaleFactor, &offset);
+ if (auto d2dDeviceContext = autoDraw.GetRenderTarget()) {
+ d2dDeviceContext->Clear(D2D1::ColorF{1.0f, 1.0f, 0.76f, 1.0f});
+
+ auto theme = winrt::get_self(m_theme);
+
+ Composition::RenderText(
+ *d2dDeviceContext,
+ *textLayout,
+ attributedStringBox.getValue(),
+ textAttributes,
+ {static_cast(offset.x + std::floorf(debuggerTextMargin * scaleFactor)),
+ static_cast(offset.y + std::floorf(debuggerTextMargin * scaleFactor))},
+ scaleFactor,
+ *theme);
+ }
+
+ drawingSurface.HorizontalAlignmentRatio(0.0f);
+ drawingSurface.Stretch(winrt::Microsoft::ReactNative::Composition::Experimental::CompositionStretch::None);
+
+ m_TextVisual.Brush(winrt::Microsoft::ReactNative::Composition::Experimental::implementation::
+ MicrosoftCompositionContextHelper::InnerBrush(drawingSurface));
+ m_TextVisual.Size({surfaceSize.Width, surfaceSize.Height});
+
+ m_debuggerHitRect = {
+ m_island.ActualSize().x / 2 - tm.width / 2 + debuggerTextMargin * scaleFactor,
+ debuggerTextMargin * scaleFactor,
+ surfaceSize.Width,
+ surfaceSize.Height};
+
+ m_TextVisual.Offset({m_debuggerHitRect.X, m_debuggerHitRect.Y, 0.0f});
+ }
+}
+
+void DebuggerUIIsland::Message(std::string &&value) noexcept {
+ m_message = value;
+ Redraw();
+}
+
+winrt::Microsoft::UI::Content::ContentIsland DebuggerUIIsland::Island() noexcept {
+ if (!m_island) {
+ m_island = winrt::Microsoft::UI::Content::ContentIsland::Create(m_backgroundVisual);
+
+ m_islandStateChangedToken =
+ m_island.StateChanged([weakThis = weak_from_this()](
+ winrt::Microsoft::UI::Content::ContentIsland const &island,
+ winrt::Microsoft::UI::Content::ContentIslandStateChangedEventArgs const &args) {
+ if (auto pThis = weakThis.lock()) {
+ if (args.DidRasterizationScaleChange() || args.DidActualSizeChange()) {
+ pThis->Redraw();
+ }
+ }
+ });
+
+ auto pointerSource = winrt::Microsoft::UI::Input::InputPointerSource::GetForIsland(m_island);
+
+ m_islandPointerUpToken =
+ pointerSource.PointerReleased([weakThis = weak_from_this()](
+ winrt::Microsoft::UI::Input::InputPointerSource const &,
+ winrt::Microsoft::UI::Input::PointerEventArgs const &args) {
+ if (auto pThis = weakThis.lock()) {
+ auto position = args.CurrentPoint().Position();
+ if (position.X >= pThis->m_debuggerHitRect.X && position.Y >= pThis->m_debuggerHitRect.Y &&
+ position.X <= pThis->m_debuggerHitRect.X + pThis->m_debuggerHitRect.Width &&
+ position.Y <= pThis->m_debuggerHitRect.Y + pThis->m_debuggerHitRect.Height) {
+ pThis->m_resumedEvent(nullptr, nullptr);
+ }
+ }
+ });
+ }
+ return m_island;
+}
+
+winrt::event_token DebuggerUIIsland::Resumed(
+ winrt::Windows::Foundation::EventHandler const &handler) noexcept {
+ return m_resumedEvent.add(handler);
+}
+void DebuggerUIIsland::Resumed(winrt::event_token const &token) noexcept {
+ m_resumedEvent.remove(token);
+}
+
+} // namespace winrt::Microsoft::ReactNative::implementation
diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/DebuggerUIIsland.h b/vnext/Microsoft.ReactNative/Fabric/Composition/DebuggerUIIsland.h
new file mode 100644
index 00000000000..9fc719ad0d1
--- /dev/null
+++ b/vnext/Microsoft.ReactNative/Fabric/Composition/DebuggerUIIsland.h
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+#pragma once
+
+#include
+#include
+
+namespace winrt::Microsoft::ReactNative::implementation {
+
+struct DebuggerUIIsland : std::enable_shared_from_this {
+ DebuggerUIIsland(
+ const winrt::Microsoft::UI::Composition::Compositor &compositor,
+ winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext &compContext,
+ winrt::Microsoft::ReactNative::Composition::Theme theme) noexcept;
+ ~DebuggerUIIsland() noexcept;
+ winrt::Microsoft::UI::Content::ContentIsland Island() noexcept;
+
+ void Message(std::string &&value) noexcept;
+
+ winrt::event_token Resumed(
+ winrt::Windows::Foundation::EventHandler const &handler) noexcept;
+ void Resumed(winrt::event_token const &token) noexcept;
+
+ private:
+ void Redraw() noexcept;
+
+ winrt::event_token m_islandStateChangedToken;
+ winrt::event_token m_islandPointerUpToken;
+
+ winrt::Microsoft::UI::Composition::SpriteVisual m_backgroundVisual{nullptr};
+ winrt::Microsoft::UI::Composition::SpriteVisual m_TextVisual{nullptr};
+ winrt::Windows::Foundation::Rect m_debuggerHitRect{0, 0, 0, 0};
+ winrt::Microsoft::ReactNative::Composition::Theme m_theme{nullptr};
+ std::string m_message;
+
+ winrt::event> m_resumedEvent;
+ winrt::Microsoft::UI::Composition::Compositor m_compositor{nullptr};
+ winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext m_compContext{nullptr};
+ winrt::Microsoft::UI::Content::ContentIsland m_island{nullptr};
+};
+
+} // namespace winrt::Microsoft::ReactNative::implementation
diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.cpp b/vnext/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.cpp
index fd84303f8e1..84452bf67aa 100644
--- a/vnext/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.cpp
+++ b/vnext/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.cpp
@@ -103,9 +103,9 @@ void DebuggingOverlayComponentView::HandleCommand(
auto rootVisual = root->OuterVisual();
while (m_activeOverlays != 0) {
+ --m_activeOverlays;
auto visual = rootVisual.GetAt(root->overlayIndex() + m_activeOverlays);
rootVisual.Remove(visual);
- --m_activeOverlays;
}
}
return;
diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp b/vnext/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp
index d1424fa0ebd..89f1a8b097f 100644
--- a/vnext/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp
+++ b/vnext/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp
@@ -284,6 +284,7 @@ void ReactNativeIsland::UpdateRootVisualSize() noexcept {
m_rootVisual.Size({m_size.Width * m_scaleFactor, m_size.Height * m_scaleFactor});
UpdateLoadingVisualSize();
+ UpdateDebuggerVisualSize();
}
void ReactNativeIsland::UpdateLoadingVisualSize() noexcept {
@@ -300,6 +301,13 @@ void ReactNativeIsland::UpdateLoadingVisualSize() noexcept {
}
}
+void ReactNativeIsland::UpdateDebuggerVisualSize() noexcept {
+ if (!m_debuggerChildSiteLink)
+ return;
+
+ m_debuggerChildSiteLink.ActualSize(m_size);
+}
+
float ReactNativeIsland::ScaleFactor() noexcept {
return m_scaleFactor;
}
@@ -484,6 +492,20 @@ void ReactNativeIsland::InitRootView(
m_CompositionEventHandler = std::make_shared<::Microsoft::ReactNative::CompositionEventHandler>(m_context, *this);
m_CompositionEventHandler->Initialize();
+ ::Microsoft::ReactNative::DebuggerNotifications::SubscribeShowDebuggerPausedOverlay(
+ m_context.Notifications().Handle(),
+ m_context.UIDispatcher().Handle(),
+ [weakThis = get_weak()](std::string message, std::function onResume) {
+ if (auto strongThis = weakThis.get()) {
+ strongThis->ShowDebuggerUI(message, onResume);
+ }
+ },
+ [weakThis = get_weak()]() {
+ if (auto strongThis = weakThis.get()) {
+ strongThis->HideDebuggerUI();
+ }
+ });
+
UpdateRootViewInternal();
m_isInitialized = true;
@@ -746,7 +768,10 @@ void ReactNativeIsland::ShowInstanceLoading() noexcept {
NotifySizeChanged();
UpdateLoadingVisualSize();
- InternalRootVisual().InsertAt(m_loadingVisual, m_hasRenderedVisual ? 1 : 0);
+ // ShowDebuggerUI(); // TEMP
+
+ InternalRootVisual().InsertAt(
+ m_loadingVisual, m_hasRenderedVisual ? (m_debuggerVisual ? 2 : 1) : (m_debuggerVisual ? 1 : 0));
}
void ReactNativeIsland::InitTextScaleMultiplier() noexcept {
@@ -767,6 +792,48 @@ void ReactNativeIsland::InitTextScaleMultiplier() noexcept {
});
}
+void ReactNativeIsland::ShowDebuggerUI(std::string message, const std::function &onResume) noexcept {
+ if (!m_debuggerVisual) {
+ auto compContext =
+ winrt::Microsoft::ReactNative::Composition::implementation::CompositionUIService::GetCompositionContext(
+ m_context.Properties().Handle());
+ m_debuggerVisual = compContext.CreateSpriteVisual();
+
+ m_debuggerChildSiteLink = winrt::Microsoft::UI::Content::ChildSiteLink::Create(
+ Island(),
+ winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::InnerVisual(
+ m_debuggerVisual)
+ .as());
+
+ m_debuggerUIIsland = std::make_shared(m_compositor, compContext, Theme());
+ m_debuggerUIIsland->Message(std::string(message));
+ m_debuggerVisual.RelativeSizeWithOffset({0.0f, 0.0f}, {1.0f, 1.0f});
+
+ m_debuggerUIIsland->Resumed(
+ [wkThis = get_weak(), onResume](
+ const winrt::Windows::Foundation::IInspectable &, const winrt::Windows::Foundation::IInspectable &) {
+ if (auto pThis = wkThis.get()) {
+ // pThis->HideDebuggerUI();
+ onResume();
+ }
+ });
+
+ InternalRootVisual().InsertAt(m_debuggerVisual, m_hasRenderedVisual ? 1 : 0);
+ m_debuggerUIIsland->Island().IsHitTestVisibleWhenTransparent(false);
+ m_debuggerChildSiteLink.Connect(m_debuggerUIIsland->Island());
+ }
+
+ m_debuggerVisual.IsVisible(true);
+
+ UpdateRootVisualSize();
+}
+
+void ReactNativeIsland::HideDebuggerUI() noexcept {
+ if (m_debuggerVisual) {
+ m_debuggerVisual.IsVisible(false);
+ }
+}
+
winrt::Windows::Foundation::Size ReactNativeIsland::Measure(
const winrt::Microsoft::ReactNative::LayoutConstraints &layoutConstraints,
const winrt::Windows::Foundation::Point &viewportOffset) const {
diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h b/vnext/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h
index 2b959123387..bfdae77958e 100644
--- a/vnext/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h
+++ b/vnext/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h
@@ -7,11 +7,14 @@
#include
#include
+#include
#include
#include
#include
+#include
#include
#include "CompositionEventHandler.h"
+#include "DebuggerUIIsland.h"
#include "PortalComponentView.h"
#include "ReactHost/React.h"
@@ -181,6 +184,9 @@ struct ReactNativeIsland
std::shared_ptr<::Microsoft::ReactNative::CompositionEventHandler> m_CompositionEventHandler;
winrt::Microsoft::ReactNative::Composition::Experimental::IVisual m_rootVisual{nullptr};
winrt::Microsoft::ReactNative::Composition::Experimental::ISpriteVisual m_loadingVisual{nullptr};
+ winrt::Microsoft::UI::Content::ChildSiteLink m_debuggerChildSiteLink{nullptr};
+ std::shared_ptr m_debuggerUIIsland;
+ winrt::Microsoft::ReactNative::Composition::Experimental::ISpriteVisual m_debuggerVisual{nullptr};
winrt::Microsoft::ReactNative::Composition::Experimental::IActivityVisual m_loadingActivityVisual{nullptr};
winrt::Microsoft::ReactNative::Composition::ICustomResourceLoader m_resources{nullptr};
winrt::Microsoft::ReactNative::Composition::Theme m_theme{nullptr};
@@ -196,8 +202,11 @@ struct ReactNativeIsland
void ShowInstanceLoaded() noexcept;
void ShowInstanceError() noexcept;
void ShowInstanceLoading() noexcept;
+ void ShowDebuggerUI(std::string message, const std::function &onResume) noexcept;
+ void HideDebuggerUI() noexcept;
void UpdateRootVisualSize() noexcept;
void UpdateLoadingVisualSize() noexcept;
+ void UpdateDebuggerVisualSize() noexcept;
Composition::Experimental::IDrawingSurfaceBrush CreateLoadingVisualBrush() noexcept;
void ApplyConstraints(
const winrt::Microsoft::ReactNative::LayoutConstraints &layoutConstraintsIn,
diff --git a/vnext/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp b/vnext/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp
index 7860f83c047..13c9d242388 100644
--- a/vnext/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp
+++ b/vnext/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp
@@ -167,6 +167,9 @@ void FabricUIManager::setProps(facebook::react::SurfaceId surfaceId, const folly
}
void FabricUIManager::stopSurface(facebook::react::SurfaceId surfaceId) noexcept {
+ if (surfaceId == -1) {
+ return;
+ }
visit(surfaceId, [&](const facebook::react::SurfaceHandler &surfaceHandler) {
surfaceHandler.stop();
m_scheduler->unregisterSurface(surfaceHandler);
@@ -176,7 +179,9 @@ void FabricUIManager::stopSurface(facebook::react::SurfaceId surfaceId) noexcept
std::unique_lock lock(m_handlerMutex);
auto iterator = m_handlerRegistry.find(surfaceId);
- m_handlerRegistry.erase(iterator);
+ if (iterator != m_handlerRegistry.end()) {
+ m_handlerRegistry.erase(iterator);
+ }
}
auto &rootDescriptor = m_registry.componentViewDescriptorWithTag(surfaceId);
diff --git a/vnext/Microsoft.ReactNative/Fabric/platform/react/threading/TaskDispatchThread.cpp b/vnext/Microsoft.ReactNative/Fabric/platform/react/threading/TaskDispatchThread.cpp
index 9c7318103bd..945d28ee97e 100644
--- a/vnext/Microsoft.ReactNative/Fabric/platform/react/threading/TaskDispatchThread.cpp
+++ b/vnext/Microsoft.ReactNative/Fabric/platform/react/threading/TaskDispatchThread.cpp
@@ -12,8 +12,11 @@
#include
#include
-#include
+#include
#include
+#include
+#include
+#include
#include
#include
@@ -25,40 +28,88 @@
namespace facebook::react {
-TaskDispatchThread::TaskDispatchThread(std::string threadName, int priorityOffset) noexcept
- : threadName_(std::move(threadName)) {
-#ifdef ANDROID
- // Attaches the thread to JVM just in case anything calls out to Java
- thread_ = std::thread([&]() {
- facebook::jni::ThreadScope::WithClassLoader([&]() {
- int result = setpriority(PRIO_PROCESS, static_cast(::syscall(SYS_gettid)), priorityOffset);
+class TaskDispatchThread::Impl : public std::enable_shared_from_this {
+ public:
+ Impl(std::string &&threadName) noexcept;
+ ~Impl() noexcept;
+
+ void start() noexcept;
+ bool isOnThread() noexcept;
+ bool isRunning() noexcept;
+ void runAsync(TaskFn &&task, std::chrono::milliseconds delayMs = std::chrono::milliseconds::zero()) noexcept;
+ void runSync(TaskFn &&task) noexcept;
+ void quit() noexcept;
+ void loop() noexcept;
+
+ private:
+ struct Task {
+ TimePoint dispatchTime;
+ TaskFn fn;
+
+ Task(TimePoint dispatchTime, TaskFn &&fn) : dispatchTime(dispatchTime), fn(std::move(fn)) {}
+
+ bool operator<(const Task &other) const {
+ // Have the earliest tasks be at the front of the queue.
+ return dispatchTime > other.dispatchTime;
+ }
+ };
+
+ std::mutex queueLock_;
+ std::condition_variable loopCv_;
+ std::priority_queue queue_;
+ std::atomic running_{true};
+ std::string threadName_;
+ std::thread thread_;
+};
+
+TaskDispatchThread::TaskDispatchThread(std::string threadName, int /*priorityOffset*/) noexcept
+ : impl_(std::make_shared(std::move(threadName))) {
+ impl_->start();
+}
- if (result != 0) {
- LOG(INFO) << " setCurrentThreadPriority failed with pri errno: " << errno;
- }
+TaskDispatchThread::~TaskDispatchThread() noexcept {
+ impl_->quit();
+}
- loop();
- });
- });
+bool TaskDispatchThread::isOnThread() noexcept {
+ return impl_->isOnThread();
+}
-#else
- thread_ = std::thread(&TaskDispatchThread::loop, this);
-#endif
+bool TaskDispatchThread::isRunning() noexcept {
+ return impl_->isRunning();
}
-TaskDispatchThread::~TaskDispatchThread() noexcept {
+void TaskDispatchThread::runAsync(TaskFn &&task, std::chrono::milliseconds delayMs) noexcept {
+ impl_->runAsync(std::move(task), delayMs);
+}
+
+void TaskDispatchThread::runSync(TaskFn &&task) noexcept {
+ impl_->runSync(std::move(task));
+}
+
+void TaskDispatchThread::quit() noexcept {
+ impl_->quit();
+}
+
+TaskDispatchThread::Impl::Impl(std::string &&threadName) noexcept : threadName_(std::move(threadName)) {}
+
+TaskDispatchThread::Impl::~Impl() noexcept {
quit();
}
-bool TaskDispatchThread::isOnThread() noexcept {
+void TaskDispatchThread::Impl::start() noexcept {
+ thread_ = std::thread([self = shared_from_this()]() { self->loop(); });
+}
+
+bool TaskDispatchThread::Impl::isOnThread() noexcept {
return std::this_thread::get_id() == thread_.get_id();
}
-bool TaskDispatchThread::isRunning() noexcept {
+bool TaskDispatchThread::Impl::isRunning() noexcept {
return running_;
}
-void TaskDispatchThread::runAsync(TaskFn &&task, std::chrono::milliseconds delayMs) noexcept {
+void TaskDispatchThread::Impl::runAsync(TaskFn &&task, std::chrono::milliseconds delayMs) noexcept {
if (!running_) {
return;
}
@@ -68,7 +119,7 @@ void TaskDispatchThread::runAsync(TaskFn &&task, std::chrono::milliseconds delay
loopCv_.notify_one();
}
-void TaskDispatchThread::runSync(TaskFn &&task) noexcept {
+void TaskDispatchThread::Impl::runSync(TaskFn &&task) noexcept {
std::promise promise;
runAsync([&]() {
if (running_) {
@@ -79,7 +130,7 @@ void TaskDispatchThread::runSync(TaskFn &&task) noexcept {
promise.get_future().wait();
}
-void TaskDispatchThread::quit() noexcept {
+void TaskDispatchThread::Impl::quit() noexcept {
if (!running_) {
return;
}
@@ -94,7 +145,7 @@ void TaskDispatchThread::quit() noexcept {
}
}
-void TaskDispatchThread::loop() noexcept {
+void TaskDispatchThread::Impl::loop() noexcept {
if (!threadName_.empty()) {
folly::setThreadName(threadName_);
}
diff --git a/vnext/Microsoft.ReactNative/Fabric/platform/react/threading/TaskDispatchThread.h b/vnext/Microsoft.ReactNative/Fabric/platform/react/threading/TaskDispatchThread.h
index 1f161ca6997..38fd14aca49 100644
--- a/vnext/Microsoft.ReactNative/Fabric/platform/react/threading/TaskDispatchThread.h
+++ b/vnext/Microsoft.ReactNative/Fabric/platform/react/threading/TaskDispatchThread.h
@@ -11,11 +11,8 @@
#pragma once
#include
-#include
#include
-#include
-#include
-#include
+#include
namespace facebook::react {
@@ -47,27 +44,9 @@ class TaskDispatchThread {
/** Shut down and clean up the thread. */
void quit() noexcept;
- protected:
- struct Task {
- TimePoint dispatchTime;
- TaskFn fn;
-
- Task(TimePoint dispatchTime, TaskFn &&fn) : dispatchTime(dispatchTime), fn(std::move(fn)) {}
-
- bool operator<(const Task &other) const {
- // Have the earliest tasks be at the front of the queue.
- return dispatchTime > other.dispatchTime;
- }
- };
-
- void loop() noexcept;
-
- std::mutex queueLock_;
- std::condition_variable loopCv_;
- std::priority_queue queue_;
- std::atomic running_{true};
- std::string threadName_;
- std::thread thread_;
+ private:
+ class Impl;
+ std::shared_ptr impl_;
};
} // namespace facebook::react
diff --git a/vnext/Microsoft.ReactNative/JsiApi.cpp b/vnext/Microsoft.ReactNative/JsiApi.cpp
index d074fff39f7..3408bd28163 100644
--- a/vnext/Microsoft.ReactNative/JsiApi.cpp
+++ b/vnext/Microsoft.ReactNative/JsiApi.cpp
@@ -479,7 +479,7 @@ facebook::jsi::JSError const &jsError) { \
}();
)JS");
// TODO: consider implementing this script as a resource file and loading it with the resource URL.
- jsiRuntime->evaluateJavaScript(jsiPalBuffer, "Form_JSI_API_not_a_real_file");
+ jsiRuntime->evaluateJavaScript(jsiPalBuffer, "jsi-internal://host-function-manager.js");
ReactNative::JsiRuntime abiJsiResult{make(Mso::Copy(jsiRuntimeHolder), Mso::Copy(jsiRuntime))};
std::scoped_lock lock{s_mutex};
auto it = s_jsiRuntimeMap.try_emplace(reinterpret_cast(jsiRuntime.get()), abiJsiResult);
diff --git a/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj b/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj
index b50fab3cadb..f8097e89ed4 100644
--- a/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj
+++ b/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj
@@ -268,6 +268,7 @@
Code
+
diff --git a/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters b/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters
index ad0c2b22282..e2480686490 100644
--- a/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters
+++ b/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters
@@ -313,6 +313,9 @@
ReactHost
+
+ ReactHost
+
ReactHost
diff --git a/vnext/Microsoft.ReactNative/ReactHost/DebuggerNotifications.h b/vnext/Microsoft.ReactNative/ReactHost/DebuggerNotifications.h
new file mode 100644
index 00000000000..6a083140a34
--- /dev/null
+++ b/vnext/Microsoft.ReactNative/ReactHost/DebuggerNotifications.h
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+#pragma once
+
+#include
+
+namespace Microsoft::ReactNative {
+
+struct DebuggerNotifications {
+ static winrt::Microsoft::ReactNative::IReactPropertyName ShowDebuggerPausedOverlayEventName() noexcept {
+ static winrt::Microsoft::ReactNative::IReactPropertyName propertyName{
+ winrt::Microsoft::ReactNative::ReactPropertyBagHelper::GetName(
+ winrt::Microsoft::ReactNative::ReactPropertyBagHelper::GetNamespace(L"ReactNative.Debugger"),
+ L"ShowDebuggerPausedOverlay")};
+ return propertyName;
+ }
+
+ static void OnShowDebuggerPausedOverlay(
+ winrt::Microsoft::ReactNative::IReactNotificationService const &service,
+ std::string message,
+ std::function onResume) {
+ const winrt::Microsoft::ReactNative::ReactNonAbiValue>> nonAbiValue{
+ std::in_place, std::tie(message, onResume)};
+ service.SendNotification(ShowDebuggerPausedOverlayEventName(), nullptr, nonAbiValue);
+ }
+
+ static void OnHideDebuggerPausedOverlay(winrt::Microsoft::ReactNative::IReactNotificationService const &service) {
+ service.SendNotification(ShowDebuggerPausedOverlayEventName(), nullptr, nullptr);
+ }
+
+ static winrt::Microsoft::ReactNative::IReactNotificationSubscription SubscribeShowDebuggerPausedOverlay(
+ winrt::Microsoft::ReactNative::IReactNotificationService const &service,
+ winrt::Microsoft::ReactNative::IReactDispatcher const &dispatcher,
+ std::function)> showCallback,
+ std::function hideCallback) {
+ return service.Subscribe(
+ ShowDebuggerPausedOverlayEventName(),
+ dispatcher,
+ [showCallback, hideCallback](auto &&, winrt::Microsoft::ReactNative::IReactNotificationArgs const &args) {
+ if (args.Data()) {
+ const auto [message, onResume] = args.Data()
+ .as>>>()
+ .Value();
+ showCallback(message, onResume);
+ } else {
+ hideCallback();
+ }
+ });
+ }
+};
+
+} // namespace Microsoft::ReactNative
diff --git a/vnext/Microsoft.ReactNative/ReactHost/React.h b/vnext/Microsoft.ReactNative/ReactHost/React.h
index dc7867f39b8..c7b8f8a15f1 100644
--- a/vnext/Microsoft.ReactNative/ReactHost/React.h
+++ b/vnext/Microsoft.ReactNative/ReactHost/React.h
@@ -33,6 +33,10 @@
#include
#endif
+namespace facebook::react::jsinspector_modern {
+class HostTarget;
+} // namespace facebook::react::jsinspector_modern
+
namespace Mso::React {
// Forward declarations
@@ -216,9 +220,9 @@ struct ReactOptions {
//! Base path of the SDX. The absolute path of the SDX can be constructed from this and the Identity.
std::string BundleRootPath;
- //! Javascript Bundles
- //! This List includes both Platform and User Javascript Bundles
- //! Bundles are loaded into Javascript engine in the same order
+ //! JavaScript Bundles
+ //! This List includes both Platform and User JavaScript Bundles
+ //! Bundles are loaded into JavaScript engine in the same order
//! as they are specified in this list.
std::vector> JSBundles;
@@ -237,7 +241,7 @@ struct ReactOptions {
//! during development to report JavaScript errors to users
std::shared_ptr RedBoxHandler;
- //! Flag to suggest sdx owner's preference on enabling Bytecode caching in Javascript Engine for corresponding SDX.
+ //! Flag to suggest sdx owner's preference on enabling Bytecode caching in JavaScript Engine for corresponding SDX.
bool EnableBytecode{true};
//! Flag controlling whether the JavaScript engine uses JIT compilation.
@@ -347,6 +351,9 @@ struct ReactOptions {
//! The callback is called when IReactInstance is destroyed and must not be used anymore.
//! It is called from the native queue.
OnReactInstanceDestroyedCallback OnInstanceDestroyed;
+
+ //! The HostTarget instance for modern inspector integration.
+ facebook::react::jsinspector_modern::HostTarget *InspectorHostTarget;
};
//! IReactHost manages a ReactNative instance.
diff --git a/vnext/Microsoft.ReactNative/ReactHost/ReactHost.cpp b/vnext/Microsoft.ReactNative/ReactHost/ReactHost.cpp
index 56ce0f97635..cb7737ae6ed 100644
--- a/vnext/Microsoft.ReactNative/ReactHost/ReactHost.cpp
+++ b/vnext/Microsoft.ReactNative/ReactHost/ReactHost.cpp
@@ -8,9 +8,16 @@
#include
+#include
+#include
#include
#include
+#include "Inspector/ReactInspectorThread.h"
+#include "ReactHost/DebuggerNotifications.h"
+
+using namespace facebook::react;
+
namespace Mso::React {
//=============================================================================================
@@ -282,6 +289,10 @@ bool ReactOptions::EnableDefaultCrashHandler() const noexcept {
return winrt::unbox_value_or(properties.Get(EnableDefaultCrashHandlerProperty()), false);
}
+//=============================================================================================
+// ReactNativeWindowsFeatureFlags implementation
+//=============================================================================================
+
class ReactNativeWindowsFeatureFlags : public facebook::react::ReactNativeFeatureFlagsDefaults {
public:
bool enableBridgelessArchitecture() override {
@@ -295,9 +306,59 @@ class ReactNativeWindowsFeatureFlags : public facebook::react::ReactNativeFeatur
bool enableCppPropsIteratorSetter() override {
return true;
}
+
+ bool fuseboxEnabledRelease() override {
+ return true; // Enable Fusebox (modern CDP backend) by default for React Native Windows
+ }
+
+ bool fuseboxNetworkInspectionEnabled() override {
+ return true; // Enable network inspection support in Fusebox
+ }
+};
+
+//=============================================================================================
+// ReactInspectorHostTargetDelegate implementation
+//=============================================================================================
+
+class ReactInspectorHostTargetDelegate : public jsinspector_modern::HostTargetDelegate,
+ public std::enable_shared_from_this {
+ public:
+ ReactInspectorHostTargetDelegate(Mso::WeakPtr &&reactHost) noexcept : m_reactHost(std::move(reactHost)) {}
+
+ jsinspector_modern::HostTargetMetadata getMetadata() override {
+ // TODO: (vmoroz) provide more info
+ return {
+ .integrationName = "React Native Windows (Host)",
+ };
+ }
+
+ void onReload(jsinspector_modern::HostTargetDelegate::PageReloadRequest const &request) override {
+ if (Mso::CntPtr reactHost = m_reactHost.GetStrongPtr()) {
+ reactHost->ReloadInstance();
+ }
+ }
+
+ void onSetPausedInDebuggerMessage(
+ jsinspector_modern::HostTargetDelegate::OverlaySetPausedInDebuggerMessageRequest const &request) override {
+ if (Mso::CntPtr reactHost = m_reactHost.GetStrongPtr()) {
+ auto notifications = reactHost->Options().Notifications;
+ if (request.message.has_value()) {
+ ::Microsoft::ReactNative::DebuggerNotifications::OnShowDebuggerPausedOverlay(
+ notifications, request.message.value(), [weakReactHost = m_reactHost]() {
+ if (Mso::CntPtr strongReactHost = weakReactHost.GetStrongPtr()) {
+ strongReactHost->OnDebuggerResume();
+ }
+ });
+ } else {
+ ::Microsoft::ReactNative::DebuggerNotifications::OnHideDebuggerPausedOverlay(notifications);
+ }
+ }
+ }
+
+ private:
+ Mso::WeakPtr m_reactHost;
};
-std::once_flag g_FlagInitFeatureFlags;
//=============================================================================================
// ReactHost implementation
//=============================================================================================
@@ -305,9 +366,16 @@ std::once_flag g_FlagInitFeatureFlags;
ReactHost::ReactHost(Mso::DispatchQueue const &queue) noexcept
: Super{EnsureSerialQueue(queue)},
m_options{Queue(), m_mutex},
- m_notifyWhenClosed{ReactHostRegistry::Register(*this), Queue(), m_mutex} {
- std::call_once(g_FlagInitFeatureFlags, []() noexcept {
- facebook::react::ReactNativeFeatureFlags::override(std::make_unique());
+ m_notifyWhenClosed{ReactHostRegistry::Register(*this), Queue(), m_mutex},
+ m_inspectorHostTargetDelegate{std::make_shared(this)},
+ m_inspectorHostTarget{
+ jsinspector_modern::HostTarget::create(*m_inspectorHostTargetDelegate, [](std::function &&callback) {
+ ::Microsoft::ReactNative::ReactInspectorThread::Instance().Post(
+ [callback = std::move(callback)]() { callback(); });
+ })} {
+ static std::once_flag initFeatureFlagsOnce;
+ std::call_once(initFeatureFlagsOnce, []() noexcept {
+ ReactNativeFeatureFlags::override(std::make_unique());
});
}
@@ -319,15 +387,16 @@ void ReactHost::Finalize() noexcept {
// Since each AsyncAction has a strong ref count to ReactHost, the AsyncActionQueue must be empty.
// Thus, we only need to call UnloadInQueue to unload ReactInstance if the ReactHost is not closed yet.
if (Mso::Promise notifyWhenClosed = m_notifyWhenClosed.Exchange(nullptr)) {
- UnloadInQueue(0).Then(
- [notifyWhenClosed = std::move(notifyWhenClosed)]() noexcept { notifyWhenClosed.TrySetValue(); });
+ UnloadInQueue(UnloadReason::CloseHost, 0)
+ .Then(
+ [notifyWhenClosed = std::move(notifyWhenClosed)]() noexcept { notifyWhenClosed.TrySetValue(); });
}
}
void ReactHost::Close() noexcept {
InvokeInQueue([this]() noexcept {
// Put the ReactHost to the closed state, unload ReactInstance, and notify the closing Promise.
- auto whenClosed = m_actionQueue.Load()->PostAction(MakeUnloadInstanceAction());
+ auto whenClosed = m_actionQueue.Load()->PostAction(MakeUnloadInstanceAction(UnloadReason::CloseHost));
// After we set the m_notifyWhenClosed to null, the ReactHost is considered to be closed.
Mso::SetPromiseValue(m_notifyWhenClosed.Exchange(nullptr), std::move(whenClosed));
@@ -379,12 +448,14 @@ Mso::Future ReactHost::ReloadInstance() noexcept {
Mso::Future ReactHost::ReloadInstanceWithOptions(ReactOptions &&options) noexcept {
return PostInQueue([this, options = std::move(options)]() mutable noexcept {
- return m_actionQueue.Load()->PostActions({MakeUnloadInstanceAction(), MakeLoadInstanceAction(std::move(options))});
+ return m_actionQueue.Load()->PostActions(
+ {MakeUnloadInstanceAction(UnloadReason::Unload), MakeLoadInstanceAction(std::move(options))});
});
}
Mso::Future ReactHost::UnloadInstance() noexcept {
- return PostInQueue([this]() noexcept { return m_actionQueue.Load()->PostAction(MakeUnloadInstanceAction()); });
+ return PostInQueue(
+ [this]() noexcept { return m_actionQueue.Load()->PostAction(MakeUnloadInstanceAction(UnloadReason::Unload)); });
}
AsyncAction ReactHost::MakeLoadInstanceAction(ReactOptions &&options) noexcept {
@@ -393,11 +464,13 @@ AsyncAction ReactHost::MakeLoadInstanceAction(ReactOptions &&options) noexcept {
};
}
-AsyncAction ReactHost::MakeUnloadInstanceAction() noexcept {
+AsyncAction ReactHost::MakeUnloadInstanceAction(UnloadReason reason) noexcept {
Mso::Internal::VerifyIsInQueueElseCrash(Queue());
size_t unloadActionId = ++m_nextUnloadActionId;
m_pendingUnloadActionId = unloadActionId;
- return [spThis = Mso::CntPtr{this}, unloadActionId]() noexcept { return spThis->UnloadInQueue(unloadActionId); };
+ return [spThis = Mso::CntPtr{this}, reason, unloadActionId]() noexcept {
+ return spThis->UnloadInQueue(reason, unloadActionId);
+ };
}
Mso::CntPtr ReactHost::MakeViewHost(ReactViewOptions &&options) noexcept {
@@ -428,6 +501,18 @@ Mso::Future ReactHost::LoadInQueue(ReactOptions &&options) noexcept {
return Mso::MakeCanceledFuture();
}
+ // Start or stop inspector page if needed.
+ // Make sure to update the both copies of options.
+ if (IsInspectable()) {
+ AddInspectorPage();
+ options.InspectorHostTarget = m_inspectorHostTarget.get();
+ m_options.Load().InspectorHostTarget = m_inspectorHostTarget.get();
+ } else {
+ RemoveInspectorPage();
+ options.InspectorHostTarget = nullptr;
+ m_options.Load().InspectorHostTarget = nullptr;
+ }
+
Mso::Promise whenCreated;
Mso::Promise whenLoaded;
@@ -463,7 +548,7 @@ Mso::Future ReactHost::LoadInQueue(ReactOptions &&options) noexcept {
});
}
-Mso::Future ReactHost::UnloadInQueue(size_t unloadActionId) noexcept {
+Mso::Future ReactHost::UnloadInQueue(UnloadReason reason, size_t unloadActionId) noexcept {
Mso::Internal::VerifyIsInQueueElseCrash(Queue());
// If the pending unload action Id does not match, then we have newer unload action,
@@ -485,21 +570,25 @@ Mso::Future ReactHost::UnloadInQueue(size_t unloadActionId) noexcept {
// We unload ReactInstance after all view instances are unloaded.
// It is safe to capture 'this' because the Unload action keeps a strong reference to ReactHost.
- return Mso::WhenAllCompleted(unloadCompletionList).Then(m_executor, [this](Mso::Maybe && /*value*/) noexcept {
- Mso::Future onUnloaded;
- if (auto reactInstance = m_reactInstance.Exchange(nullptr)) {
- onUnloaded = reactInstance->Destroy();
- }
-
- m_isInstanceUnloading.Store(false);
- m_lastError.Store({});
-
- if (!onUnloaded) {
- onUnloaded = Mso::MakeSucceededFuture();
- }
-
- return onUnloaded;
- });
+ return Mso::WhenAllCompleted(unloadCompletionList)
+ .Then(m_executor, [this, reason](Mso::Maybe && /*value*/) noexcept {
+ Mso::Future onUnloaded;
+ if (auto reactInstance = m_reactInstance.Exchange(nullptr)) {
+ onUnloaded = reactInstance->Destroy();
+ }
+
+ m_isInstanceUnloading.Store(false);
+ m_lastError.Store({});
+
+ if (!onUnloaded) {
+ onUnloaded = Mso::MakeSucceededFuture();
+ }
+
+ if (reason == UnloadReason::CloseHost) {
+ RemoveInspectorPage();
+ }
+ return onUnloaded;
+ });
}
void ReactHost::ForEachViewHost(const Mso::FunctorRef &action) noexcept {
@@ -528,6 +617,54 @@ void ReactHost::DetachViewHost(ReactViewHost &viewHost) noexcept {
viewHosts.erase(it);
}
+bool ReactHost::IsInspectable() noexcept {
+ ReactOptions &options = m_options.Load();
+ return options.JsiEngine() == JSIEngine::Hermes && options.UseDirectDebugger();
+}
+
+void ReactHost::AddInspectorPage() noexcept {
+ std::optional &inspectorPageId = m_inspectorPageId.Load();
+ if (inspectorPageId.has_value())
+ return;
+
+ jsinspector_modern::InspectorTargetCapabilities capabilities;
+ capabilities.nativePageReloads = true;
+ capabilities.prefersFuseboxFrontend = true;
+ // TODO: (vmoroz) improve the page name
+ inspectorPageId = jsinspector_modern::getInspectorInstance().addPage(
+ "React Native Windows (Experimental)",
+ "Hermes",
+ [weakInspectorHostTarget =
+ std::weak_ptr(m_inspectorHostTarget)](std::unique_ptr remote)
+ -> std::unique_ptr {
+ if (std::shared_ptr inspectorHostTarget = weakInspectorHostTarget.lock()) {
+ return inspectorHostTarget->connect(std::move(remote));
+ }
+
+ // This can happen if we're about to shut down. Reject the connection.
+ return nullptr;
+ },
+ capabilities);
+}
+
+void ReactHost::RemoveInspectorPage() noexcept {
+ std::optional &inspectorPageId = m_inspectorPageId.Load();
+ if (!inspectorPageId.has_value())
+ return;
+
+ jsinspector_modern::getInspectorInstance().removePage(*inspectorPageId);
+ inspectorPageId.reset();
+}
+
+void ReactHost::OnDebuggerResume() noexcept {
+ ::Microsoft::ReactNative::ReactInspectorThread::Instance().Post(
+ [weakInspectorHostTarget = std::weak_ptr(m_inspectorHostTarget)]() {
+ if (std::shared_ptr inspectorHostTarget = weakInspectorHostTarget.lock()) {
+ inspectorHostTarget->sendCommand(jsinspector_modern::HostCommand::DebuggerResume);
+ }
+ });
+}
+
//=============================================================================================
// ReactViewHost implementation
//=============================================================================================
@@ -579,8 +716,8 @@ Mso::Future ReactViewHost::AttachViewInstance(IReactViewInstance &viewInst
m_reactHost->AttachViewHost(*this);
return InitViewInstanceInQueue();
- //// Schedule the viewInstance load in the action queue since there can be other load actions in the queue that need
- //// to be consolidated.
+ // Schedule the viewInstance load in the action queue since there can be other load actions in the queue that need
+ // to be consolidated.
// return m_actionQueue.Load()->PostAction(MakeInitViewInstanceAction());
});
}
diff --git a/vnext/Microsoft.ReactNative/ReactHost/ReactHost.h b/vnext/Microsoft.ReactNative/ReactHost/ReactHost.h
index 765039d9542..b786772b233 100644
--- a/vnext/Microsoft.ReactNative/ReactHost/ReactHost.h
+++ b/vnext/Microsoft.ReactNative/ReactHost/ReactHost.h
@@ -3,6 +3,7 @@
#pragma once
+#include
#include
#include
#include "AsyncActionQueue.h"
@@ -15,6 +16,7 @@
namespace Mso::React {
+class ReactInspectorHostTargetDelegate;
class ReactViewHost;
//! ReactHost manages lifetime of ReactNative instance.
@@ -52,9 +54,6 @@ class ReactHost final : public Mso::ActiveObject {
Mso::CntPtr ActionQueue() const noexcept;
- Mso::Future LoadInQueue(ReactOptions &&options) noexcept;
- Mso::Future UnloadInQueue(size_t unloadActionId) noexcept;
-
void Close() noexcept;
bool IsClosed() const noexcept;
@@ -64,6 +63,12 @@ class ReactHost final : public Mso::ActiveObject {
template
Mso::Future PostInQueue(TCallback &&callback) noexcept;
+ private:
+ enum class UnloadReason {
+ Unload,
+ CloseHost,
+ };
+
private:
friend MakePolicy;
ReactHost(Mso::DispatchQueue const &queue) noexcept;
@@ -75,9 +80,18 @@ class ReactHost final : public Mso::ActiveObject {
void ForEachViewHost(const Mso::FunctorRef &action) noexcept;
AsyncAction MakeLoadInstanceAction(ReactOptions &&options) noexcept;
- AsyncAction MakeUnloadInstanceAction() noexcept;
+ AsyncAction MakeUnloadInstanceAction(UnloadReason reason) noexcept;
+
+ Mso::Future LoadInQueue(ReactOptions &&options) noexcept;
+ Mso::Future UnloadInQueue(UnloadReason reason, size_t unloadActionId) noexcept;
+
+ void OnDebuggerResume() noexcept;
+ bool IsInspectable() noexcept;
+ void AddInspectorPage() noexcept;
+ void RemoveInspectorPage() noexcept;
private:
+ friend class ReactInspectorHostTargetDelegate;
mutable std::mutex m_mutex;
const Mso::InvokeElsePostExecutor m_executor{Queue()};
const Mso::ActiveReadableField> m_actionQueue{
@@ -92,6 +106,10 @@ class ReactHost final : public Mso::ActiveObject {
size_t m_pendingUnloadActionId{0};
size_t m_nextUnloadActionId{0};
const Mso::ActiveField m_isInstanceUnloading{false, Queue()};
+
+ const std::shared_ptr m_inspectorHostTargetDelegate;
+ const std::shared_ptr m_inspectorHostTarget;
+ const Mso::ActiveField> m_inspectorPageId{Queue()};
};
//! Implements a cross-platform host for a React view
diff --git a/vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp b/vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp
index 35a4874ae9b..2bb37e363d9 100644
--- a/vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp
+++ b/vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp
@@ -66,6 +66,7 @@
#include
#include
#include
+#include "Inspector/ReactInspectorThread.h"
#endif
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
@@ -546,6 +547,8 @@ std::shared_ptr ReactInstanceWin::CreateDevSetting
devSettings->useRuntimeScheduler = useRuntimeScheduler;
+ devSettings->inspectorHostTarget = m_options.InspectorHostTarget;
+
return devSettings;
}
@@ -656,16 +659,21 @@ void ReactInstanceWin::InitializeBridgeless() noexcept {
};
if (devSettings->useDirectDebugger) {
- ::Microsoft::ReactNative::GetSharedDevManager()->EnsureHermesInspector(
- devSettings->sourceBundleHost, devSettings->sourceBundlePort);
+ ::Microsoft::ReactNative::GetSharedDevManager()->EnsureInspectorPackagerConnection(
+ devSettings->sourceBundleHost, devSettings->sourceBundlePort, devSettings->bundleAppId);
}
m_jsiRuntimeHolder = std::make_shared(
devSettings, jsMessageThread, CreatePreparedScriptStore());
auto jsRuntime = std::make_unique(m_jsiRuntimeHolder);
jsRuntime->getRuntime();
- m_bridgelessReactInstance = std::make_unique(
- std::move(jsRuntime), jsMessageThread, timerManager, jsErrorHandlingFunc);
+
+ m_bridgelessReactInstance = std::make_shared(
+ std::move(jsRuntime),
+ jsMessageThread,
+ timerManager,
+ jsErrorHandlingFunc,
+ m_options.InspectorHostTarget);
auto bufferedRuntimeExecutor = m_bridgelessReactInstance->getBufferedRuntimeExecutor();
timerManager->setRuntimeExecutor(bufferedRuntimeExecutor);
@@ -687,6 +695,7 @@ void ReactInstanceWin::InitializeBridgeless() noexcept {
winrt::make(Mso::Copy(m_reactContext)));
facebook::react::ReactInstance::JSRuntimeFlags options;
+
m_bridgelessReactInstance->initializeRuntime(
options,
[=, onCreated = m_options.OnInstanceCreated, reactContext = m_reactContext](
@@ -740,7 +749,6 @@ void ReactInstanceWin::InitializeBridgeless() noexcept {
LoadJSBundlesBridgeless(devSettings);
SetupHMRClient();
-
} catch (std::exception &e) {
OnErrorWithMessage(e.what());
OnErrorWithMessage("ReactInstanceWin: Failed to create React Instance.");
@@ -1082,6 +1090,17 @@ Mso::Future ReactInstanceWin::Destroy() noexcept {
if (m_bridgelessReactInstance) {
if (auto jsMessageThread = m_jsMessageThread.Exchange(nullptr)) {
jsMessageThread->runOnQueueSync([&]() noexcept {
+ // Unregister from inspector BEFORE shutting down JS thread
+ if (m_bridgelessReactInstance && m_options.InspectorHostTarget) {
+ Mso::React::MessageDispatchQueue messageDispatchQueue{
+ ::Microsoft::ReactNative::ReactInspectorThread::Instance(), nullptr};
+ messageDispatchQueue.runOnQueueSync(
+ [weakBridgelessReactInstance = std::weak_ptr(m_bridgelessReactInstance)]() {
+ if (auto bridgelessReactInstance = weakBridgelessReactInstance.lock()) {
+ bridgelessReactInstance->unregisterFromInspector();
+ }
+ });
+ }
{
// Release the JSI runtime
std::scoped_lock lock{m_mutex};
diff --git a/vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h b/vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h
index 36c153df4e9..4d5125bc166 100644
--- a/vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h
+++ b/vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h
@@ -205,7 +205,7 @@ class ReactInstanceWin final : public Mso::ActiveObject
#ifdef USE_FABRIC
// Bridgeless
- std::unique_ptr m_bridgelessReactInstance;
+ std::shared_ptr m_bridgelessReactInstance;
#endif
std::atomic m_state{ReactInstanceState::Loading};
diff --git a/vnext/Microsoft.ReactNative/ReactRootView.cpp b/vnext/Microsoft.ReactNative/ReactRootView.cpp
index a697f76aa39..e04b0b813c2 100644
--- a/vnext/Microsoft.ReactNative/ReactRootView.cpp
+++ b/vnext/Microsoft.ReactNative/ReactRootView.cpp
@@ -5,14 +5,19 @@
#include "ReactRootView.g.cpp"
#include
+#include
#include
+#include
+#include
#include
#include
#include
#include
#include
+#include "InstanceManager.h"
#include "ReactNativeHost.h"
#include "ReactViewInstance.h"
+#include "Utils/KeyboardUtils.h"
#include "XamlUtils.h"
#include
@@ -34,6 +39,7 @@ ReactRootView::ReactRootView() noexcept : m_uiQueue(Mso::DispatchQueue::GetCurre
UpdatePerspective();
Loaded([this](auto &&, auto &&) {
::Microsoft::ReactNative::SetCompositor(::Microsoft::ReactNative::GetCompositor(*this));
+ SetupDevToolsShortcut();
});
}
@@ -45,6 +51,20 @@ void ReactRootView::ReactNativeHost(ReactNative::ReactNativeHost const &value) n
if (m_reactNativeHost != value) {
ReactViewHost(nullptr);
m_reactNativeHost = value;
+ const auto weakThis = this->get_weak();
+ ::Microsoft::ReactNative::DebuggerNotifications::SubscribeShowDebuggerPausedOverlay(
+ m_reactNativeHost.InstanceSettings().Notifications(),
+ m_reactNativeHost.InstanceSettings().UIDispatcher(),
+ [weakThis](std::string message, std::function onResume) {
+ if (auto strongThis = weakThis.get()) {
+ strongThis->ShowDebuggerPausedOverlay(message, onResume);
+ }
+ },
+ [weakThis]() {
+ if (auto strongThis = weakThis.get()) {
+ strongThis->HideDebuggerPausedOverlay();
+ }
+ });
ReloadView();
}
}
@@ -283,6 +303,65 @@ void ReactRootView::EnsureLoadingUI() noexcept {
}
}
+void ReactRootView::HideDebuggerPausedOverlay() noexcept {
+ m_isDebuggerPausedOverlayOpen = false;
+ if (m_debuggerPausedFlyout) {
+ m_debuggerPausedFlyout.Hide();
+ m_debuggerPausedFlyout = nullptr;
+ }
+}
+
+void ReactRootView::ShowDebuggerPausedOverlay(
+ const std::string &message,
+ const std::function &onResume) noexcept {
+ // Initialize content
+ const xaml::Controls::Grid contentGrid;
+ xaml::Controls::ColumnDefinition messageColumnDefinition;
+ xaml::Controls::ColumnDefinition buttonColumnDefinition;
+ messageColumnDefinition.MinWidth(60);
+ buttonColumnDefinition.MinWidth(36);
+ contentGrid.ColumnDefinitions().Append(messageColumnDefinition);
+ contentGrid.ColumnDefinitions().Append(buttonColumnDefinition);
+ xaml::Controls::TextBlock messageBlock;
+ messageBlock.Text(winrt::to_hstring(message));
+ messageBlock.FontWeight(winrt::Windows::UI::Text::FontWeights::SemiBold());
+ xaml::Controls::FontIcon resumeGlyph;
+ resumeGlyph.FontFamily(xaml::Media::FontFamily(L"Segoe MDL2 Assets"));
+ resumeGlyph.Foreground(xaml::Media::SolidColorBrush(winrt::Colors::Green()));
+ resumeGlyph.Glyph(L"\uF5B0");
+ resumeGlyph.HorizontalAlignment(xaml::HorizontalAlignment::Right);
+ resumeGlyph.PointerReleased([onResume](auto &&...) { onResume(); });
+ xaml::Controls::Grid::SetColumn(resumeGlyph, 1);
+ contentGrid.Children().Append(messageBlock);
+ contentGrid.Children().Append(resumeGlyph);
+
+ // Configure flyout
+ m_isDebuggerPausedOverlayOpen = true;
+ xaml::Style flyoutStyle(
+ {XAML_NAMESPACE_STR L".Controls.FlyoutPresenter", winrt::Windows::UI::Xaml::Interop::TypeKind::Metadata});
+ flyoutStyle.Setters().Append(winrt::Setter(
+ xaml::Controls::Control::CornerRadiusProperty(), winrt::box_value(xaml::CornerRadius{12, 12, 12, 12})));
+ flyoutStyle.Setters().Append(winrt::Setter(
+ xaml::Controls::Control::BackgroundProperty(),
+ winrt::box_value(xaml::Media::SolidColorBrush{FromArgb(255, 255, 255, 193)})));
+ flyoutStyle.Setters().Append(
+ winrt::Setter(xaml::FrameworkElement::MarginProperty(), winrt::box_value(xaml::Thickness{0, 12, 0, 0})));
+ m_debuggerPausedFlyout = xaml::Controls::Flyout{};
+ m_debuggerPausedFlyout.FlyoutPresenterStyle(flyoutStyle);
+ m_debuggerPausedFlyout.LightDismissOverlayMode(xaml::Controls::LightDismissOverlayMode::On);
+ m_debuggerPausedFlyout.Content(contentGrid);
+
+ // Disable light dismiss
+ m_debuggerPausedFlyout.Closing([weakThis = this->get_weak()](auto &&, const auto &args) {
+ if (auto strongThis = weakThis.get()) {
+ args.Cancel(strongThis->m_isDebuggerPausedOverlayOpen);
+ }
+ });
+
+ // Show flyout
+ m_debuggerPausedFlyout.ShowAt(*this);
+}
+
void ReactRootView::ShowInstanceLoaded() noexcept {
if (m_xamlRootView) {
ClearLoadingUI();
@@ -481,4 +560,33 @@ void ReactRootView::RemoveChildAt(uint32_t index) {
Children().RemoveAt(RNIndexToXamlIndex(index));
}
+bool IsCtrlShiftI(winrt::Windows::System::VirtualKey key) noexcept {
+ return (
+ key == winrt::Windows::System::VirtualKey::I &&
+ ::Microsoft::ReactNative::IsModifiedKeyPressed(
+ winrt::CoreWindow::GetForCurrentThread(), winrt::Windows::System::VirtualKey::Shift) &&
+ ::Microsoft::ReactNative::IsModifiedKeyPressed(
+ winrt::CoreWindow::GetForCurrentThread(), winrt::Windows::System::VirtualKey::Control));
+}
+
+void ReactRootView::SetupDevToolsShortcut() noexcept {
+ if (auto xamlRoot = XamlRoot()) {
+ if (std::find(m_subscribedDebuggerRoots.begin(), m_subscribedDebuggerRoots.end(), xamlRoot) ==
+ m_subscribedDebuggerRoots.end()) {
+ if (auto rootContent = xamlRoot.Content()) {
+ m_subscribedDebuggerRoots.push_back(xamlRoot);
+ rootContent.KeyDown(
+ [weakThis = this->get_weak()](const auto & /*sender*/, const xaml::Input::KeyRoutedEventArgs &args) {
+ if (const auto strongThis = weakThis.get()) {
+ if (IsCtrlShiftI(args.Key())) {
+ ::Microsoft::ReactNative::GetSharedDevManager()->OpenDevTools(
+ winrt::to_string(strongThis->m_reactNativeHost.InstanceSettings().BundleAppId()));
+ }
+ };
+ });
+ }
+ }
+ }
+}
+
} // namespace winrt::Microsoft::ReactNative::implementation
diff --git a/vnext/Microsoft.ReactNative/ReactRootView.h b/vnext/Microsoft.ReactNative/ReactRootView.h
index f35a3c3fd60..876ac7e38cb 100644
--- a/vnext/Microsoft.ReactNative/ReactRootView.h
+++ b/vnext/Microsoft.ReactNative/ReactRootView.h
@@ -72,6 +72,7 @@ struct ReactRootView : ReactRootViewT, ::Microsoft::ReactNative::
bool m_isPerspectiveEnabled{true};
bool m_isInitialized{false};
bool m_isJSViewAttached{false};
+ bool m_isDebuggerPausedOverlayOpen{false};
Mso::DispatchQueue m_uiQueue;
int64_t m_rootTag{-1};
std::unique_ptr m_reactOptions;
@@ -84,9 +85,11 @@ struct ReactRootView : ReactRootViewT, ::Microsoft::ReactNative::
std::shared_ptr<::Microsoft::ReactNative::PreviewKeyboardEventHandlerOnRoot> m_previewKeyboardEventHandlerOnRoot;
xaml::Controls::ContentControl m_focusSafeHarbor{nullptr};
xaml::Controls::ContentControl::LosingFocus_revoker m_focusSafeHarborLosingFocusRevoker{};
+ xaml::Controls::Flyout m_debuggerPausedFlyout{nullptr};
winrt::Grid m_greenBoxGrid{nullptr};
winrt::TextBlock m_waitingTextBlock{nullptr};
winrt::SystemNavigationManager::BackRequested_revoker m_backRequestedRevoker{};
+ std::vector m_subscribedDebuggerRoots{};
// Visual tree to support safe harbor
// this
@@ -102,6 +105,8 @@ struct ReactRootView : ReactRootViewT, ::Microsoft::ReactNative::
void UpdateRootViewInternal() noexcept;
void ClearLoadingUI() noexcept;
void EnsureLoadingUI() noexcept;
+ void HideDebuggerPausedOverlay() noexcept;
+ void ShowDebuggerPausedOverlay(const std::string &message, const std::function &onResume) noexcept;
void ShowInstanceLoaded() noexcept;
void ShowInstanceError() noexcept;
void ShowInstanceWaiting() noexcept;
@@ -112,6 +117,7 @@ struct ReactRootView : ReactRootViewT, ::Microsoft::ReactNative::
bool OnBackRequested() noexcept;
Mso::React::IReactViewHost *ReactViewHost() noexcept;
void ReactViewHost(Mso::React::IReactViewHost *viewHost) noexcept;
+ void SetupDevToolsShortcut() noexcept;
};
} // namespace winrt::Microsoft::ReactNative::implementation
diff --git a/vnext/Microsoft.ReactNative/Views/DevMenu.cpp b/vnext/Microsoft.ReactNative/Views/DevMenu.cpp
index 2d59627e885..38d1f17fcbd 100644
--- a/vnext/Microsoft.ReactNative/Views/DevMenu.cpp
+++ b/vnext/Microsoft.ReactNative/Views/DevMenu.cpp
@@ -6,7 +6,7 @@
#include "DevMenu.h"
#include
-#include "HermesSamplingProfiler.h"
+#include "Hermes/HermesSamplingProfiler.h"
#include "IReactDispatcher.h"
#include "Modules/DevSettingsModule.h"
diff --git a/vnext/Microsoft.ReactNative/packages.chakra.lock.json b/vnext/Microsoft.ReactNative/packages.chakra.lock.json
index 458e48719d6..0602b9ec3c3 100644
--- a/vnext/Microsoft.ReactNative/packages.chakra.lock.json
+++ b/vnext/Microsoft.ReactNative/packages.chakra.lock.json
@@ -10,9 +10,9 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Direct",
- "requested": "[0.0.0-2507.21007-eda7aef6, )",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "requested": "[0.0.0-2511.7001-d7ca19b3, )",
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.GitHub": {
"type": "Direct",
diff --git a/vnext/Microsoft.ReactNative/packages.experimentalwinui3.lock.json b/vnext/Microsoft.ReactNative/packages.experimentalwinui3.lock.json
index 458e48719d6..0602b9ec3c3 100644
--- a/vnext/Microsoft.ReactNative/packages.experimentalwinui3.lock.json
+++ b/vnext/Microsoft.ReactNative/packages.experimentalwinui3.lock.json
@@ -10,9 +10,9 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Direct",
- "requested": "[0.0.0-2507.21007-eda7aef6, )",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "requested": "[0.0.0-2511.7001-d7ca19b3, )",
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.GitHub": {
"type": "Direct",
diff --git a/vnext/Microsoft.ReactNative/packages.lock.json b/vnext/Microsoft.ReactNative/packages.lock.json
index 458e48719d6..0602b9ec3c3 100644
--- a/vnext/Microsoft.ReactNative/packages.lock.json
+++ b/vnext/Microsoft.ReactNative/packages.lock.json
@@ -10,9 +10,9 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Direct",
- "requested": "[0.0.0-2507.21007-eda7aef6, )",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "requested": "[0.0.0-2511.7001-d7ca19b3, )",
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.GitHub": {
"type": "Direct",
diff --git a/vnext/Microsoft.ReactNative/packages.newarch.experimentalwinui3.lock.json b/vnext/Microsoft.ReactNative/packages.newarch.experimentalwinui3.lock.json
index c6d2844942b..e8c5fb90325 100644
--- a/vnext/Microsoft.ReactNative/packages.newarch.experimentalwinui3.lock.json
+++ b/vnext/Microsoft.ReactNative/packages.newarch.experimentalwinui3.lock.json
@@ -10,9 +10,9 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Direct",
- "requested": "[0.0.0-2507.21007-eda7aef6, )",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "requested": "[0.0.0-2511.7001-d7ca19b3, )",
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.GitHub": {
"type": "Direct",
diff --git a/vnext/Microsoft.ReactNative/packages.newarch.lock.json b/vnext/Microsoft.ReactNative/packages.newarch.lock.json
index 82d6766e46b..6e383fda2c0 100644
--- a/vnext/Microsoft.ReactNative/packages.newarch.lock.json
+++ b/vnext/Microsoft.ReactNative/packages.newarch.lock.json
@@ -10,9 +10,9 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Direct",
- "requested": "[0.0.0-2507.21007-eda7aef6, )",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "requested": "[0.0.0-2511.7001-d7ca19b3, )",
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.GitHub": {
"type": "Direct",
diff --git a/vnext/PropertySheets/JSEngine.props b/vnext/PropertySheets/JSEngine.props
index 1740a641318..a7fe1f085fa 100644
--- a/vnext/PropertySheets/JSEngine.props
+++ b/vnext/PropertySheets/JSEngine.props
@@ -6,7 +6,7 @@
true
- 0.0.0-2507.21007-eda7aef6
+ 0.0.0-2511.7001-d7ca19b3
$(PkgMicrosoft_JavaScript_Hermes)
$(NuGetPackageRoot)\Microsoft.JavaScript.Hermes\$(HermesVersion)
false
diff --git a/vnext/PropertySheets/React.Cpp.props b/vnext/PropertySheets/React.Cpp.props
index c7979cdaa5e..a726cec3201 100644
--- a/vnext/PropertySheets/React.Cpp.props
+++ b/vnext/PropertySheets/React.Cpp.props
@@ -61,7 +61,7 @@
- USE_HERMES;%(PreprocessorDefinitions)
+ USE_HERMES;REACT_NATIVE_DEBUGGER_ENABLED;%(PreprocessorDefinitions)
ENABLE_DEVSERVER_HBCBUNDLES;%(PreprocessorDefinitions)
USE_V8;%(PreprocessorDefinitions)
USE_FABRIC;%(PreprocessorDefinitions)
diff --git a/vnext/ReactCommon.UnitTests/packages.experimentalwinui3.lock.json b/vnext/ReactCommon.UnitTests/packages.experimentalwinui3.lock.json
index b08e74a86a3..b2ac6286fe2 100644
--- a/vnext/ReactCommon.UnitTests/packages.experimentalwinui3.lock.json
+++ b/vnext/ReactCommon.UnitTests/packages.experimentalwinui3.lock.json
@@ -27,8 +27,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -91,7 +91,7 @@
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
"FollyWin32": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.Web.WebView2": "[1.0.2903.40, )",
"Microsoft.WindowsAppSDK": "[1.7.250127003-experimental3, )",
diff --git a/vnext/ReactCommon.UnitTests/packages.lock.json b/vnext/ReactCommon.UnitTests/packages.lock.json
index 512dd4eae57..00a55c89947 100644
--- a/vnext/ReactCommon.UnitTests/packages.lock.json
+++ b/vnext/ReactCommon.UnitTests/packages.lock.json
@@ -27,8 +27,8 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Transitive",
- "resolved": "0.0.0-2507.21007-eda7aef6",
- "contentHash": "3oyJXoPaayrtWSjBgnLFfVBrNcnvB3EJ1r2/K0yz9exmmESTTzWaCh8JlhX7fsjtMv/LpQxJOctHP0Ng2k8spQ=="
+ "resolved": "0.0.0-2511.7001-d7ca19b3",
+ "contentHash": "/EGy/gbTWpFZPZ4Z81QxbGQxpZhqiOE3qrnSokZRgXAyHivl15s7zZkRLOy9daDmVyEfanq7YBCOMi0ha58uQA=="
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
@@ -91,7 +91,7 @@
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
"FollyWin32": "[1.0.0, )",
- "Microsoft.JavaScript.Hermes": "[0.0.0-2507.21007-eda7aef6, )",
+ "Microsoft.JavaScript.Hermes": "[0.0.0-2511.7001-d7ca19b3, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.Web.WebView2": "[1.0.2903.40, )",
"Microsoft.WindowsAppSDK": "[1.7.250401001, )",
diff --git a/vnext/ReactCommon/ReactCommon.vcxproj b/vnext/ReactCommon/ReactCommon.vcxproj
index 325183e80ac..531312bf623 100644
--- a/vnext/ReactCommon/ReactCommon.vcxproj
+++ b/vnext/ReactCommon/ReactCommon.vcxproj
@@ -114,6 +114,13 @@
+
+
+
+
+
+
+
@@ -145,6 +152,14 @@
+
+
+
+
+
+
+
+
@@ -185,6 +200,8 @@
+
+
Create
diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp
index 909a20eec1f..f11bcb3cd4c 100644
--- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp
+++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp
@@ -343,7 +343,7 @@ NativeToJsBridge::getDecoratedNativeMethodCallInvoker(
jsinspector_modern::RuntimeTargetDelegate&
NativeToJsBridge::getInspectorTargetDelegate() {
- return m_executor->getRuntimeTargetDelegate();
+ return m_executor->getRuntimeTargetDelegate();
}
} // namespace facebook::react
diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jserrorhandler/JsErrorHandler.cpp b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jserrorhandler/JsErrorHandler.cpp
deleted file mode 100644
index fc5ff6cfabc..00000000000
--- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jserrorhandler/JsErrorHandler.cpp
+++ /dev/null
@@ -1,429 +0,0 @@
-/*
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-#include "JsErrorHandler.h"
-#include
-#include
-#include
-#include
-#include
-#include "StackTraceParser.h"
-
-using namespace facebook;
-
-namespace {
-std::string quote(const std::string& view) {
- return "\"" + view + "\"";
-}
-
-int nextExceptionId() {
- static int exceptionId = 0;
- return exceptionId++;
-}
-
-bool isLooselyNull(const jsi::Value& value) {
- return value.isNull() || value.isUndefined();
-}
-
-bool isEqualTo(
- jsi::Runtime& runtime,
- const jsi::Value& value,
- const std::string& str) {
- return jsi::Value::strictEquals(
- runtime, value, jsi::String::createFromUtf8(runtime, str));
-}
-
-std::string stringifyToCpp(jsi::Runtime& runtime, const jsi::Value& value) {
- return value.toString(runtime).utf8(runtime);
-}
-
-bool isTruthy(jsi::Runtime& runtime, const jsi::Value& value) {
- auto Boolean = runtime.global().getPropertyAsFunction(runtime, "Boolean");
- return Boolean.call(runtime, value).getBool();
-}
-
-void objectAssign(
- jsi::Runtime& runtime,
- jsi::Object& target,
- const jsi::Object& value) {
- auto Object = runtime.global().getPropertyAsObject(runtime, "Object");
- auto assign = Object.getPropertyAsFunction(runtime, "assign");
- assign.callWithThis(runtime, Object, target, value);
-}
-
-jsi::Object wrapInErrorIfNecessary(
- jsi::Runtime& runtime,
- const jsi::Value& value) {
- auto Error = runtime.global().getPropertyAsFunction(runtime, "Error");
- auto isError =
- value.isObject() && value.asObject(runtime).instanceOf(runtime, Error);
- auto error = isError
- ? value.getObject(runtime)
- : Error.callAsConstructor(runtime, value).getObject(runtime);
- return error;
-}
-
-class SetFalseOnDestruct {
- std::shared_ptr _value;
-
- public:
- SetFalseOnDestruct(const SetFalseOnDestruct&) = delete;
- SetFalseOnDestruct& operator=(const SetFalseOnDestruct&) = delete;
- SetFalseOnDestruct(SetFalseOnDestruct&&) = delete;
- SetFalseOnDestruct& operator=(SetFalseOnDestruct&&) = delete;
- explicit SetFalseOnDestruct(std::shared_ptr value)
- : _value(std::move(value)) {}
- ~SetFalseOnDestruct() {
- *_value = false;
- }
-};
-
-void logErrorWhileReporting(
- std::string message,
- jsi::JSError& error,
- jsi::JSError& originalError) {
- LOG(ERROR) << "JsErrorHandler::" << message << std::endl
- << "Js error message: " << error.getMessage() << std::endl
- << "Original js error message: " << originalError.getMessage()
- << std::endl;
-}
-
-jsi::Value getBundleMetadata(jsi::Runtime& runtime, jsi::JSError& error) {
- auto jsGetBundleMetadataValue =
- runtime.global().getProperty(runtime, "__getBundleMetadata");
-
- if (!jsGetBundleMetadataValue.isObject() ||
- !jsGetBundleMetadataValue.asObject(runtime).isFunction(runtime)) {
- return jsi::Value::null();
- }
-
- auto jsGetBundleMetadataValueFn =
- jsGetBundleMetadataValue.asObject(runtime).asFunction(runtime);
-
- try {
- auto bundleMetadataValue = jsGetBundleMetadataValueFn.call(runtime);
- if (bundleMetadataValue.isObject()) {
- return bundleMetadataValue;
- }
- return bundleMetadataValue;
- } catch (jsi::JSError& ex) {
- logErrorWhileReporting(
- "getBundleMetadata(): Error raised while calling __getBundleMetadata(). Returning null.",
- ex,
- error);
- }
-
- return jsi::Value::null();
-}
-} // namespace
-
-namespace facebook::react {
-
-template <>
-struct Bridging {
- static jsi::Value toJs(
- jsi::Runtime& runtime,
- const JsErrorHandler::ProcessedError::StackFrame& frame) {
- auto stackFrame = jsi::Object(runtime);
- auto file = bridging::toJs(runtime, frame.file, nullptr);
- auto lineNumber = bridging::toJs(runtime, frame.lineNumber, nullptr);
- auto column = bridging::toJs(runtime, frame.column, nullptr);
-
- stackFrame.setProperty(runtime, "file", file);
- stackFrame.setProperty(runtime, "methodName", frame.methodName);
- stackFrame.setProperty(runtime, "lineNumber", lineNumber);
- stackFrame.setProperty(runtime, "column", column);
- return stackFrame;
- }
-};
-
-template <>
-struct Bridging {
- static jsi::Value toJs(
- jsi::Runtime& runtime,
- const JsErrorHandler::ProcessedError& error) {
- auto data = jsi::Object(runtime);
- data.setProperty(runtime, "message", error.message);
- data.setProperty(
- runtime,
- "originalMessage",
- bridging::toJs(runtime, error.originalMessage, nullptr));
- data.setProperty(
- runtime, "name", bridging::toJs(runtime, error.name, nullptr));
- data.setProperty(
- runtime,
- "componentStack",
- bridging::toJs(runtime, error.componentStack, nullptr));
-
- auto stack = jsi::Array(runtime, error.stack.size());
- for (size_t i = 0; i < error.stack.size(); i++) {
- auto& frame = error.stack[i];
- stack.setValueAtIndex(runtime, i, bridging::toJs(runtime, frame));
- }
-
- data.setProperty(runtime, "stack", stack);
- data.setProperty(runtime, "id", error.id);
- data.setProperty(runtime, "isFatal", error.isFatal);
- data.setProperty(runtime, "extraData", error.extraData);
- return data;
- }
-};
-
-std::ostream& operator<<(
- std::ostream& os,
- const JsErrorHandler::ProcessedError::StackFrame& frame) {
- auto file = frame.file ? quote(*frame.file) : "nil";
- auto methodName = quote(frame.methodName);
- auto lineNumber =
- frame.lineNumber ? std::to_string(*frame.lineNumber) : "nil";
- auto column = frame.column ? std::to_string(*frame.column) : "nil";
-
- os << "StackFrame { .file = " << file << ", .methodName = " << methodName
- << ", .lineNumber = " << lineNumber << ", .column = " << column << " }";
- return os;
-}
-std::ostream& operator<<(
- std::ostream& os,
- const JsErrorHandler::ProcessedError& error) {
- auto message = quote(error.message);
- auto originalMessage =
- error.originalMessage ? quote(*error.originalMessage) : "nil";
- auto name = error.name ? quote(*error.name) : "nil";
- auto componentStack =
- error.componentStack ? quote(*error.componentStack) : "nil";
- auto id = std::to_string(error.id);
- auto isFatal = std::to_string(static_cast(error.isFatal));
- auto extraData = "jsi::Object{ } ";
-
- os << "ProcessedError {\n"
- << " .message = " << message << "\n"
- << " .originalMessage = " << originalMessage << "\n"
- << " .name = " << name << "\n"
- << " .componentStack = " << componentStack << "\n"
- << " .stack = [\n";
-
- for (const auto& frame : error.stack) {
- os << " " << frame << ", \n";
- }
- os << " ]\n"
- << " .id = " << id << "\n"
- << " .isFatal " << isFatal << "\n"
- << " .extraData = " << extraData << "\n"
- << "}";
- return os;
-}
-
-JsErrorHandler::JsErrorHandler(JsErrorHandler::OnJsError onJsError)
- : _onJsError(std::move(onJsError)),
- _inErrorHandler(std::make_shared(false)){
-
- };
-
-JsErrorHandler::~JsErrorHandler() {}
-
-void JsErrorHandler::handleError(
- jsi::Runtime& runtime,
- jsi::JSError& error,
- bool isFatal,
- bool logToConsole) {
- // TODO: Current error parsing works and is stable. Can investigate using
- // REGEX_HERMES to get additional Hermes data, though it requires JS setup
-
- if (!ReactNativeFeatureFlags::useAlwaysAvailableJSErrorHandling() &&
- _isRuntimeReady) {
- try {
- handleJSError(runtime, error, isFatal);
- return;
- } catch (jsi::JSError& ex) {
- logErrorWhileReporting(
- "handleError(): Error raised while reporting using js pipeline. Using c++ pipeline instead.",
- ex,
- error);
-
- // Re-try reporting using the c++ pipeline
- _hasHandledFatalError = false;
- }
- }
-
- handleErrorWithCppPipeline(runtime, error, isFatal, logToConsole);
-}
-
-void JsErrorHandler::handleErrorWithCppPipeline(
- jsi::Runtime& runtime,
- jsi::JSError& error,
- bool isFatal,
- bool logToConsole) {
- *_inErrorHandler = true;
- SetFalseOnDestruct temp{_inErrorHandler};
-
- auto message = error.getMessage();
- auto errorObj = wrapInErrorIfNecessary(runtime, error.value());
- auto componentStackValue = errorObj.getProperty(runtime, "componentStack");
- if (!isLooselyNull(componentStackValue)) {
- message += "\n" + stringifyToCpp(runtime, componentStackValue);
- }
-
- auto nameValue = errorObj.getProperty(runtime, "name");
- auto name = (isLooselyNull(nameValue) || isEqualTo(runtime, nameValue, ""))
- ? std::nullopt
- : std::optional(stringifyToCpp(runtime, nameValue));
-
- if (name && !message.starts_with(*name + ": ")) {
- message = *name + ": " + message;
- }
-
- auto jsEngineValue = errorObj.getProperty(runtime, "jsEngine");
-
- if (!isLooselyNull(jsEngineValue)) {
- message += ", js engine: " + stringifyToCpp(runtime, jsEngineValue);
- }
-
- auto extraDataKey = jsi::PropNameID::forUtf8(runtime, "RN$ErrorExtraDataKey");
- auto extraDataValue = errorObj.getProperty(runtime, extraDataKey);
-
- auto extraData = jsi::Object(runtime);
- if (extraDataValue.isObject()) {
- objectAssign(runtime, extraData, extraDataValue.asObject(runtime));
- }
-
- auto isDEV =
- isTruthy(runtime, runtime.global().getProperty(runtime, "__DEV__"));
-
- extraData.setProperty(runtime, "jsEngine", jsEngineValue);
- extraData.setProperty(runtime, "rawStack", error.getStack());
- extraData.setProperty(runtime, "__DEV__", isDEV);
- extraData.setProperty(
- runtime, "bundleMetadata", getBundleMetadata(runtime, error));
-
- auto cause = errorObj.getProperty(runtime, "cause");
- if (cause.isObject()) {
- auto causeObj = cause.asObject(runtime);
- // TODO: Consider just forwarding all properties. For now, just forward the
- // stack properties to maintain symmetry with js pipeline
- auto stackSymbols = causeObj.getProperty(runtime, "stackSymbols");
- extraData.setProperty(runtime, "stackSymbols", stackSymbols);
-
- auto stackReturnAddresses =
- causeObj.getProperty(runtime, "stackReturnAddresses");
- extraData.setProperty(
- runtime, "stackReturnAddresses", stackReturnAddresses);
-
- auto stackElements = causeObj.getProperty(runtime, "stackElements");
- extraData.setProperty(runtime, "stackElements", stackElements);
- }
-
- auto originalMessage = message == error.getMessage()
- ? std::nullopt
- : std::optional(error.getMessage());
-
- auto componentStack = !componentStackValue.isString()
- ? std::nullopt
- : std::optional(componentStackValue.asString(runtime).utf8(runtime));
-
- auto isHermes = runtime.global().hasProperty(runtime, "HermesInternal");
- auto stackFrames = StackTraceParser::parse(isHermes, error.getStack());
-
- auto id = nextExceptionId();
-
- ProcessedError processedError = {
- .message =
- _isRuntimeReady ? message : ("[runtime not ready]: " + message),
- .originalMessage = originalMessage,
- .name = name,
- .componentStack = componentStack,
- .stack = stackFrames,
- .id = id,
- .isFatal = isFatal,
- .extraData = std::move(extraData),
- };
-
- auto data = bridging::toJs(runtime, processedError).asObject(runtime);
-
- auto isComponentError =
- isTruthy(runtime, errorObj.getProperty(runtime, "isComponentError"));
- data.setProperty(runtime, "isComponentError", isComponentError);
-
- if (logToConsole && runtime.global().hasProperty(runtime, "console")) { // [Windows] Added hasProperty check
- auto console = runtime.global().getPropertyAsObject(runtime, "console");
- auto errorFn = console.getPropertyAsFunction(runtime, "error");
- auto finalMessage =
- jsi::String::createFromUtf8(runtime, processedError.message);
- errorFn.callWithThis(runtime, console, finalMessage);
- }
-
- std::shared_ptr shouldPreventDefault = std::make_shared(false);
- auto preventDefault = jsi::Function::createFromHostFunction(
- runtime,
- jsi::PropNameID::forAscii(runtime, "preventDefault"),
- 0,
- [shouldPreventDefault](
- jsi::Runtime& /*rt*/,
- const jsi::Value& /*thisVal*/,
- const jsi::Value* /*args*/,
- size_t /*count*/) {
- *shouldPreventDefault = true;
- return jsi::Value::undefined();
- });
-
- data.setProperty(runtime, "preventDefault", preventDefault);
-
- for (auto& errorListener : _errorListeners) {
- try {
- errorListener(runtime, jsi::Value(runtime, data));
- } catch (jsi::JSError& ex) {
- logErrorWhileReporting(
- "handleErrorWithCppPipeline(): Error raised inside an error listener. Executing next listener.",
- ex,
- error);
- }
- }
-
- if (*shouldPreventDefault) {
- return;
- }
-
- auto errorType = errorObj.getProperty(runtime, "type");
- auto isWarn = isEqualTo(runtime, errorType, "warn");
-
- if (isFatal || !isWarn) {
- if (isFatal) {
- if (_hasHandledFatalError) {
- return;
- }
- _hasHandledFatalError = true;
- }
-
- _onJsError(runtime, processedError);
- }
-}
-
-void JsErrorHandler::registerErrorListener(
- const std::function& errorListener) {
- _errorListeners.push_back(errorListener);
-}
-
-bool JsErrorHandler::hasHandledFatalError() {
- return _hasHandledFatalError;
-}
-
-void JsErrorHandler::setRuntimeReady() {
- _isRuntimeReady = true;
-}
-
-bool JsErrorHandler::isRuntimeReady() {
- return _isRuntimeReady;
-}
-
-void JsErrorHandler::notifyOfFatalError() {
- _hasHandledFatalError = true;
-}
-
-bool JsErrorHandler::inErrorHandler() {
- return *_inErrorHandler;
-}
-
-} // namespace facebook::react
diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp
index 744a44d7aee..927d7b9503b 100644
--- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp
+++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp
@@ -14,6 +14,7 @@
#include
#include
+#include
#include
#include
@@ -31,7 +32,7 @@ static constexpr std::array kTextMIMETypePrefixes{
"application/javascript" // Not in Chromium but emitted by Metro
};
-// namespace { [Windows #13587]
+namespace {
struct InitStreamResult {
uint32_t httpStatusCode;
@@ -45,6 +46,8 @@ using StreamInitCallback =
using IOReadCallback =
std::function)>;
+} // namespace [Windows #13587]
+
/**
* Private class owning state and implementing the listener for a particular
* request
@@ -291,8 +294,8 @@ bool NetworkIOAgent::handleRequest(
// @cdp Network.getResponseBody support is experimental.
if (req.method == "Network.getResponseBody") {
- // TODO(T218468200)
- return false;
+ handleGetResponseBody(req);
+ return true;
}
}
@@ -471,4 +474,54 @@ void NetworkIOAgent::handleIoClose(const cdp::PreparsedRequest& req) {
}
}
-} // namespace facebook::react::jsinspector_modern
+void NetworkIOAgent::handleGetResponseBody(const cdp::PreparsedRequest& req) {
+ long long requestId = req.id;
+ if (!req.params.isObject()) {
+ frontendChannel_(cdp::jsonError(
+ requestId,
+ cdp::ErrorCode::InvalidParams,
+ "Invalid params: not an object."));
+ return;
+ }
+ if ((req.params.count("requestId") == 0u) ||
+ !req.params.at("requestId").isString()) {
+ frontendChannel_(cdp::jsonError(
+ requestId,
+ cdp::ErrorCode::InvalidParams,
+ "Invalid params: requestId is missing or not a string."));
+ return;
+ }
+
+ auto& networkReporter = NetworkReporter::getInstance();
+
+ if (!networkReporter.isDebuggingEnabled()) {
+ frontendChannel_(cdp::jsonError(
+ requestId,
+ cdp::ErrorCode::InvalidRequest,
+ "Invalid request: The \"Network\" domain is not enabled."));
+ return;
+ }
+
+ auto storedResponse =
+ networkReporter.getResponseBody(req.params.at("requestId").asString());
+
+ if (!storedResponse) {
+ frontendChannel_(cdp::jsonError(
+ requestId,
+ cdp::ErrorCode::InternalError,
+ "Internal error: Could not retrieve response body for the given requestId."));
+ return;
+ }
+
+ std::string responseBody;
+ bool base64Encoded = false;
+ std::tie(responseBody, base64Encoded) = *storedResponse;
+
+ auto result = GetResponseBodyResult{
+ .body = responseBody,
+ .base64Encoded = base64Encoded,
+ };
+
+ frontendChannel_(cdp::jsonResult(requestId, result.toDynamic()));
+}
+} // namespace facebook::react::jsinspector_modern
\ No newline at end of file
diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h
index bfda911715e..756c4911f4b 100644
--- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h
+++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h
@@ -88,6 +88,17 @@ struct IOReadResult {
}
};
+struct GetResponseBodyResult {
+ std::string body;
+ bool base64Encoded;
+ folly::dynamic toDynamic() const {
+ folly::dynamic params = folly::dynamic::object;
+ params["body"] = body;
+ params["base64Encoded"] = base64Encoded;
+ return params;
+ }
+};
+
/**
* Passed to `loadNetworkResource`, provides callbacks for processing incoming
* data and other events.
@@ -259,6 +270,11 @@ class NetworkIOAgent {
* Reports CDP ok if the stream is found, or a CDP error if not.
*/
void handleIoClose(const cdp::PreparsedRequest& req);
+
+ /**
+ * Handle a Network.getResponseBody CDP request.
+ */
+ void handleGetResponseBody(const cdp::PreparsedRequest& req);
};
-} // namespace facebook::react::jsinspector_modern
+} // namespace facebook::react::jsinspector_modern
\ No newline at end of file
diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/network/HttpUtils.cpp b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/network/HttpUtils.cpp
new file mode 100644
index 00000000000..8c49b2b8bbf
--- /dev/null
+++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/network/HttpUtils.cpp
@@ -0,0 +1,175 @@
+/*
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+#include "HttpUtils.h"
+
+#include
+
+namespace facebook::react::jsinspector_modern {
+
+std::string httpReasonPhrase(uint16_t status) {
+ switch (status) {
+ case 100:
+ return "Continue";
+ case 101:
+ return "Switching Protocols";
+ case 102:
+ return "Processing";
+ case 103:
+ return "Early Hints";
+
+ case 200:
+ return "OK";
+ case 201:
+ return "Created";
+ case 202:
+ return "Accepted";
+ case 203:
+ return "Non-Authoritative Information";
+ case 204:
+ return "No Content";
+ case 205:
+ return "Reset Content";
+ case 206:
+ return "Partial Content";
+ case 207:
+ return "Multi-Status";
+ case 208:
+ return "Already Reported";
+ case 226:
+ return "IM Used";
+
+ case 300:
+ return "Multiple Choices";
+ case 301:
+ return "Moved Permanently";
+ case 302:
+ return "Found";
+ case 303:
+ return "See Other";
+ case 304:
+ return "Not Modified";
+ case 305:
+ return "Use Proxy";
+ case 307:
+ return "Temporary Redirect";
+ case 308:
+ return "Permanent Redirect";
+
+ case 400:
+ return "Bad Request";
+ case 401:
+ return "Unauthorized";
+ case 402:
+ return "Payment Required";
+ case 403:
+ return "Forbidden";
+ case 404:
+ return "Not Found";
+ case 405:
+ return "Method Not Allowed";
+ case 406:
+ return "Not Acceptable";
+ case 407:
+ return "Proxy Authentication Required";
+ case 408:
+ return "Request Timeout";
+ case 409:
+ return "Conflict";
+ case 410:
+ return "Gone";
+ case 411:
+ return "Length Required";
+ case 412:
+ return "Precondition Failed";
+ case 413:
+ return "Payload Too Large";
+ case 414:
+ return "URI Too Long";
+ case 415:
+ return "Unsupported Media Type";
+ case 416:
+ return "Range Not Satisfiable";
+ case 417:
+ return "Expectation Failed";
+ case 418:
+ return "I'm a teapot";
+ case 421:
+ return "Misdirected Request";
+ case 422:
+ return "Unprocessable Entity";
+ case 423:
+ return "Locked";
+ case 424:
+ return "Failed Dependency";
+ case 425:
+ return "Too Early";
+ case 426:
+ return "Upgrade Required";
+ case 428:
+ return "Precondition Required";
+ case 429:
+ return "Too Many Requests";
+ case 431:
+ return "Request Header Fields Too Large";
+ case 451:
+ return "Unavailable For Legal Reasons";
+
+ case 500:
+ return "Internal Server Error";
+ case 501:
+ return "Not Implemented";
+ case 502:
+ return "Bad Gateway";
+ case 503:
+ return "Service Unavailable";
+ case 504:
+ return "Gateway Time-out";
+ case 505:
+ return "HTTP Version Not Supported";
+ case 506:
+ return "Variant Also Negotiates";
+ case 507:
+ return "Insufficient Storage";
+ case 508:
+ return "Loop Detected";
+ case 510:
+ return "Not Extended";
+ case 511:
+ return "Network Authentication Required";
+ }
+
+ return "";
+}
+
+std::string mimeTypeFromHeaders(const Headers& headers) {
+ std::string mimeType = "application/octet-stream";
+
+ for (const auto& [name, value] : headers) {
+ std::string lowerName = name;
+ std::transform(
+ lowerName.begin(), lowerName.end(), lowerName.begin(), [](unsigned char c) { // [Windows #13587]
+ return static_cast(::tolower(c)); // [Windows #13587]
+ });
+ if (lowerName == "content-type") {
+ // Parse MIME type (discarding any parameters after ";") from the
+ // Content-Type header
+ // https://datatracker.ietf.org/doc/html/rfc7231#section-3.1.1.1
+ size_t pos = value.find(';');
+ if (pos != std::string::npos) {
+ mimeType = value.substr(0, pos);
+ } else {
+ mimeType = value;
+ }
+ break;
+ }
+ }
+
+ return mimeType;
+}
+
+} // namespace facebook::react::jsinspector_modern
diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsitooling/react/runtime/JSRuntimeFactory.cpp b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsitooling/react/runtime/JSRuntimeFactory.cpp
deleted file mode 100644
index c75d6d10787..00000000000
--- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsitooling/react/runtime/JSRuntimeFactory.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-#include "JSRuntimeFactory.h"
-#include
-#include
-
-namespace facebook::react {
-
-jsi::Runtime& JSIRuntimeHolder::getRuntime() noexcept {
- return *runtime_;
-}
-
-JSIRuntimeHolder::JSIRuntimeHolder(std::unique_ptr runtime)
- : runtime_(std::move(runtime)) {
- assert(runtime_ != nullptr);
-}
-
-void JSIRuntimeHolder::addConsoleMessage(jsi::Runtime& runtime, jsinspector_modern::ConsoleMessage message) {
- return;
-}
-
-bool JSIRuntimeHolder::supportsConsole() const{
- return false;
-}
-
-std::unique_ptr
-JSIRuntimeHolder::createAgentDelegate(
- jsinspector_modern::FrontendChannel frontendChannel,
- jsinspector_modern::SessionState& sessionState,
- std::unique_ptr,
- const jsinspector_modern::ExecutionContextDescription&
- executionContextDescription,
- RuntimeExecutor runtimeExecutor) {
- (void)executionContextDescription;
- (void)runtimeExecutor;
- return std::make_unique(
- std::move(frontendChannel), sessionState, runtime_->description());
-}
-
-} // namespace facebook::react
\ No newline at end of file
diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsitooling/react/runtime/JSRuntimeFactory.h b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsitooling/react/runtime/JSRuntimeFactory.h
deleted file mode 100644
index 4f87670497c..00000000000
--- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/jsitooling/react/runtime/JSRuntimeFactory.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-#pragma once
-
-#ifdef __cplusplus
-
-#include
-#include
-#include
-#include
-#include
-
-
-namespace facebook::react {
-
-/**
- * An interface that represents an instance of a JS VM
- */
-class JSRuntime : public jsinspector_modern::RuntimeTargetDelegate {
- public:
- virtual jsi::Runtime& getRuntime() noexcept = 0;
-
- virtual ~JSRuntime() = default;
-
- /**
- * Get a reference to the \c RuntimeTargetDelegate owned (or implemented) by
- * this JSRuntime. This reference must remain valid for the duration of the
- * JSRuntime's lifetime.
- */
- // virtual jsinspector_modern::RuntimeTargetDelegate& getRuntimeTargetDelegate();
-
- /**
- * Run initialize work that must happen on the runtime's JS thread. Used for
- * initializing TLS and registering profiling.
- *
- * TODO T194671568 Move the runtime constructor to the JsThread
- */
- virtual void unstable_initializeOnJsThread() {}
-
- private:
- /**
- * Initialized by \c getRuntimeTargetDelegate if not overridden, and then
- * never changes.
- */
- std::optional
- runtimeTargetDelegate_;
-};
-
-/**
- * Interface for a class that creates instances of a JS VM
- */
-class JSRuntimeFactory {
- public:
- virtual std::unique_ptr createJSRuntime(
- std::shared_ptr msgQueueThread) noexcept = 0;
-
- virtual ~JSRuntimeFactory() = default;
-};
-
-/**
- * Utility class for creating a JSRuntime from a uniquely owned jsi::Runtime.
- */
-class JSIRuntimeHolder : public JSRuntime {
- public:
- jsi::Runtime& getRuntime() noexcept override;
- void addConsoleMessage(jsi::Runtime& runtime, jsinspector_modern::ConsoleMessage message) override;
- bool supportsConsole() const override;
-
- std::unique_ptr createAgentDelegate(
- jsinspector_modern::FrontendChannel frontendChannel,
- jsinspector_modern::SessionState& sessionState,
- std::unique_ptr
- previouslyExportedState,
- const jsinspector_modern::ExecutionContextDescription&
- executionContextDescription,
- RuntimeExecutor runtimeExecutor) override;
-
- explicit JSIRuntimeHolder(std::unique_ptr runtime);
-
- private:
- std::unique_ptr runtime_;
-};
-
-} // namespace facebook::react
-
-#endif // __cplusplus
diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h
index 1b77ef01631..20e0cf084b0 100644
--- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h
+++ b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h
@@ -49,7 +49,9 @@ class NativeDOM : public NativeDOMCxxSpec {
/* rightWidth: */ int,
/* bottomWidth: */ int,
/* leftWidth: */ int>
- getBorderWidth(jsi::Runtime& rt, std::shared_ptr shadowNode);
+ getBorderWidth(
+ jsi::Runtime& rt,
+ std::shared_ptr shadowNode);
std::tuple<
/* x: */ double,
@@ -66,15 +68,21 @@ class NativeDOM : public NativeDOMCxxSpec {
std::shared_ptr shadowNode);
std::tuple* scrollLeft: */ double, /* scrollTop: */ double>
- getScrollPosition(jsi::Runtime& rt, std::shared_ptr shadowNode);
+ getScrollPosition(
+ jsi::Runtime& rt,
+ std::shared_ptr shadowNode);
std::tuple* scrollWidth: */ int, /* scrollHeight */ int> getScrollSize(
jsi::Runtime& rt,
std::shared_ptr shadowNode);
- std::string getTagName(jsi::Runtime& rt, std::shared_ptr shadowNode);
+ std::string getTagName(
+ jsi::Runtime& rt,
+ std::shared_ptr shadowNode);
- std::string getTextContent(jsi::Runtime& rt, std::shared_ptr shadowNode);
+ std::string getTextContent(
+ jsi::Runtime& rt,
+ std::shared_ptr shadowNode);
bool hasPointerCapture(
jsi::Runtime& rt,
diff --git a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp b/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp
deleted file mode 100644
index 3e6aab1552a..00000000000
--- a/vnext/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp
+++ /dev/null
@@ -1,671 +0,0 @@
-/*
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-#include "ReactInstance.h"
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-namespace facebook::react {
-
-namespace {
-
-std::shared_ptr createRuntimeScheduler(
- RuntimeExecutor runtimeExecutor,
- RuntimeSchedulerTaskErrorHandler taskErrorHandler) {
- std::shared_ptr scheduler =
- std::make_shared(
- runtimeExecutor, HighResTimeStamp::now, taskErrorHandler);
- scheduler->setPerformanceEntryReporter(
- // FIXME: Move creation of PerformanceEntryReporter to here and
- // guarantee that its lifetime is the same as the runtime.
- PerformanceEntryReporter::getInstance().get());
-
- return scheduler;
-}
-
-} // namespace
-
-ReactInstance::ReactInstance(
- std::unique_ptr runtime,
- std::shared_ptr jsMessageQueueThread,
- std::shared_ptr timerManager,
- JsErrorHandler::OnJsError onJsError,
- jsinspector_modern::HostTarget* parentInspectorTarget)
- : runtime_(std::move(runtime)),
- jsMessageQueueThread_(jsMessageQueueThread),
- timerManager_(std::move(timerManager)),
- jsErrorHandler_(std::make_shared(std::move(onJsError))),
- parentInspectorTarget_(parentInspectorTarget) {
- RuntimeExecutor runtimeExecutor =
- [weakRuntime = std::weak_ptr(runtime_),
- weakTimerManager = std::weak_ptr(timerManager_),
- weakJsThread = std::weak_ptr(jsMessageQueueThread_),
- jsErrorHandler = jsErrorHandler_](auto callback) {
- if (weakRuntime.expired()) {
- return;
- }
-
- if (auto jsThread = weakJsThread.lock()) {
- jsThread->runOnQueue([jsErrorHandler,
- weakRuntime,
- weakTimerManager,
- callback = std::move(callback)]() {
- auto runtime = weakRuntime.lock();
- if (!runtime) {
- return;
- }
-
- jsi::Runtime& jsiRuntime = runtime->getRuntime();
- TraceSection s("ReactInstance::_runtimeExecutor[Callback]");
- try {
- ShadowNode::setUseRuntimeShadowNodeReferenceUpdateOnThread(true);
- callback(jsiRuntime);
- } catch (jsi::JSError& originalError) {
- jsErrorHandler->handleError(jsiRuntime, originalError, true);
- } catch (std::exception& ex) {
- jsi::JSError error(
- jsiRuntime, std::string("Non-js exception: ") + ex.what());
- jsErrorHandler->handleError(jsiRuntime, error, true);
- }
- });
- }
- };
-
- if (parentInspectorTarget_) {
- auto executor = parentInspectorTarget_->executorFromThis();
-
- auto bufferedRuntimeExecutorThatWaitsForInspectorSetup =
- std::make_shared(runtimeExecutor);
- auto runtimeExecutorThatExecutesAfterInspectorSetup =
- [bufferedRuntimeExecutorThatWaitsForInspectorSetup](
- std::function&& callback) {
- bufferedRuntimeExecutorThatWaitsForInspectorSetup->execute(
- std::move(callback));
- };
-
- runtimeScheduler_ = createRuntimeScheduler(
- runtimeExecutorThatExecutesAfterInspectorSetup,
- [jsErrorHandler = jsErrorHandler_](
- jsi::Runtime& runtime, jsi::JSError& error) {
- jsErrorHandler->handleError(runtime, error, true);
- });
-
- auto runtimeExecutorThatGoesThroughRuntimeScheduler =
- [runtimeScheduler = runtimeScheduler_.get()](
- std::function&& callback) {
- runtimeScheduler->scheduleWork(std::move(callback));
- };
-
- // This code can execute from any thread, so we need to make sure we set up
- // the inspector logic in the right one. The callback executes immediately
- // if we are already in the right thread.
- executor([this,
- runtimeExecutorThatGoesThroughRuntimeScheduler,
- bufferedRuntimeExecutorThatWaitsForInspectorSetup](
- jsinspector_modern::HostTarget& hostTarget) {
- // Callbacks scheduled through the page target executor are generally
- // not guaranteed to run (e.g.: if the page target is destroyed)
- // but in this case it is because the page target cannot be destroyed
- // before the instance finishes its setup:
- // * On iOS it's because we do the setup synchronously.
- // * On Android it's because we explicitly wait for the instance
- // creation task to finish before starting the destruction.
- inspectorTarget_ = &hostTarget.registerInstance(*this);
- runtimeInspectorTarget_ =
- &inspectorTarget_->registerRuntime(*runtime_, runtimeExecutorThatGoesThroughRuntimeScheduler); // [Windows #13172]
- bufferedRuntimeExecutorThatWaitsForInspectorSetup->flush();
- });
- } else {
- runtimeScheduler_ = createRuntimeScheduler(
- runtimeExecutor,
- [jsErrorHandler = jsErrorHandler_](
- jsi::Runtime& runtime, jsi::JSError& error) {
- jsErrorHandler->handleError(runtime, error, true);
- });
- }
-
- bufferedRuntimeExecutor_ = std::make_shared(
- [runtimeScheduler = runtimeScheduler_.get()](
- std::function&& callback) {
- runtimeScheduler->scheduleWork(std::move(callback));
- });
-}
-
-void ReactInstance::unregisterFromInspector() {
- if (inspectorTarget_) {
- assert(runtimeInspectorTarget_);
- inspectorTarget_->unregisterRuntime(*runtimeInspectorTarget_);
-
- assert(parentInspectorTarget_);
- parentInspectorTarget_->unregisterInstance(*inspectorTarget_);
-
- inspectorTarget_ = nullptr;
- }
-}
-
-RuntimeExecutor ReactInstance::getUnbufferedRuntimeExecutor() noexcept {
- return [runtimeScheduler = runtimeScheduler_.get()](
- std::function&& callback) {
- runtimeScheduler->scheduleWork(std::move(callback));
- };
-}
-
-// This BufferedRuntimeExecutor ensures that the main JS bundle finished
-// execution before any JS queued into it from C++ are executed. Use
-// getUnbufferedRuntimeExecutor() instead if you do not need the main JS bundle
-// to have finished. e.g. setting global variables into JS runtime.
-RuntimeExecutor ReactInstance::getBufferedRuntimeExecutor() noexcept {
- return [weakBufferedRuntimeExecutor_ =
- std::weak_ptr(bufferedRuntimeExecutor_)](
- std::function&& callback) {
- if (auto strongBufferedRuntimeExecutor_ =
- weakBufferedRuntimeExecutor_.lock()) {
- strongBufferedRuntimeExecutor_->execute(std::move(callback));
- }
- };
-}
-
-// TODO(T184010230): Should the RuntimeScheduler returned from this method be
-// buffered?
-std::shared_ptr