diff --git a/change/react-native-windows-2dec8121-9429-4301-8e69-be082ed11bc9.json b/change/react-native-windows-2dec8121-9429-4301-8e69-be082ed11bc9.json new file mode 100644 index 00000000000..4e1d56a7b6b --- /dev/null +++ b/change/react-native-windows-2dec8121-9429-4301-8e69-be082ed11bc9.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Turn off explicit hermes microtasks in paper", + "packageName": "react-native-windows", + "email": "30809111+acoates-ms@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp b/vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp index 9ba08175cd4..0cc7cf37c9d 100644 --- a/vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +++ b/vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp @@ -813,6 +813,7 @@ void ReactInstanceWin::InitializeWithBridge() noexcept { }; devSettings->useWebSocketTurboModule = getBoolProperty(nullptr, L"UseWebSocketTurboModule", false); + devSettings->hermesSetExplicitMicrotasks = false; std::vector cxxModules; auto nmp = std::make_shared(); diff --git a/vnext/Shared/DevSettings.h b/vnext/Shared/DevSettings.h index 02f7d7dfdb1..d8ebcebcd6c 100644 --- a/vnext/Shared/DevSettings.h +++ b/vnext/Shared/DevSettings.h @@ -116,6 +116,8 @@ struct DevSettings { // Enable concurrent mode by installing runtimeScheduler bool useRuntimeScheduler{false}; + bool hermesSetExplicitMicrotasks{true}; + // The HostTarget instance for Fusebox facebook::react::jsinspector_modern::HostTarget *inspectorHostTarget; }; diff --git a/vnext/Shared/HermesRuntimeHolder.cpp b/vnext/Shared/HermesRuntimeHolder.cpp index 8c0b45790f1..f5bd96596ff 100644 --- a/vnext/Shared/HermesRuntimeHolder.cpp +++ b/vnext/Shared/HermesRuntimeHolder.cpp @@ -271,8 +271,7 @@ void HermesRuntimeHolder::initRuntime() noexcept { CRASH_ON_ERROR(api.jsr_create_config(&config)); CRASH_ON_ERROR(api.hermes_config_enable_default_crash_handler(config, devSettings->enableDefaultCrashHandler)); CRASH_ON_ERROR(api.jsr_config_enable_inspector(config, devSettings->useDirectDebugger)); - CRASH_ON_ERROR(api.jsr_config_set_explicit_microtasks( - config, facebook::react::ReactNativeFeatureFlags::enableBridgelessArchitecture())); + CRASH_ON_ERROR(api.jsr_config_set_explicit_microtasks(config, devSettings->hermesSetExplicitMicrotasks)); if (m_jsQueue) { HermesTaskRunner::Create(config, m_jsQueue);