From 964fffef0c04ef83641f612f413334403862d15b Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Wed, 15 Apr 2020 05:17:49 -0700 Subject: [PATCH 1/4] Change files --- ...-2020-04-15-05-17-49-statusbarmanager.json | 8 +++ ...-2020-04-15-05-17-49-statusbarmanager.json | 8 +++ .../NativeStatusBarManagerAndroid.win32.js | 3 +- .../DesktopTestRunner.cpp | 25 --------- .../Microsoft.ReactNative.vcxproj | 2 - .../Microsoft.ReactNative.vcxproj.filters | 6 --- .../ReactHost/ReactInstanceWin.cpp | 3 +- .../ReactHost/ReactInstanceWin.h | 2 +- vnext/ReactUWP/Base/CoreNativeModules.cpp | 20 +++---- vnext/ReactUWP/Base/CoreNativeModules.h | 13 +++-- vnext/ReactUWP/Modules/AppThemeModuleUwp.cpp | 27 ++++++---- vnext/ReactUWP/Modules/AppThemeModuleUwp.h | 38 +++++++++---- vnext/ReactUWP/Modules/StatusBarModule.cpp | 31 ----------- vnext/ReactUWP/Modules/StatusBarModule.h | 25 --------- vnext/ReactUWP/ReactUWP.vcxproj | 2 - vnext/ReactUWP/ReactUWP.vcxproj.filters | 6 --- .../Modules/AppThemeModule.cpp | 47 ---------------- .../ReactWindowsCore/Modules/AppThemeModule.h | 44 --------------- .../Modules/StatusBarManagerModule.cpp | 26 +++++++++ .../Modules/StatusBarManagerModule.h | 18 +++++++ .../ReactWindowsCore/ReactWindowsCore.vcxproj | 4 +- .../ReactWindowsCore.vcxproj.filters | 53 +++++++++++-------- vnext/Shared/OInstance.cpp | 7 +++ 23 files changed, 164 insertions(+), 254 deletions(-) create mode 100644 change/@office-iss-react-native-win32-2020-04-15-05-17-49-statusbarmanager.json create mode 100644 change/react-native-windows-2020-04-15-05-17-49-statusbarmanager.json delete mode 100644 vnext/ReactUWP/Modules/StatusBarModule.cpp delete mode 100644 vnext/ReactUWP/Modules/StatusBarModule.h delete mode 100644 vnext/ReactWindowsCore/Modules/AppThemeModule.cpp delete mode 100644 vnext/ReactWindowsCore/Modules/AppThemeModule.h create mode 100644 vnext/ReactWindowsCore/Modules/StatusBarManagerModule.cpp create mode 100644 vnext/ReactWindowsCore/Modules/StatusBarManagerModule.h diff --git a/change/@office-iss-react-native-win32-2020-04-15-05-17-49-statusbarmanager.json b/change/@office-iss-react-native-win32-2020-04-15-05-17-49-statusbarmanager.json new file mode 100644 index 00000000000..12f05680cb6 --- /dev/null +++ b/change/@office-iss-react-native-win32-2020-04-15-05-17-49-statusbarmanager.json @@ -0,0 +1,8 @@ +{ + "type": "prerelease", + "comment": "Implelent Shared StatusBarManagerModule and Do Module Cleanup", + "packageName": "@office-iss/react-native-win32", + "email": "ngerlem@microsoft.com", + "dependentChangeType": "patch", + "date": "2020-04-15T12:17:45.965Z" +} \ No newline at end of file diff --git a/change/react-native-windows-2020-04-15-05-17-49-statusbarmanager.json b/change/react-native-windows-2020-04-15-05-17-49-statusbarmanager.json new file mode 100644 index 00000000000..b480b1da114 --- /dev/null +++ b/change/react-native-windows-2020-04-15-05-17-49-statusbarmanager.json @@ -0,0 +1,8 @@ +{ + "type": "prerelease", + "comment": "Implelent Shared StatusBarManagerModule and Do Module Cleanup", + "packageName": "react-native-windows", + "email": "ngerlem@microsoft.com", + "dependentChangeType": "patch", + "date": "2020-04-15T12:17:49.517Z" +} \ No newline at end of file diff --git a/packages/react-native-win32/src/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid.win32.js b/packages/react-native-win32/src/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid.win32.js index 62400bd0df7..d6c5ae97b06 100644 --- a/packages/react-native-win32/src/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid.win32.js +++ b/packages/react-native-win32/src/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid.win32.js @@ -36,7 +36,8 @@ export interface Spec extends TurboModule { +setHidden: (hidden: boolean) => void; } -// [Win32 Change from getEnforcing to get and provide a stub (See #4363) +// [Win32 Change from getEnforcing to get and provide a stub (See #4363). This +// can be removed once devmain integrates with 0.62 native bits. let NativeStausBarManager = TurboModuleRegistry.get('StatusBarManager'); if (!NativeStausBarManager) { NativeStausBarManager = { diff --git a/vnext/Desktop.IntegrationTests/DesktopTestRunner.cpp b/vnext/Desktop.IntegrationTests/DesktopTestRunner.cpp index 165942c7f99..ed8a1f11282 100644 --- a/vnext/Desktop.IntegrationTests/DesktopTestRunner.cpp +++ b/vnext/Desktop.IntegrationTests/DesktopTestRunner.cpp @@ -30,27 +30,6 @@ using std::vector; namespace Microsoft::React::Test { -class StubNativeModule : public facebook::xplat::module::CxxModule { - public: - StubNativeModule(std::string name) : m_name(std::move(name)) {} - - std::string getName() override { - return m_name; - } - - std::map getConstants() override { - // CxxModules require a constant or method to register properly - return {{"Dummy", "Something"}}; - } - - std::vector getMethods() override { - return {}; - } - - private: - std::string m_name; -}; - shared_ptr TestRunner::GetInstance( string &&jsBundleFile, vector> &&cxxModules, @@ -94,10 +73,6 @@ shared_ptr TestRunner::GetInstance( make_tuple( TestDeviceInfoModule::name, []() -> unique_ptr { return make_unique(); }, - nativeQueue), - make_tuple( - "StatusBarManager", - []() -> unique_ptr { return make_unique("StatusBarManager"); }, nativeQueue)}; // <0> string diff --git a/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj b/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj index 359c92e5501..8ca892755b2 100644 --- a/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +++ b/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj @@ -215,7 +215,6 @@ - @@ -378,7 +377,6 @@ - diff --git a/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters b/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters index 4a536c8b629..3680c005866 100644 --- a/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters +++ b/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters @@ -116,9 +116,6 @@ Modules - - Modules - Modules @@ -434,9 +431,6 @@ Modules - - Modules - Modules diff --git a/vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp b/vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp index 6494964c877..2c754633028 100644 --- a/vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +++ b/vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp @@ -194,8 +194,7 @@ void ReactInstanceWin::Initialize() noexcept { m_uiManager.Load(), m_batchingUIThread, m_uiMessageThread.Load(), - m_deviceInfo, - devSettings, + std::move(m_deviceInfo), std::move(m_i18nInfo), std::move(m_appState), std::move(m_appTheme), diff --git a/vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h b/vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h index f198acf2a51..d8c08a2bff7 100644 --- a/vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +++ b/vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h @@ -153,7 +153,7 @@ class ReactInstanceWin final : public Mso::ActiveObject m_deviceInfo; std::shared_ptr m_appState; std::shared_ptr m_redboxHandler; - std::shared_ptr m_appTheme; + std::shared_ptr m_appTheme; std::pair m_i18nInfo{}; std::string m_bundleRootPath; }; diff --git a/vnext/ReactUWP/Base/CoreNativeModules.cpp b/vnext/ReactUWP/Base/CoreNativeModules.cpp index d07deda071f..90edeccc286 100644 --- a/vnext/ReactUWP/Base/CoreNativeModules.cpp +++ b/vnext/ReactUWP/Base/CoreNativeModules.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -49,21 +48,20 @@ bool HasPackageIdentity() noexcept { } // namespace std::vector GetCoreModules( - std::shared_ptr uiManager, + const std::shared_ptr &uiManager, const std::shared_ptr &messageQueue, const std::shared_ptr &uiMessageQueue, - std::shared_ptr deviceInfo, - std::shared_ptr devSettings, - const I18nModule::I18nInfo &&i18nInfo, - std::shared_ptr appstate, - std::shared_ptr appTheme, + std::shared_ptr &&deviceInfo, + I18nModule::I18nInfo &&i18nInfo, + std::shared_ptr &&appstate, + std::shared_ptr &&appTheme, const std::shared_ptr &uwpInstance) noexcept { // Modules std::vector modules; modules.emplace_back( "UIManager", - [uiManager = std::move(uiManager), uiMessageQueue]() { + [uiManager, uiMessageQueue]() { return facebook::react::createUIManagerModule(std::shared_ptr(uiManager), std::shared_ptr(uiMessageQueue)); }, messageQueue); @@ -103,9 +101,9 @@ std::vector GetCoreModules( MakeSerialQueueThread()); modules.emplace_back( - react::windows::AppThemeModule::name, + react::uwp::AppThemeModule::Name, [appTheme = std::move(appTheme)]() mutable { - return std::make_unique(std::move(appTheme)); + return std::make_unique(std::move(appTheme)); }, messageQueue); @@ -113,8 +111,6 @@ std::vector GetCoreModules( modules.emplace_back(ClipboardModule::name, []() { return std::make_unique(); }, messageQueue); - modules.emplace_back(StatusBarModule::name, []() { return std::make_unique(); }, messageQueue); - modules.emplace_back( NativeAnimatedModule::name, [wpUwpInstance = std::weak_ptr(uwpInstance)]() mutable { diff --git a/vnext/ReactUWP/Base/CoreNativeModules.h b/vnext/ReactUWP/Base/CoreNativeModules.h index 5853cb61b21..82b3bf83612 100644 --- a/vnext/ReactUWP/Base/CoreNativeModules.h +++ b/vnext/ReactUWP/Base/CoreNativeModules.h @@ -3,7 +3,7 @@ #pragma once -#include +#include #include #include #include @@ -23,14 +23,13 @@ struct IReactInstance; struct ViewManagerProvider; std::vector GetCoreModules( - std::shared_ptr uiManager, + const std::shared_ptr &uiManager, const std::shared_ptr &messageQueue, const std::shared_ptr &uiMessageQueue, - std::shared_ptr deviceInfo, - std::shared_ptr devSettings, - const I18nModule::I18nInfo &&i18nInfo, - std::shared_ptr appstate, - std::shared_ptr appTheme, + std::shared_ptr &&deviceInfo, + I18nModule::I18nInfo &&i18nInfo, + std::shared_ptr &&appstate, + std::shared_ptr &&appTheme, const std::shared_ptr &uwpInstance) noexcept; } // namespace react::uwp diff --git a/vnext/ReactUWP/Modules/AppThemeModuleUwp.cpp b/vnext/ReactUWP/Modules/AppThemeModuleUwp.cpp index 2bb66609fe9..95775bde17d 100644 --- a/vnext/ReactUWP/Modules/AppThemeModuleUwp.cpp +++ b/vnext/ReactUWP/Modules/AppThemeModuleUwp.cpp @@ -17,8 +17,7 @@ using namespace Windows::UI::Xaml; using namespace Windows::UI::ViewManagement; } // namespace winrt -namespace react { -namespace uwp { +namespace react::uwp { // // AppTheme @@ -27,7 +26,7 @@ namespace uwp { AppTheme::AppTheme( const std::shared_ptr &reactInstance, const std::shared_ptr &defaultQueueThread) - : react::windows::AppTheme(), m_wkReactInstance(reactInstance), m_queueThread(defaultQueueThread) { + : m_wkReactInstance(reactInstance), m_queueThread(defaultQueueThread) { m_currentTheme = winrt::Application::Current().RequestedTheme(); m_isHighContrast = m_accessibilitySettings.HighContrast(); m_highContrastColors = getHighContrastColors(); @@ -53,10 +52,8 @@ AppTheme::AppTheme( }); } -AppTheme::~AppTheme() = default; - -const std::string AppTheme::getCurrentTheme() { - return m_currentTheme == winrt::ApplicationTheme::Light ? AppTheme::light : AppTheme::dark; +std::string AppTheme::getCurrentTheme() { + return m_currentTheme == winrt::ApplicationTheme::Light ? AppTheme::Light : AppTheme::Dark; } bool AppTheme::getIsHighContrast() { @@ -94,5 +91,17 @@ void AppTheme::fireEvent(std::string const &eventName, folly::dynamic &&eventDat instance->CallJsFunction("RCTDeviceEventEmitter", "emit", folly::dynamic::array(eventName, std::move(eventData))); } } -} // namespace uwp -} // namespace react + +AppThemeModule::AppThemeModule(std::shared_ptr &&appTheme) : m_appTheme(std::move(appTheme)) {} + +auto AppThemeModule::getConstants() -> std::map { + return {{"initialAppTheme", folly::dynamic{m_appTheme->getCurrentTheme()}}, + {"initialHighContrast", folly::dynamic{m_appTheme->getIsHighContrast()}}, + {"initialHighContrastColors", folly::dynamic{m_appTheme->getHighContrastColors()}}}; +} + +auto AppThemeModule::getMethods() -> std::vector { + return {}; +} + +} // namespace react::uwp diff --git a/vnext/ReactUWP/Modules/AppThemeModuleUwp.h b/vnext/ReactUWP/Modules/AppThemeModuleUwp.h index 63c0df72de5..d8742ccd9cf 100644 --- a/vnext/ReactUWP/Modules/AppThemeModuleUwp.h +++ b/vnext/ReactUWP/Modules/AppThemeModuleUwp.h @@ -4,26 +4,26 @@ #pragma once #include -#include #include #include -namespace react { -namespace uwp { +namespace react::uwp { -class AppTheme : public react::windows::AppTheme { +class AppTheme { public: + static constexpr const char *Dark = "dark"; + static constexpr const char *Light = "light"; + AppTheme( const std::shared_ptr &reactInstance, const std::shared_ptr &defaultQueueThread); - virtual ~AppTheme(); - const std::string getCurrentTheme() override; - bool getIsHighContrast() override; + std::string getCurrentTheme(); + bool getIsHighContrast(); + folly::dynamic getHighContrastColors(); private: - // High Contrast Color helper methods - folly::dynamic getHighContrastColors(); + // High Contrast Color helper method std::string formatRGB(winrt::Windows::UI::Color ElementColor); void fireEvent(std::string const &eventName, folly::dynamic &&eventData); @@ -40,5 +40,21 @@ class AppTheme : public react::windows::AppTheme { winrt::Windows::UI::ViewManagement::UISettings::ColorValuesChanged_revoker m_colorValuesChangedRevoker{}; }; -} // namespace uwp -} // namespace react +class AppThemeModule : public facebook::xplat::module::CxxModule { + public: + static constexpr const char *Name = "RTCAppTheme"; + + AppThemeModule(std::shared_ptr &&appTheme); + + // CxxModule + std::string getName() override { + return Name; + }; + auto getConstants() -> std::map override; + auto getMethods() -> std::vector override; + + private: + std::shared_ptr m_appTheme; +}; + +} // namespace react::uwp diff --git a/vnext/ReactUWP/Modules/StatusBarModule.cpp b/vnext/ReactUWP/Modules/StatusBarModule.cpp deleted file mode 100644 index bd206875af0..00000000000 --- a/vnext/ReactUWP/Modules/StatusBarModule.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#include "pch.h" - -#include "StatusBarModule.h" - -namespace react { -namespace uwp { - -// -// StatusBarModule -// -const char *StatusBarModule::name = "StatusBarManager"; - -StatusBarModule::~StatusBarModule() = default; - -std::string StatusBarModule::getName() { - return name; -} - -std::map StatusBarModule::getConstants() { - return {{"HEIGHT", 0}}; -} - -std::vector StatusBarModule::getMethods() { - return {}; -} - -} // namespace uwp -} // namespace react diff --git a/vnext/ReactUWP/Modules/StatusBarModule.h b/vnext/ReactUWP/Modules/StatusBarModule.h deleted file mode 100644 index a5b93ad6f48..00000000000 --- a/vnext/ReactUWP/Modules/StatusBarModule.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#pragma once - -#include -#include - -namespace react { -namespace uwp { - -class StatusBarModule final : public facebook::xplat::module::CxxModule { - public: - virtual ~StatusBarModule(); - - // CxxModule - std::string getName() override; - std::map getConstants() override; - auto getMethods() -> std::vector override; - - static const char *name; -}; - -} // namespace uwp -} // namespace react diff --git a/vnext/ReactUWP/ReactUWP.vcxproj b/vnext/ReactUWP/ReactUWP.vcxproj index b0f95b487ef..8b152403c57 100644 --- a/vnext/ReactUWP/ReactUWP.vcxproj +++ b/vnext/ReactUWP/ReactUWP.vcxproj @@ -219,7 +219,6 @@ - @@ -319,7 +318,6 @@ - diff --git a/vnext/ReactUWP/ReactUWP.vcxproj.filters b/vnext/ReactUWP/ReactUWP.vcxproj.filters index fafc6cb4800..54de93d6430 100644 --- a/vnext/ReactUWP/ReactUWP.vcxproj.filters +++ b/vnext/ReactUWP/ReactUWP.vcxproj.filters @@ -142,9 +142,6 @@ Modules - - Modules - Modules @@ -519,9 +516,6 @@ Modules - - Modules - Modules diff --git a/vnext/ReactWindowsCore/Modules/AppThemeModule.cpp b/vnext/ReactWindowsCore/Modules/AppThemeModule.cpp deleted file mode 100644 index 97ec1b2681a..00000000000 --- a/vnext/ReactWindowsCore/Modules/AppThemeModule.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#pragma once - -#include "AppThemeModule.h" - -namespace react { -namespace windows { - -// -// AppTheme -// - -AppTheme::AppTheme() = default; -AppTheme::~AppTheme() = default; - -const std::string AppTheme::getCurrentTheme() { - return AppTheme::light; -} - -bool AppTheme::getIsHighContrast() { - return false; -} - -folly::dynamic AppTheme::getHighContrastColors() { - return {}; -} - -// -// AppThemeModule -// - -AppThemeModule::AppThemeModule(std::shared_ptr &&appTheme) : m_appTheme(std::move(appTheme)) {} - -auto AppThemeModule::getConstants() -> std::map { - return {{"initialAppTheme", folly::dynamic{m_appTheme->getCurrentTheme()}}, - {"initialHighContrast", folly::dynamic{m_appTheme->getIsHighContrast()}}, - {"initialHighContrastColors", folly::dynamic{m_appTheme->getHighContrastColors()}}}; -} - -auto AppThemeModule::getMethods() -> std::vector { - return {}; -} - -} // namespace windows -} // namespace react diff --git a/vnext/ReactWindowsCore/Modules/AppThemeModule.h b/vnext/ReactWindowsCore/Modules/AppThemeModule.h deleted file mode 100644 index 0ffa4e50812..00000000000 --- a/vnext/ReactWindowsCore/Modules/AppThemeModule.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#pragma once - -#include -#include -#include - -namespace react { -namespace windows { - -class AppTheme { - public: - static inline const std::string dark = "dark"; - static inline const std::string light = "light"; - - AppTheme(); - virtual ~AppTheme(); - - virtual const std::string getCurrentTheme(); - virtual bool getIsHighContrast(); - virtual folly::dynamic getHighContrastColors(); -}; - -class AppThemeModule : public facebook::xplat::module::CxxModule { - public: - static inline const std::string name = "RTCAppTheme"; - - AppThemeModule(std::shared_ptr &&appTheme); - - // CxxModule - std::string getName() override { - return name; - }; - auto getConstants() -> std::map override; - auto getMethods() -> std::vector override; - - private: - std::shared_ptr m_appTheme; -}; - -} // namespace windows -} // namespace react diff --git a/vnext/ReactWindowsCore/Modules/StatusBarManagerModule.cpp b/vnext/ReactWindowsCore/Modules/StatusBarManagerModule.cpp new file mode 100644 index 00000000000..0c15c8b3508 --- /dev/null +++ b/vnext/ReactWindowsCore/Modules/StatusBarManagerModule.cpp @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +#include "StatusBarManagerModule.h" +#include + +using Method = facebook::xplat::module::CxxModule::Method; + +namespace facebook::react { + +std::string StatusBarManagerModule::getName() { + return StatusBarManagerModule::Name; +} + +std::vector StatusBarManagerModule::getMethods() { + return { + Method("setStyle", [](folly::dynamic /*args*/) noexcept {}), + Method("setHidden", [](folly::dynamic /*args*/) noexcept {}), + }; +} + +std::map StatusBarManagerModule::getConstants() { + return {{"HEIGHT", 0}}; +} + +} // namespace facebook::react diff --git a/vnext/ReactWindowsCore/Modules/StatusBarManagerModule.h b/vnext/ReactWindowsCore/Modules/StatusBarManagerModule.h new file mode 100644 index 00000000000..605de7fbf9a --- /dev/null +++ b/vnext/ReactWindowsCore/Modules/StatusBarManagerModule.h @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#pragma once + +#include + +namespace facebook::react { + +class StatusBarManagerModule : public facebook::xplat::module::CxxModule { + public: + static constexpr const char *Name = "StatusBarManager"; + + std::string getName() override; + std::map getConstants() override; + std::vector getMethods() override; +}; + +} // namespace facebook::react diff --git a/vnext/ReactWindowsCore/ReactWindowsCore.vcxproj b/vnext/ReactWindowsCore/ReactWindowsCore.vcxproj index 91c2cd687f7..5ff0d84dbb7 100644 --- a/vnext/ReactWindowsCore/ReactWindowsCore.vcxproj +++ b/vnext/ReactWindowsCore/ReactWindowsCore.vcxproj @@ -147,12 +147,12 @@ - + @@ -184,13 +184,13 @@ - + Create diff --git a/vnext/ReactWindowsCore/ReactWindowsCore.vcxproj.filters b/vnext/ReactWindowsCore/ReactWindowsCore.vcxproj.filters index fd860c6c427..ad6ca83f025 100644 --- a/vnext/ReactWindowsCore/ReactWindowsCore.vcxproj.filters +++ b/vnext/ReactWindowsCore/ReactWindowsCore.vcxproj.filters @@ -28,8 +28,11 @@ {43770517-0df1-4cff-bd30-563b9d0f56e7} - - {4cc2fae5-bc38-4aff-aa49-33225485e2de} + + {eae44522-b665-4bd2-85f2-8ca26f4ce15f} + + + {8b1364fc-cc9f-4ca9-834b-894849d8b487} @@ -63,9 +66,6 @@ Source Files\Modules - - Source Files\Modules - Source Files\Modules @@ -96,9 +96,6 @@ Source Files - - tracing - Source Files @@ -108,15 +105,27 @@ Source Files - - Source Files - Source Files + + Source Files\Tracing + + + Source Files\Modules + + + Source Files + + + Source Files + + + Source Files + @@ -203,12 +212,6 @@ Header Files - - Header Files\Modules - - - Header Files\Modules - Header Files\Modules @@ -254,9 +257,6 @@ Header Files - - tracing - Header Files @@ -272,7 +272,18 @@ Header Files - + + Header Files\Tracing + + + Header Files\Modules + + + Header Files\Modules + + + Header Files + diff --git a/vnext/Shared/OInstance.cpp b/vnext/Shared/OInstance.cpp index 38738a67c6c..2da2a031bd1 100644 --- a/vnext/Shared/OInstance.cpp +++ b/vnext/Shared/OInstance.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #if (defined(_MSC_VER) && (defined(WINRT))) #include @@ -649,6 +650,12 @@ std::vector> InstanceImpl::GetDefaultNativeModules []() { return std::make_unique(); }, nativeQueue)); + modules.push_back(std::make_unique( + m_innerInstance, + StatusBarManagerModule::Name, + []() { return std::make_unique(); }, + nativeQueue)); + return modules; } From 427e99cf2e91ef90744e44d5a65416e1a500cf6d Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Wed, 15 Apr 2020 07:46:56 -0700 Subject: [PATCH 2/4] Fix build for ReactUwp/Win32 Playground --- vnext/ReactUWP/Base/UwpReactInstance.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vnext/ReactUWP/Base/UwpReactInstance.cpp b/vnext/ReactUWP/Base/UwpReactInstance.cpp index 1bb9d9c41b1..436449e495e 100644 --- a/vnext/ReactUWP/Base/UwpReactInstance.cpp +++ b/vnext/ReactUWP/Base/UwpReactInstance.cpp @@ -111,7 +111,7 @@ void UwpReactInstance::Start(const std::shared_ptr &spThis, cons // Objects that must be created on the UI thread auto deviceInfo(std::make_shared(spThis)); std::shared_ptr appstate = std::make_shared(spThis); - std::shared_ptr appTheme = + std::shared_ptr appTheme = std::make_shared(spThis, m_defaultNativeThread); std::pair i18nInfo = I18nModule::GetI18nInfo(); @@ -199,8 +199,7 @@ void UwpReactInstance::Start(const std::shared_ptr &spThis, cons m_uiManager, m_batchingNativeThread, m_defaultNativeThread, - deviceInfo, - devSettings, + std::move(deviceInfo), std::move(i18nInfo), std::move(appstate), std::move(appTheme), From 88558b3472cb3a1d9852ee63ac4e169b0129f4be Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Wed, 15 Apr 2020 07:49:37 -0700 Subject: [PATCH 3/4] Yarn format --- vnext/ReactWindowsCore/Modules/StatusBarManagerModule.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vnext/ReactWindowsCore/Modules/StatusBarManagerModule.cpp b/vnext/ReactWindowsCore/Modules/StatusBarManagerModule.cpp index 0c15c8b3508..05f199daff5 100644 --- a/vnext/ReactWindowsCore/Modules/StatusBarManagerModule.cpp +++ b/vnext/ReactWindowsCore/Modules/StatusBarManagerModule.cpp @@ -14,9 +14,9 @@ std::string StatusBarManagerModule::getName() { std::vector StatusBarManagerModule::getMethods() { return { - Method("setStyle", [](folly::dynamic /*args*/) noexcept {}), - Method("setHidden", [](folly::dynamic /*args*/) noexcept {}), - }; + Method("setStyle", [](folly::dynamic /*args*/) noexcept {}), + Method("setHidden", [](folly::dynamic /*args*/) noexcept {}), + }; } std::map StatusBarManagerModule::getConstants() { From 47dd965c72bfb0167d748c95394cc29e73bf0aa8 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 17 Apr 2020 08:07:54 -0700 Subject: [PATCH 4/4] Remove unneeded module --- vnext/ReactWindowsCore/Modules/StatusBarManagerModule.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/vnext/ReactWindowsCore/Modules/StatusBarManagerModule.cpp b/vnext/ReactWindowsCore/Modules/StatusBarManagerModule.cpp index 05f199daff5..8548b278bec 100644 --- a/vnext/ReactWindowsCore/Modules/StatusBarManagerModule.cpp +++ b/vnext/ReactWindowsCore/Modules/StatusBarManagerModule.cpp @@ -2,7 +2,6 @@ // Licensed under the MIT License. #include "StatusBarManagerModule.h" -#include using Method = facebook::xplat::module::CxxModule::Method;