Skip to content

Commit 05a6715

Browse files
authored
Cleanup unneeded ReactCommon patching, and extra hostplatform overrides (#14697)
* Cleanup a bunch of unneeded ReactCommon patching, and extra hostplatform overrides * Change files * minor cleanup * Fix desktop build * Remove ReactInstance.h fork * fix * fix leak
1 parent a5ce430 commit 05a6715

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+176
-1072
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@
102102
"xtree": "cpp",
103103
"xutility": "cpp",
104104
"xstddef": "cpp",
105-
"cfenv": "cpp"
105+
"cfenv": "cpp",
106+
"cfloat": "cpp"
106107
},
107108
"search.exclude": {
108109
"**/dist/**/*.js": true,
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Cleanup a bunch of unneeded ReactCommon patching, and extra hostplatform overrides",
4+
"packageName": "react-native-windows",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

vnext/Common/Common.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
string literals. It prevents code like
7373
wchar_t* str = L"hello";
7474
from compiling. -->
75-
<AdditionalOptions>%(AdditionalOptions) /Zc:strictStrings /await</AdditionalOptions>
75+
<AdditionalOptions>%(AdditionalOptions) /Zc:strictStrings</AdditionalOptions>
7676
</ClCompile>
7777
<Link>
7878
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>

vnext/Desktop/React.Windows.Desktop.vcxproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,13 @@
127127
</PreprocessorDefinitions>
128128
<AdditionalIncludeDirectories>
129129
"$(ReactNativeWindowsDir)Microsoft.ReactNative";
130-
"$(ReactNativeWindowsDir)Microsoft.ReactNative\Fabric\platform";
131130
"$(ReactNativeWindowsDir)Microsoft.ReactNative\ReactHost";
132131
"$(ReactNativeWindowsDir)Microsoft.ReactNative\Views";
133132
"$(ReactNativeWindowsDir)codegen";
134133
"$(ReactNativeWindowsDir)codegen\react\components\rnwcore";
135-
$(ReactNativeDir)\ReactCommon\react\renderer\graphics\platform\cxx;
136134
%(AdditionalIncludeDirectories);
137135
</AdditionalIncludeDirectories>
138-
<AdditionalOptions>%(AdditionalOptions) /Zc:strictStrings /bigobj /await</AdditionalOptions>
136+
<AdditionalOptions>%(AdditionalOptions) /Zc:strictStrings /bigobj</AdditionalOptions>
139137
<PrecompiledHeader>Use</PrecompiledHeader>
140138
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
141139
<RuntimeTypeInfo Condition="'$(Configuration)'=='Debug' OR '$(UseFabric)' == 'true'">true</RuntimeTypeInfo>

vnext/Microsoft.ReactNative/Fabric/AbiShadowNode.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ void ShadowNode::EnsureUnsealed() noexcept {
3535
}
3636
}
3737

38-
winrt::IInspectable ShadowNode::Tag() const noexcept {
38+
winrt::Windows::Foundation::IInspectable ShadowNode::Tag() const noexcept {
3939
return m_tag;
4040
}
4141

42-
void ShadowNode::Tag(winrt::IInspectable tag) noexcept {
42+
void ShadowNode::Tag(winrt::Windows::Foundation::IInspectable tag) noexcept {
4343
m_tag = tag;
4444
}
4545

46-
winrt::IInspectable ShadowNode::StateData() const noexcept {
46+
winrt::Windows::Foundation::IInspectable ShadowNode::StateData() const noexcept {
4747
if (auto shadowNode = m_shadowNode.lock()) {
4848
auto state = shadowNode->getState();
4949
react_native_assert(state && "State must not be `nullptr`.");
@@ -55,7 +55,7 @@ winrt::IInspectable ShadowNode::StateData() const noexcept {
5555
return nullptr;
5656
}
5757

58-
void ShadowNode::StateData(winrt::IInspectable tag) noexcept {
58+
void ShadowNode::StateData(winrt::Windows::Foundation::IInspectable tag) noexcept {
5959
if (auto shadowNode = m_shadowNode.lock()) {
6060
shadowNode->ensureUnsealed();
6161

vnext/Microsoft.ReactNative/Fabric/AbiShadowNode.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ struct ShadowNode : ShadowNodeT<ShadowNode> {
3737
ShadowNode(facebook::react::ShadowNode::Shared shadowNode) noexcept;
3838

3939
void EnsureUnsealed() noexcept;
40-
winrt::IInspectable Tag() const noexcept;
41-
void Tag(winrt::IInspectable tag) noexcept;
40+
winrt::Windows::Foundation::IInspectable Tag() const noexcept;
41+
void Tag(winrt::Windows::Foundation::IInspectable tag) noexcept;
4242

43-
winrt::IInspectable StateData() const noexcept;
44-
void StateData(winrt::IInspectable tag) noexcept;
43+
winrt::Windows::Foundation::IInspectable StateData() const noexcept;
44+
void StateData(winrt::Windows::Foundation::IInspectable tag) noexcept;
4545

4646
winrt::Microsoft::ReactNative::EventEmitter EventEmitter() const noexcept;
4747

4848
protected:
4949
facebook::react::ShadowNode::Weak m_shadowNode;
50-
winrt::IInspectable m_tag;
50+
winrt::Windows::Foundation::IInspectable m_tag;
5151
};
5252

5353
} // namespace winrt::Microsoft::ReactNative::implementation

vnext/Microsoft.ReactNative/Fabric/ComponentView.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ struct ComponentView
103103
const noexcept;
104104
virtual void parent(const winrt::Microsoft::ReactNative::ComponentView &parent) noexcept;
105105
virtual winrt::Microsoft::ReactNative::ComponentView Parent() const noexcept;
106-
virtual winrt::IVectorView<winrt::Microsoft::ReactNative::ComponentView> Children() const noexcept;
106+
virtual winrt::Windows::Foundation::Collections::IVectorView<winrt::Microsoft::ReactNative::ComponentView> Children()
107+
const noexcept;
107108
virtual void theme(winrt::Microsoft::ReactNative::Composition::implementation::Theme *theme) noexcept;
108109
virtual winrt::Microsoft::ReactNative::Composition::implementation::Theme *theme() const noexcept;
109110
virtual void onThemeChanged() noexcept;
@@ -206,7 +207,7 @@ struct ComponentView
206207
// If ignorePointerEvents = true, all Components are treated as valid targets
207208
virtual facebook::react::Tag
208209
hitTest(facebook::react::Point pt, facebook::react::Point &localPt, bool ignorePointerEvents = false) const noexcept;
209-
virtual winrt::IInspectable EnsureUiaProvider() noexcept;
210+
virtual winrt::Windows::Foundation::IInspectable EnsureUiaProvider() noexcept;
210211
virtual std::optional<std::string> getAccessiblityValue() noexcept;
211212
virtual void setAcccessiblityValue(std::string &&value) noexcept;
212213
virtual bool getAcccessiblityIsReadOnly() noexcept;
@@ -223,8 +224,8 @@ struct ComponentView
223224
virtual const winrt::Microsoft::ReactNative::IComponentProps userProps(
224225
facebook::react::Props::Shared const &props) noexcept;
225226

226-
void UserData(const winrt::IInspectable &userData) noexcept;
227-
winrt::IInspectable UserData() const noexcept;
227+
void UserData(const winrt::Windows::Foundation::IInspectable &userData) noexcept;
228+
winrt::Windows::Foundation::IInspectable UserData() const noexcept;
228229

229230
virtual void MountChildComponentView(
230231
const winrt::Microsoft::ReactNative::ComponentView &childComponentView,
@@ -256,7 +257,7 @@ struct ComponentView
256257
winrt::com_ptr<winrt::Microsoft::ReactNative::Composition::ReactCompositionViewComponentBuilder> m_builder;
257258
bool m_mounted : 1 {false};
258259
const facebook::react::Tag m_tag;
259-
winrt::IInspectable m_userData;
260+
winrt::Windows::Foundation::IInspectable m_userData;
260261
mutable winrt::Microsoft::ReactNative::Composition::implementation::RootComponentView *m_rootView{nullptr};
261262
mutable winrt::Microsoft::ReactNative::Composition::implementation::Theme *m_theme{nullptr};
262263
const winrt::Microsoft::ReactNative::ReactContext m_reactContext;

vnext/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#pragma once
66

7+
#include <CppWinRTIncludes.h>
78
#include <Fabric/ComponentView.h>
89
#include <Microsoft.ReactNative.Cxx/ReactContext.h>
910
#include <react/renderer/components/view/ViewEventEmitter.h>

vnext/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ struct ContentIslandComponentView : ContentIslandComponentViewT<ContentIslandCom
4040

4141
bool focusable() const noexcept override;
4242

43-
winrt::IInspectable EnsureUiaProvider() noexcept override;
43+
winrt::Windows::Foundation::IInspectable EnsureUiaProvider() noexcept override;
4444

4545
void onGotFocus(const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept override;
4646

vnext/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
#include "ParagraphComponentView.h"
77

8+
#include <react/renderer/textlayoutmanager/WindowsTextLayoutManager.h>
9+
810
#include <AutoDraw.h>
911
#include <Utils/ValueUtils.h>
1012
#include <react/renderer/components/text/ParagraphShadowNode.h>
@@ -169,7 +171,7 @@ void ParagraphComponentView::updateVisualBrush() noexcept {
169171
constraints.maximumSize.height =
170172
m_layoutMetrics.frame.size.height - m_layoutMetrics.contentInsets.top - m_layoutMetrics.contentInsets.bottom;
171173

172-
facebook::react::TextLayoutManager::GetTextLayout(
174+
facebook::react::WindowsTextLayoutManager::GetTextLayout(
173175
m_attributedStringBox, m_paragraphAttributes, constraints, m_textLayout);
174176

175177
requireNewBrush = true;

0 commit comments

Comments
 (0)