react-native-windows 0.76.0-preview.3 → 0.76.0-preview.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +15 -15
- package/Libraries/Components/Button.windows.js +18 -18
- package/Libraries/Components/Flyout/FlyoutNativeComponent.js +5 -1
- package/Libraries/Components/Keyboard/KeyboardExt.js +1 -1
- package/Libraries/Components/Keyboard/KeyboardExt.js.map +1 -1
- package/Libraries/Components/TextInput/TextInput.windows.js +16 -11
- package/Libraries/Components/Touchable/Touchable.windows.js +2 -2
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +5 -3
- package/Libraries/Components/View/View.windows.js +1 -3
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Text/Text.windows.js +32 -63
- package/Libraries/Utilities/Platform.windows.js +4 -4
- package/Microsoft.ReactNative/ReactNativeAppBuilder.cpp +25 -129
- package/Microsoft.ReactNative/ReactNativeAppBuilder.h +5 -13
- package/Microsoft.ReactNative/ReactNativeAppBuilder.idl +13 -34
- package/Microsoft.ReactNative/ReactNativeWin32App.cpp +129 -18
- package/Microsoft.ReactNative/ReactNativeWin32App.h +14 -5
- package/PropertySheets/External/Microsoft.ReactNative.CppLib.props +17 -0
- package/PropertySheets/External/Microsoft.ReactNative.CppLib.targets +17 -0
- package/PropertySheets/Generated/PackageVersion.g.props +2 -2
- package/PropertySheets/WebView2.props +7 -0
- package/PropertySheets/WinUI.props +1 -1
- package/Shared/Shared.vcxitems +0 -10
- package/just-task.js +1 -1
- package/package.json +13 -14
- package/templates/cpp-app/template.config.js +8 -3
- package/templates/cpp-app/windows/MyApp/MyApp.cpp +46 -131
- package/templates/cpp-lib/template.config.js +8 -3
- package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +4 -4
- package/templates/templateUtils.js +2 -3
- package/Microsoft.ReactNative/ReactInstanceSettingsBuilder.cpp +0 -59
- package/Microsoft.ReactNative/ReactInstanceSettingsBuilder.h +0 -23
|
@@ -9,60 +9,39 @@ import "IReactPackageProvider.idl";
|
|
|
9
9
|
namespace Microsoft.ReactNative {
|
|
10
10
|
|
|
11
11
|
[experimental]
|
|
12
|
-
DOC_STRING("ReactNativeWin32App
|
|
12
|
+
DOC_STRING("ReactNativeWin32App sets up the infrastructure for the default experience of a ReactNative application filling a WinAppSDK window.")
|
|
13
13
|
runtimeclass ReactNativeWin32App {
|
|
14
14
|
// Properties
|
|
15
15
|
Microsoft.UI.Windowing.AppWindow AppWindow {get;};
|
|
16
16
|
|
|
17
|
-
Microsoft.UI.Composition.Compositor Compositor {get;};
|
|
18
|
-
|
|
19
|
-
Microsoft.UI.Content.DesktopChildSiteBridge DesktopChildSiteBridge {get;};
|
|
20
|
-
|
|
21
17
|
ReactNativeHost ReactNativeHost {get;};
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
ReactViewOptions ReactViewOptions {get;};
|
|
20
|
+
|
|
21
|
+
// TODO: Hide these APIs for now until we're sure we need to expose them and can do so safely
|
|
22
|
+
// Microsoft.UI.Composition.Compositor Compositor {get;};
|
|
23
|
+
// Microsoft.UI.Content.DesktopChildSiteBridge DesktopChildSiteBridge {get;};
|
|
24
|
+
// Microsoft.UI.Dispatching DispatcherQueueController {get;};
|
|
25
|
+
// ReactNativeIsland ReactNativeIsland {get;};
|
|
24
26
|
|
|
25
27
|
// Methods
|
|
26
28
|
void Start();
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
[experimental]
|
|
30
|
-
DOC_STRING("
|
|
31
|
-
runtimeclass ReactInstanceSettingsBuilder
|
|
32
|
-
{
|
|
33
|
-
ReactInstanceSettingsBuilder();
|
|
34
|
-
|
|
35
|
-
// Properties
|
|
36
|
-
ReactInstanceSettings ReactInstanceSettings {get;};
|
|
37
|
-
|
|
38
|
-
// Methods
|
|
39
|
-
ReactInstanceSettingsBuilder UseDirectDebugger(Boolean state);
|
|
40
|
-
|
|
41
|
-
ReactInstanceSettingsBuilder UseDeveloperSupport(Boolean state);
|
|
42
|
-
|
|
43
|
-
ReactInstanceSettingsBuilder BundleRootPath(String path);
|
|
44
|
-
|
|
45
|
-
ReactInstanceSettingsBuilder DebugBundlePath(String path);
|
|
46
|
-
|
|
47
|
-
ReactInstanceSettingsBuilder JavaScriptBundleFile(String file);
|
|
48
|
-
|
|
49
|
-
ReactInstanceSettingsBuilder UseFastRefresh(Boolean state);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
[experimental]
|
|
53
|
-
DOC_STRING("ReactNativeAppBuilder initializes all the required infrastructure for a Win32 Fabric Application.")
|
|
32
|
+
DOC_STRING("ReactNativeAppBuilder builds a ReactNativeWin32App with the base WinAppSDK infrastructure.")
|
|
54
33
|
runtimeclass ReactNativeAppBuilder
|
|
55
34
|
{
|
|
56
35
|
ReactNativeAppBuilder();
|
|
57
36
|
|
|
58
37
|
// Methods
|
|
59
|
-
ReactNativeAppBuilder AddPackageProviders(Windows.Foundation.Collections.IVector<Microsoft.ReactNative.IReactPackageProvider> packageProviders);
|
|
60
|
-
|
|
61
|
-
ReactNativeAppBuilder SetReactInstanceSettings(ReactInstanceSettings settings);
|
|
62
38
|
|
|
63
39
|
ReactNativeAppBuilder SetAppWindow(Microsoft.UI.Windowing.AppWindow appWindow);
|
|
64
40
|
|
|
65
|
-
|
|
41
|
+
// TODO: Hide these APIs for now until we're sure we need to expose them and can do so safely
|
|
42
|
+
// Compositor depends on the DispatcherQueue created by DispatcherQueueController
|
|
43
|
+
// ReactNativeAppBuilder SetCompositor(Microsoft.UI.Composition.Compositor compositor);
|
|
44
|
+
// ReactNativeAppBuilder SetDispatcherQueueController(Microsoft.UI.Dispatching DispatcherQueueController);
|
|
66
45
|
|
|
67
46
|
ReactNativeWin32App Build();
|
|
68
47
|
}
|
|
@@ -1,12 +1,42 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
1
4
|
#include "pch.h"
|
|
2
5
|
#include "ReactNativeWin32App.h"
|
|
3
6
|
#include "ReactNativeWin32App.g.cpp"
|
|
7
|
+
|
|
8
|
+
#include "IReactDispatcher.h"
|
|
9
|
+
#include "ReactCoreInjection.h"
|
|
4
10
|
#include "ReactNativeHost.h"
|
|
11
|
+
|
|
5
12
|
#include "winrt/Microsoft.UI.Composition.h"
|
|
6
13
|
#include "winrt/Microsoft.UI.Content.h"
|
|
14
|
+
#include "winrt/Microsoft.UI.Dispatching.h"
|
|
7
15
|
#include "winrt/Microsoft.UI.Interop.h"
|
|
8
16
|
#include "winrt/Microsoft.UI.Windowing.h"
|
|
9
17
|
|
|
18
|
+
// Scaling factor for the window's content based on the DPI of the display where the window is located.
|
|
19
|
+
float ScaleFactor(HWND hwnd) noexcept {
|
|
20
|
+
return GetDpiForWindow(hwnd) / static_cast<float>(USER_DEFAULT_SCREEN_DPI);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
void UpdateRootViewSizeToAppWindow(
|
|
24
|
+
winrt::Microsoft::ReactNative::ReactNativeIsland const &rootView,
|
|
25
|
+
winrt::Microsoft::UI::Windowing::AppWindow const &window) {
|
|
26
|
+
auto hwnd = winrt::Microsoft::UI::GetWindowFromWindowId(window.Id());
|
|
27
|
+
auto scaleFactor = ScaleFactor(hwnd);
|
|
28
|
+
winrt::Windows::Foundation::Size size{
|
|
29
|
+
window.ClientSize().Width / scaleFactor, window.ClientSize().Height / scaleFactor};
|
|
30
|
+
// Do not relayout when minimized
|
|
31
|
+
if (window.Presenter().as<winrt::Microsoft::UI::Windowing::OverlappedPresenter>().State() !=
|
|
32
|
+
winrt::Microsoft::UI::Windowing::OverlappedPresenterState::Minimized) {
|
|
33
|
+
winrt::Microsoft::ReactNative::LayoutConstraints constraints;
|
|
34
|
+
constraints.LayoutDirection = winrt::Microsoft::ReactNative::LayoutDirection::Undefined;
|
|
35
|
+
constraints.MaximumSize = constraints.MinimumSize = size;
|
|
36
|
+
rootView.Arrange(constraints, {0, 0});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
10
40
|
namespace winrt::Microsoft::ReactNative::implementation {
|
|
11
41
|
ReactNativeWin32App::ReactNativeWin32App() {}
|
|
12
42
|
|
|
@@ -14,41 +44,44 @@ ReactNativeWin32App::~ReactNativeWin32App() {
|
|
|
14
44
|
m_desktopChildSiteBridge = nullptr;
|
|
15
45
|
|
|
16
46
|
// Destroy all Composition objects
|
|
17
|
-
m_compositor
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
void ReactNativeWin32App::AppWindow(winrt::Microsoft::UI::Windowing::AppWindow const &appWindow) {
|
|
22
|
-
m_appWindow = appWindow;
|
|
47
|
+
if (m_compositor != nullptr) {
|
|
48
|
+
m_compositor.Close();
|
|
49
|
+
m_compositor = nullptr;
|
|
50
|
+
}
|
|
23
51
|
}
|
|
24
52
|
|
|
25
53
|
winrt::Microsoft::UI::Windowing::AppWindow ReactNativeWin32App::AppWindow() {
|
|
26
54
|
return m_appWindow;
|
|
27
55
|
}
|
|
28
56
|
|
|
29
|
-
void ReactNativeWin32App::
|
|
30
|
-
|
|
57
|
+
void ReactNativeWin32App::AppWindow(winrt::Microsoft::UI::Windowing::AppWindow const &appWindow) {
|
|
58
|
+
m_appWindow = appWindow;
|
|
31
59
|
}
|
|
32
60
|
|
|
33
61
|
winrt::Microsoft::UI::Composition::Compositor ReactNativeWin32App::Compositor() {
|
|
34
62
|
return m_compositor;
|
|
35
63
|
}
|
|
36
64
|
|
|
37
|
-
winrt::Microsoft::
|
|
38
|
-
|
|
65
|
+
void ReactNativeWin32App::Compositor(winrt::Microsoft::UI::Composition::Compositor const &compositor) {
|
|
66
|
+
m_compositor = compositor;
|
|
39
67
|
}
|
|
40
68
|
|
|
41
|
-
void ReactNativeWin32App::
|
|
42
|
-
|
|
69
|
+
void ReactNativeWin32App::DesktopChildSiteBridge(
|
|
70
|
+
winrt::Microsoft::UI::Content::DesktopChildSiteBridge const &desktopChildSiteBridge) {
|
|
71
|
+
m_desktopChildSiteBridge = desktopChildSiteBridge;
|
|
43
72
|
}
|
|
44
73
|
|
|
45
74
|
winrt::Microsoft::UI::Content::DesktopChildSiteBridge ReactNativeWin32App::DesktopChildSiteBridge() {
|
|
46
75
|
return m_desktopChildSiteBridge;
|
|
47
76
|
}
|
|
48
77
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
78
|
+
winrt::Microsoft::UI::Dispatching::DispatcherQueueController ReactNativeWin32App::DispatcherQueueController() {
|
|
79
|
+
return m_dispatcherQueueController;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
void ReactNativeWin32App::DispatcherQueueController(
|
|
83
|
+
winrt::Microsoft::UI::Dispatching::DispatcherQueueController const &dispatcherQueueController) {
|
|
84
|
+
m_dispatcherQueueController = dispatcherQueueController;
|
|
52
85
|
}
|
|
53
86
|
|
|
54
87
|
winrt::Microsoft::ReactNative::ReactNativeHost ReactNativeWin32App::ReactNativeHost() {
|
|
@@ -62,12 +95,90 @@ void ReactNativeWin32App::ReactNativeHost(winrt::Microsoft::ReactNative::ReactNa
|
|
|
62
95
|
m_host = host;
|
|
63
96
|
}
|
|
64
97
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
98
|
+
winrt::Microsoft::ReactNative::ReactNativeIsland ReactNativeWin32App::ReactNativeIsland() {
|
|
99
|
+
return m_reactNativeIsland;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
void ReactNativeWin32App::ReactNativeIsland(winrt::Microsoft::ReactNative::ReactNativeIsland const &reactNativeIsland) {
|
|
103
|
+
m_reactNativeIsland = reactNativeIsland;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
winrt::Microsoft::ReactNative::ReactViewOptions ReactNativeWin32App::ReactViewOptions() {
|
|
107
|
+
if (m_reactViewOptions == nullptr) {
|
|
108
|
+
m_reactViewOptions = winrt::make<winrt::Microsoft::ReactNative::implementation::ReactViewOptions>();
|
|
109
|
+
}
|
|
110
|
+
return m_reactViewOptions;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
void ReactNativeWin32App::ReactViewOptions(winrt::Microsoft::ReactNative::ReactViewOptions const &viewOptions) {
|
|
114
|
+
m_reactViewOptions = viewOptions;
|
|
68
115
|
}
|
|
69
116
|
|
|
70
117
|
void ReactNativeWin32App::Start() {
|
|
118
|
+
// Show the hosting AppWindow
|
|
119
|
+
m_appWindow.Show();
|
|
120
|
+
|
|
121
|
+
// Currently set the property to use current thread dispatcher as a default UI dispatcher.
|
|
122
|
+
// TODO: Use the correct dispatcher from a developer-provided DispatcherQueueController
|
|
123
|
+
ReactNativeHost().InstanceSettings().Properties().Set(
|
|
124
|
+
ReactDispatcherHelper::UIDispatcherProperty(), ReactDispatcherHelper::UIThreadDispatcher());
|
|
125
|
+
|
|
126
|
+
auto hwnd{winrt::Microsoft::UI::GetWindowFromWindowId(m_appWindow.Id())};
|
|
127
|
+
|
|
128
|
+
winrt::Microsoft::ReactNative::ReactCoreInjection::SetTopLevelWindowId(
|
|
129
|
+
ReactNativeHost().InstanceSettings().Properties(), reinterpret_cast<uint64_t>(hwnd));
|
|
130
|
+
|
|
131
|
+
winrt::Microsoft::ReactNative::Composition::CompositionUIService::SetCompositor(
|
|
132
|
+
ReactNativeHost().InstanceSettings(), m_compositor);
|
|
133
|
+
|
|
134
|
+
// Start the react-native instance, which will create a JavaScript runtime and load the applications bundle.
|
|
135
|
+
ReactNativeHost().ReloadInstance();
|
|
136
|
+
|
|
137
|
+
// Create a RootView which will present a react-native component
|
|
138
|
+
if (m_reactNativeIsland == nullptr) {
|
|
139
|
+
m_reactNativeIsland = winrt::Microsoft::ReactNative::ReactNativeIsland(m_compositor);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
m_reactNativeIsland.ReactViewHost(
|
|
143
|
+
winrt::Microsoft::ReactNative::ReactCoreInjection::MakeViewHost(ReactNativeHost(), ReactViewOptions()));
|
|
144
|
+
|
|
145
|
+
// Update the size of the RootView when the AppWindow changes size
|
|
146
|
+
m_appWindow.Changed([wkRootView = winrt::make_weak(m_reactNativeIsland)](
|
|
147
|
+
winrt::Microsoft::UI::Windowing::AppWindow const &window,
|
|
148
|
+
winrt::Microsoft::UI::Windowing::AppWindowChangedEventArgs const &args) {
|
|
149
|
+
if (args.DidSizeChange() || args.DidVisibilityChange()) {
|
|
150
|
+
if (auto rootView = wkRootView.get()) {
|
|
151
|
+
UpdateRootViewSizeToAppWindow(rootView, window);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// Quit application when main window is closed
|
|
157
|
+
m_appWindow.Destroying([this](
|
|
158
|
+
winrt::Microsoft::UI::Windowing::AppWindow const &window,
|
|
159
|
+
winrt::Windows::Foundation::IInspectable const & /*args*/) {
|
|
160
|
+
// Before we shutdown the application - unload the ReactNativeHost to give the javascript a chance to save any
|
|
161
|
+
// state
|
|
162
|
+
auto async = ReactNativeHost().UnloadInstance();
|
|
163
|
+
async.Completed([this](auto asyncInfo, winrt::Windows::Foundation::AsyncStatus asyncStatus) {
|
|
164
|
+
assert(asyncStatus == winrt::Windows::Foundation::AsyncStatus::Completed);
|
|
165
|
+
ReactNativeHost().InstanceSettings().UIDispatcher().Post([]() { PostQuitMessage(0); });
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
// DesktopChildSiteBridge create a ContentSite that can host the RootView ContentIsland
|
|
170
|
+
m_desktopChildSiteBridge =
|
|
171
|
+
winrt::Microsoft::UI::Content::DesktopChildSiteBridge::Create(m_compositor, m_appWindow.Id());
|
|
172
|
+
|
|
173
|
+
m_desktopChildSiteBridge.Connect(m_reactNativeIsland.Island());
|
|
174
|
+
|
|
175
|
+
m_desktopChildSiteBridge.ResizePolicy(winrt::Microsoft::UI::Content::ContentSizePolicy::ResizeContentToParentWindow);
|
|
176
|
+
|
|
177
|
+
auto scaleFactor = ScaleFactor(hwnd);
|
|
178
|
+
m_reactNativeIsland.ScaleFactor(scaleFactor);
|
|
179
|
+
|
|
180
|
+
UpdateRootViewSizeToAppWindow(m_reactNativeIsland, m_appWindow);
|
|
181
|
+
|
|
71
182
|
m_desktopChildSiteBridge.Show();
|
|
72
183
|
|
|
73
184
|
// Run the main application event loop
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
1
3
|
#pragma once
|
|
4
|
+
|
|
2
5
|
#include "ReactNativeWin32App.g.h"
|
|
6
|
+
|
|
3
7
|
#include "winrt/Microsoft.UI.Dispatching.h"
|
|
4
8
|
|
|
5
9
|
namespace winrt::Microsoft::ReactNative::implementation {
|
|
@@ -13,26 +17,31 @@ struct ReactNativeWin32App : ReactNativeWin32AppT<ReactNativeWin32App> {
|
|
|
13
17
|
winrt::Microsoft::UI::Composition::Compositor Compositor();
|
|
14
18
|
void Compositor(winrt::Microsoft::UI::Composition::Compositor const &compositor);
|
|
15
19
|
|
|
16
|
-
winrt::Microsoft::ReactNative::ReactNativeIsland ReactNativeIsland();
|
|
17
|
-
void ReactNativeIsland(winrt::Microsoft::ReactNative::ReactNativeIsland const &reactNativeIsland);
|
|
18
|
-
|
|
19
20
|
winrt::Microsoft::UI::Content::DesktopChildSiteBridge DesktopChildSiteBridge();
|
|
20
21
|
void DesktopChildSiteBridge(winrt::Microsoft::UI::Content::DesktopChildSiteBridge const &desktopChildSiteBridge);
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
winrt::Microsoft::UI::Dispatching::DispatcherQueueController DispatcherQueueController();
|
|
24
|
+
void DispatcherQueueController(
|
|
23
25
|
winrt::Microsoft::UI::Dispatching::DispatcherQueueController const &dispatcherQueueController);
|
|
24
26
|
|
|
25
27
|
winrt::Microsoft::ReactNative::ReactNativeHost ReactNativeHost();
|
|
26
28
|
void ReactNativeHost(winrt::Microsoft::ReactNative::ReactNativeHost const &host);
|
|
27
29
|
|
|
30
|
+
winrt::Microsoft::ReactNative::ReactNativeIsland ReactNativeIsland();
|
|
31
|
+
void ReactNativeIsland(winrt::Microsoft::ReactNative::ReactNativeIsland const &reactNativeIsland);
|
|
32
|
+
|
|
33
|
+
winrt::Microsoft::ReactNative::ReactViewOptions ReactViewOptions();
|
|
34
|
+
void ReactViewOptions(winrt::Microsoft::ReactNative::ReactViewOptions const &reactViewOptions);
|
|
35
|
+
|
|
28
36
|
void Start();
|
|
29
37
|
|
|
30
38
|
private:
|
|
31
39
|
winrt::Microsoft::UI::Windowing::AppWindow m_appWindow{nullptr};
|
|
32
40
|
winrt::Microsoft::UI::Composition::Compositor m_compositor{nullptr};
|
|
41
|
+
winrt::Microsoft::UI::Content::DesktopChildSiteBridge m_desktopChildSiteBridge{nullptr};
|
|
33
42
|
winrt::Microsoft::UI::Dispatching::DispatcherQueueController m_dispatcherQueueController{nullptr};
|
|
34
43
|
winrt::Microsoft::ReactNative::ReactNativeHost m_host{nullptr};
|
|
35
44
|
winrt::Microsoft::ReactNative::ReactNativeIsland m_reactNativeIsland{nullptr};
|
|
36
|
-
winrt::Microsoft::
|
|
45
|
+
winrt::Microsoft::ReactNative::ReactViewOptions m_reactViewOptions{nullptr};
|
|
37
46
|
};
|
|
38
47
|
} // namespace winrt::Microsoft::ReactNative::implementation
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!--
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
Licensed under the MIT License.
|
|
5
|
+
|
|
6
|
+
This file will be consumed by ALL C++ module projects (both inside
|
|
7
|
+
and outside of this repo) that build on top of Microsoft.ReactNative.
|
|
8
|
+
Do not make any changes here unless it applies to ALL such projects.
|
|
9
|
+
-->
|
|
10
|
+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
11
|
+
<ImportGroup Condition="'$(UseFabric)' == 'true'">
|
|
12
|
+
<Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Composition.CppLib.props" />
|
|
13
|
+
</ImportGroup>
|
|
14
|
+
<ImportGroup Condition="'$(UseFabric)' != 'true'">
|
|
15
|
+
<Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Uwp.CppLib.props" />
|
|
16
|
+
</ImportGroup>
|
|
17
|
+
</Project>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!--
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
Licensed under the MIT License.
|
|
5
|
+
|
|
6
|
+
This file will be consumed by ALL C++ module projects (both inside
|
|
7
|
+
and outside of this repo) that build on top of Microsoft.ReactNative.
|
|
8
|
+
Do not make any changes here unless it applies to ALL such projects.
|
|
9
|
+
-->
|
|
10
|
+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
11
|
+
<ImportGroup Condition="'$(UseFabric)' == 'true'">
|
|
12
|
+
<Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Composition.CppLib.targets" />
|
|
13
|
+
</ImportGroup>
|
|
14
|
+
<ImportGroup Condition="'$(UseFabric)' != 'true'">
|
|
15
|
+
<Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Uwp.CppLib.targets" />
|
|
16
|
+
</ImportGroup>
|
|
17
|
+
</Project>
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.76.0-preview.
|
|
13
|
+
<ReactNativeWindowsVersion>0.76.0-preview.5</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>76</ReactNativeWindowsMinor>
|
|
16
16
|
<ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
|
-
<ReactNativeWindowsCommitId>
|
|
18
|
+
<ReactNativeWindowsCommitId>0091bbb94a83bc73c1a62acf821256b48c65dee2</ReactNativeWindowsCommitId>
|
|
19
19
|
</PropertyGroup>
|
|
20
20
|
</Project>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
3
|
+
<PropertyGroup Label="WebView2 versioning">
|
|
4
|
+
<!-- WinAppSDK 1.6+ has a dependency on Microsoft.Web.WebView2, there are a few places we need to pull in this package explicitly. -->
|
|
5
|
+
<WebView2PackageVersion>1.0.2651.64</WebView2PackageVersion>
|
|
6
|
+
</PropertyGroup>
|
|
7
|
+
</Project>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
-->
|
|
9
9
|
<!-- This value is also used by the CLI, see /packages/@react-native-windows/generate-windows -->
|
|
10
10
|
<WinUI3Version Condition="'$(WinUI3Version)'=='' AND '$(UseExperimentalWinUI3)'=='true'">1.6.240701003-experimental2</WinUI3Version>
|
|
11
|
-
<WinUI3Version Condition="'$(WinUI3Version)'==''">1.
|
|
11
|
+
<WinUI3Version Condition="'$(WinUI3Version)'==''">1.6.240923002</WinUI3Version>
|
|
12
12
|
</PropertyGroup>
|
|
13
13
|
|
|
14
14
|
<PropertyGroup Label="WinUI2x versioning">
|
package/Shared/Shared.vcxitems
CHANGED
|
@@ -232,11 +232,6 @@
|
|
|
232
232
|
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
|
|
233
233
|
<DependentUpon>$(ReactNativeWindowsDir)Microsoft.ReactNative\ReactNativeAppBuilder.idl</DependentUpon>
|
|
234
234
|
<SubType>Code</SubType>
|
|
235
|
-
</ClCompile>
|
|
236
|
-
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\ReactInstanceSettingsBuilder.cpp">
|
|
237
|
-
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
|
|
238
|
-
<DependentUpon>$(ReactNativeWindowsDir)Microsoft.ReactNative\ReactNativeAppBuilder.idl</DependentUpon>
|
|
239
|
-
<SubType>Code</SubType>
|
|
240
235
|
</ClCompile>
|
|
241
236
|
<ClCompile Include="$(MSBuildThisFileDirectory)BaseFileReaderResource.cpp" />
|
|
242
237
|
<ClCompile Include="$(MSBuildThisFileDirectory)BaseScriptStoreImpl.cpp" />
|
|
@@ -349,11 +344,6 @@
|
|
|
349
344
|
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
|
|
350
345
|
<DependentUpon>$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\ReactNativeAppBuilder.idl</DependentUpon>
|
|
351
346
|
<SubType>Code</SubType>
|
|
352
|
-
</ClInclude>
|
|
353
|
-
<ClInclude Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\ReactInstanceSettingsBuilder.h">
|
|
354
|
-
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
|
|
355
|
-
<DependentUpon>$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\ReactNativeAppBuilder.idl</DependentUpon>
|
|
356
|
-
<SubType>Code</SubType>
|
|
357
347
|
</ClInclude>
|
|
358
348
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\DynamicReader.cpp">
|
|
359
349
|
<DependentUpon>$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\IJSValueReader.idl</DependentUpon>
|
package/just-task.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-windows",
|
|
3
|
-
"version": "0.76.0-preview.
|
|
3
|
+
"version": "0.76.0-preview.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
"@react-native-community/cli": "15.0.0-alpha.2",
|
|
27
27
|
"@react-native-community/cli-platform-android": "15.0.0-alpha.2",
|
|
28
28
|
"@react-native-community/cli-platform-ios": "15.0.0-alpha.2",
|
|
29
|
-
"@react-native-windows/cli": "0.76.0-preview.
|
|
29
|
+
"@react-native-windows/cli": "0.76.0-preview.4",
|
|
30
30
|
"@react-native/assets": "1.0.0",
|
|
31
|
-
"@react-native/assets-registry": "0.76.0
|
|
32
|
-
"@react-native/codegen": "0.76.0
|
|
33
|
-
"@react-native/community-cli-plugin": "0.76.0
|
|
34
|
-
"@react-native/gradle-plugin": "0.76.0
|
|
35
|
-
"@react-native/js-polyfills": "0.76.0
|
|
36
|
-
"@react-native/normalize-colors": "0.76.0
|
|
37
|
-
"@react-native/virtualized-lists": "0.76.0
|
|
31
|
+
"@react-native/assets-registry": "0.76.0",
|
|
32
|
+
"@react-native/codegen": "0.76.0",
|
|
33
|
+
"@react-native/community-cli-plugin": "0.76.0",
|
|
34
|
+
"@react-native/gradle-plugin": "0.76.0",
|
|
35
|
+
"@react-native/js-polyfills": "0.76.0",
|
|
36
|
+
"@react-native/normalize-colors": "0.76.0",
|
|
37
|
+
"@react-native/virtualized-lists": "0.76.0",
|
|
38
38
|
"abort-controller": "^3.0.0",
|
|
39
39
|
"anser": "^1.4.9",
|
|
40
40
|
"ansi-regex": "^5.0.0",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"yargs": "^17.6.2"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@react-native-
|
|
73
|
-
"@react-native/
|
|
72
|
+
"@react-native/metro-config": "0.76.0",
|
|
73
|
+
"@react-native-windows/codegen": "0.76.0-preview.2",
|
|
74
74
|
"@rnw-scripts/babel-react-native-config": "0.0.0",
|
|
75
75
|
"@rnw-scripts/eslint-config": "1.2.27",
|
|
76
76
|
"@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.1.31",
|
|
@@ -80,13 +80,12 @@
|
|
|
80
80
|
"@types/node": "^18.0.0",
|
|
81
81
|
"@types/react": "^18.2.6",
|
|
82
82
|
"eslint": "^8.19.0",
|
|
83
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
84
83
|
"flow-bin": "^0.245.2",
|
|
85
84
|
"jscodeshift": "^0.14.0",
|
|
86
85
|
"just-scripts": "^1.3.3",
|
|
87
86
|
"prettier": "2.8.8",
|
|
88
87
|
"react": "18.3.1",
|
|
89
|
-
"react-native": "0.76.0
|
|
88
|
+
"react-native": "0.76.0",
|
|
90
89
|
"react-native-platform-override": "^1.9.46",
|
|
91
90
|
"react-refresh": "^0.14.0",
|
|
92
91
|
"typescript": "5.0.4"
|
|
@@ -94,7 +93,7 @@
|
|
|
94
93
|
"peerDependencies": {
|
|
95
94
|
"@types/react": "^18.2.6",
|
|
96
95
|
"react": "^18.2.0",
|
|
97
|
-
"react-native": "0.76.0
|
|
96
|
+
"react-native": "^0.76.0"
|
|
98
97
|
},
|
|
99
98
|
"beachball": {
|
|
100
99
|
"defaultNpmTag": "preview",
|
|
@@ -21,7 +21,10 @@ async function preInstall(config = {}, options = {}) {}
|
|
|
21
21
|
|
|
22
22
|
async function getFileMappings(config = {}, options = {}) {
|
|
23
23
|
const projectRoot = config?.root ?? process.cwd();
|
|
24
|
-
const {rnwPath, rnwVersion, devMode, isCanary} = templateUtils.getRnwInfo(
|
|
24
|
+
const {rnwPath, rnwVersion, devMode, isCanary} = templateUtils.getRnwInfo(
|
|
25
|
+
config,
|
|
26
|
+
options,
|
|
27
|
+
);
|
|
25
28
|
|
|
26
29
|
const projectName =
|
|
27
30
|
config?.project?.windows?.project?.projectName ?? options?.name ?? 'MyApp';
|
|
@@ -49,7 +52,9 @@ async function getFileMappings(config = {}, options = {}) {
|
|
|
49
52
|
namespaceCpp: namespaceCpp,
|
|
50
53
|
|
|
51
54
|
rnwVersion: rnwVersion,
|
|
52
|
-
rnwPathFromProjectRoot: path
|
|
55
|
+
rnwPathFromProjectRoot: path
|
|
56
|
+
.relative(projectRoot, rnwPath)
|
|
57
|
+
.replace(/\//g, '\\'),
|
|
53
58
|
|
|
54
59
|
mainComponentName,
|
|
55
60
|
|
|
@@ -67,7 +72,7 @@ async function getFileMappings(config = {}, options = {}) {
|
|
|
67
72
|
devMode,
|
|
68
73
|
|
|
69
74
|
useNuGets: !devMode, // default is to use published NuGets except in devMode, change to true here if you want to test devMode and nugets simultaneously
|
|
70
|
-
addReactNativePublicAdoFeed: isCanary,
|
|
75
|
+
addReactNativePublicAdoFeed: true || isCanary, // Temporary true for all new projects until code-signing is restored, see issue #14030
|
|
71
76
|
|
|
72
77
|
cppNugetPackages,
|
|
73
78
|
};
|