Skip to content

Commit 3bd050b

Browse files
authored
Minor cleanup of recent RuntimeScheduler integration (#12410)
* Minor cleanup of recent RuntimeScheduler integration A copyright header here, a new line there, and a simplified lambda capture. This is a grab bag of things that were missed when integrating RuntimeScheduler. * Change files
1 parent b3802eb commit 3bd050b

File tree

5 files changed

+20
-13
lines changed

5 files changed

+20
-13
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Minor cleanup of recent RuntimeScheduler integration",
4+
"packageName": "react-native-windows",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -604,17 +604,12 @@ void ReactInstanceWin::Initialize() noexcept {
604604
// The InstanceCreated event can be used to augment the JS environment for all JS code. So it needs to be
605605
// triggered before any platform JS code is run. Using m_jsMessageThread instead of jsDispatchQueue avoids
606606
// waiting for the JSCaller which can delay the event until after certain JS code has already run
607-
m_jsMessageThread.Load()->runOnQueue([onCreated = m_options.OnInstanceCreated,
608-
reactContext = m_reactContext,
609-
jsiRuntimeHolder = std::move(jsiRuntimeHolder),
610-
instanceWrapper = m_instanceWrapper.Load(),
611-
instance = m_instance.Load(),
612-
turboModuleProvider = m_options.TurboModuleProvider,
613-
useWebDebugger = m_options.UseWebDebugger()]() noexcept {
614-
if (onCreated) {
615-
onCreated.Get()->Invoke(reactContext);
616-
}
617-
});
607+
m_jsMessageThread.Load()->runOnQueue(
608+
[onCreated = m_options.OnInstanceCreated, reactContext = m_reactContext]() noexcept {
609+
if (onCreated) {
610+
onCreated.Get()->Invoke(reactContext);
611+
}
612+
});
618613

619614
LoadJSBundles();
620615

vnext/Microsoft.ReactNative/SchedulerSettings.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include "pch.h"
55

66
#include <cxxreact/MessageQueueThread.h>
7-
#include <react/renderer/runtimescheduler/RuntimeScheduler.h>
87
#include "ReactPropertyBag.h"
98
#include "SchedulerSettings.h"
109

vnext/Microsoft.ReactNative/SynchronousEventBeat.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT License.
3+
14
#include "SynchronousEventBeat.h"
25

36
namespace Microsoft::ReactNative {

vnext/Microsoft.ReactNative/SynchronousEventBeat.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT License.
3+
14
#include <NativeModules.h>
25
#include <react/renderer/core/EventBeat.h>
36
#include <react/renderer/runtimescheduler/RuntimeScheduler.h>
@@ -23,4 +26,4 @@ class SynchronousEventBeat final : public facebook::react::EventBeat {
2326
std::shared_ptr<facebook::react::RuntimeScheduler> m_runtimeScheduler;
2427
};
2528

26-
} // namespace Microsoft::ReactNative
29+
} // namespace Microsoft::ReactNative

0 commit comments

Comments
 (0)