react-native-windows 0.74.19 → 0.74.21
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/Microsoft.ReactNative/ComponentView.idl +33 -32
- package/Microsoft.ReactNative/Composition.Input.idl +2 -0
- package/Microsoft.ReactNative/CompositionComponentView.idl +43 -24
- package/Microsoft.ReactNative/Fabric/AbiEventEmitter.cpp +21 -0
- package/Microsoft.ReactNative/Fabric/AbiEventEmitter.h +23 -0
- package/Microsoft.ReactNative/Fabric/AbiShadowNode.cpp +7 -0
- package/Microsoft.ReactNative/Fabric/AbiShadowNode.h +3 -0
- package/Microsoft.ReactNative/Fabric/ComponentView.cpp +318 -59
- package/Microsoft.ReactNative/Fabric/ComponentView.h +155 -33
- package/Microsoft.ReactNative/Fabric/Composition/ActivityIndicatorComponentView.cpp +2 -2
- package/Microsoft.ReactNative/Fabric/Composition/ComponentViewRegistry.cpp +3 -0
- package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.cpp +25 -7
- package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.h +22 -4
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +43 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +6 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +147 -119
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +4 -8
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +97 -101
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +28 -52
- package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +133 -0
- package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +61 -0
- package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.cpp +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.cpp +1 -4
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +1 -6
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.h +0 -1
- package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp +108 -18
- package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +33 -5
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +57 -1
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +6 -0
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +8 -2
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +2 -0
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +195 -182
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +1 -3
- package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.cpp +16 -4
- package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.h +3 -3
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +12 -17
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +4 -11
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +19 -0
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +4 -0
- package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.cpp +1 -2
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +10 -7
- package/Microsoft.ReactNative/Fabric/WindowsComponentDescriptorRegistry.cpp +1 -3
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.cpp +20 -1
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.h +3 -0
- package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +13 -3
- package/Microsoft.ReactNative/IReactViewComponentBuilder.idl +57 -4
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +14 -32
- package/Microsoft.ReactNative/ReactNativeIsland.idl +3 -0
- package/PropertySheets/External/Microsoft.ReactNative.Composition.Package.props +1 -0
- package/PropertySheets/External/Microsoft.ReactNative.Composition.Package.targets +4 -0
- package/PropertySheets/External/Microsoft.ReactNative.Cpp.PackageReferences.props +14 -4
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/PropertySheets/WinUI.props +1 -1
- package/Scripts/Microsoft.ReactNative.VersionCheck.targets +2 -0
- package/Shared/Shared.vcxitems +7 -0
- package/Shared/Shared.vcxitems.filters +1 -0
- package/just-task.js +1 -1
- package/package.json +3 -3
- package/template/cpp-app/proj/MyApp.sln +19 -19
- package/template/cpp-lib/proj/MyLib.sln +19 -19
- package/template/cs-app/proj/MyApp.sln +21 -21
- package/template/cs-lib/proj/MyLib.sln +21 -21
- package/template/metro.config.js +13 -2
- package/templates/cpp-app/NuGet_Config +13 -0
- package/templates/cpp-app/template.config.js +11 -1
- package/templates/cpp-app/windows/ExperimentalFeatures.props +1 -0
- package/templates/cpp-app/windows/MyApp.sln +29 -19
- package/templates/cpp-lib/NuGet_Config +13 -0
- package/templates/cpp-lib/example/NuGet_Config +6 -0
- package/templates/cpp-lib/template.config.js +11 -1
- package/templates/cpp-lib/windows/ExperimentalFeatures.props +1 -0
- package/templates/cpp-lib/windows/MyLib.sln +35 -25
- package/templates/old/generateWrapper.js +7 -4
- package/templates/templateUtils.js +3 -1
- package/template/metro.devMode.config.js +0 -56
|
@@ -62,16 +62,10 @@ struct WindowsTextInputComponentView
|
|
|
62
62
|
void OnPointerMoved(
|
|
63
63
|
const winrt::Microsoft::ReactNative::Composition::Input::PointerRoutedEventArgs &args) noexcept override;
|
|
64
64
|
|
|
65
|
-
void OnKeyDown(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const winrt::Microsoft::ReactNative::Composition::Input::KeyboardSource &source,
|
|
70
|
-
const winrt::Microsoft::ReactNative::Composition::Input::KeyRoutedEventArgs &args) noexcept override;
|
|
71
|
-
void OnCharacterReceived(
|
|
72
|
-
const winrt::Microsoft::ReactNative::Composition::Input::KeyboardSource &source,
|
|
73
|
-
const winrt::Microsoft::ReactNative::Composition::Input::CharacterReceivedRoutedEventArgs &args) noexcept
|
|
74
|
-
override;
|
|
65
|
+
void OnKeyDown(const winrt::Microsoft::ReactNative::Composition::Input::KeyRoutedEventArgs &args) noexcept override;
|
|
66
|
+
void OnKeyUp(const winrt::Microsoft::ReactNative::Composition::Input::KeyRoutedEventArgs &args) noexcept override;
|
|
67
|
+
void OnCharacterReceived(const winrt::Microsoft::ReactNative::Composition::Input::CharacterReceivedRoutedEventArgs
|
|
68
|
+
&args) noexcept override;
|
|
75
69
|
|
|
76
70
|
std::optional<std::string> getAcccessiblityValue() noexcept override;
|
|
77
71
|
void setAcccessiblityValue(std::string &&value) noexcept override;
|
|
@@ -106,7 +100,6 @@ struct WindowsTextInputComponentView
|
|
|
106
100
|
const facebook::react::SharedColor &cursorColor,
|
|
107
101
|
const facebook::react::SharedColor &foregroundColor) noexcept;
|
|
108
102
|
bool ShouldSubmit(
|
|
109
|
-
const winrt::Microsoft::ReactNative::Composition::Input::KeyboardSource &source,
|
|
110
103
|
const winrt::Microsoft::ReactNative::Composition::Input::CharacterReceivedRoutedEventArgs &args) noexcept;
|
|
111
104
|
|
|
112
105
|
winrt::Windows::UI::Composition::CompositionSurfaceBrush m_brush{nullptr};
|
|
@@ -162,4 +162,23 @@ void UpdateUiaProperty(
|
|
|
162
162
|
spProviderSimple.get(), propId, CComVariant(oldValue.c_str()), CComVariant(newValue.c_str()));
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
+
long GetLiveSetting(const std::string &liveRegion) noexcept {
|
|
166
|
+
if (liveRegion == "polite") {
|
|
167
|
+
return LiveSetting::Polite;
|
|
168
|
+
} else if (liveRegion == "assertive") {
|
|
169
|
+
return LiveSetting::Assertive;
|
|
170
|
+
}
|
|
171
|
+
return LiveSetting::Off;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
std::string extractAccessibilityValue(const facebook::react::AccessibilityValue &value) noexcept {
|
|
175
|
+
if (value.now.has_value()) {
|
|
176
|
+
return std::to_string(value.now.value());
|
|
177
|
+
} else if (value.text.has_value()) {
|
|
178
|
+
return value.text.value();
|
|
179
|
+
} else {
|
|
180
|
+
return "";
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
165
184
|
} // namespace winrt::Microsoft::ReactNative::implementation
|
|
@@ -29,4 +29,8 @@ void UpdateUiaProperty(
|
|
|
29
29
|
const std::string &oldValue,
|
|
30
30
|
const std::string &newValue) noexcept;
|
|
31
31
|
|
|
32
|
+
long GetLiveSetting(const std::string &liveRegion) noexcept;
|
|
33
|
+
|
|
34
|
+
std::string extractAccessibilityValue(const facebook::react::AccessibilityValue &value) noexcept;
|
|
35
|
+
|
|
32
36
|
} // namespace winrt::Microsoft::ReactNative::implementation
|
|
@@ -24,8 +24,7 @@ UnimplementedNativeViewComponentView::UnimplementedNativeViewComponentView(
|
|
|
24
24
|
reactContext,
|
|
25
25
|
ComponentViewFeatures::Default &
|
|
26
26
|
~(ComponentViewFeatures::Background | ComponentViewFeatures::ShadowProps |
|
|
27
|
-
ComponentViewFeatures::NativeBorder)
|
|
28
|
-
false) {
|
|
27
|
+
ComponentViewFeatures::NativeBorder)) {
|
|
29
28
|
m_labelVisual = compContext.CreateSpriteVisual();
|
|
30
29
|
OuterVisual().InsertAt(m_labelVisual, 1);
|
|
31
30
|
}
|
|
@@ -257,9 +257,10 @@ void FabricUIManager::RCTPerformMountInstructions(
|
|
|
257
257
|
newChildComponentView->updateEventEmitter(newChildShadowView.eventEmitter);
|
|
258
258
|
newChildComponentView->updateState(newChildShadowView.state, oldChildShadowView.state);
|
|
259
259
|
newChildComponentView->updateLayoutMetrics(newChildShadowView.layoutMetrics, oldChildShadowView.layoutMetrics);
|
|
260
|
-
|
|
260
|
+
newChildComponentView->FinalizeUpdates(winrt::Microsoft::ReactNative::ComponentViewUpdateMask::All);
|
|
261
261
|
|
|
262
|
-
parentViewDescriptor.view
|
|
262
|
+
winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(parentViewDescriptor.view)
|
|
263
|
+
->MountChildComponentView(*newChildComponentView, mutation.index);
|
|
263
264
|
break;
|
|
264
265
|
}
|
|
265
266
|
|
|
@@ -268,7 +269,8 @@ void FabricUIManager::RCTPerformMountInstructions(
|
|
|
268
269
|
auto &parentShadowView = mutation.parentShadowView;
|
|
269
270
|
auto &oldChildViewDescriptor = m_registry.componentViewDescriptorWithTag(oldChildShadowView.tag);
|
|
270
271
|
auto &parentViewDescriptor = m_registry.componentViewDescriptorWithTag(parentShadowView.tag);
|
|
271
|
-
parentViewDescriptor.view
|
|
272
|
+
winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(parentViewDescriptor.view)
|
|
273
|
+
->UnmountChildComponentView(oldChildViewDescriptor.view, mutation.index);
|
|
272
274
|
break;
|
|
273
275
|
}
|
|
274
276
|
|
|
@@ -302,7 +304,8 @@ void FabricUIManager::RCTPerformMountInstructions(
|
|
|
302
304
|
}
|
|
303
305
|
|
|
304
306
|
if (mask != winrt::Microsoft::ReactNative::ComponentViewUpdateMask::None) {
|
|
305
|
-
newChildViewDescriptor.view
|
|
307
|
+
winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(newChildViewDescriptor.view)
|
|
308
|
+
->FinalizeUpdates(mask);
|
|
306
309
|
}
|
|
307
310
|
|
|
308
311
|
break;
|
|
@@ -387,15 +390,15 @@ void FabricUIManager::schedulerDidDispatchCommand(
|
|
|
387
390
|
folly::dynamic const &arg) {
|
|
388
391
|
if (m_context.UIDispatcher().HasThreadAccess()) {
|
|
389
392
|
auto descriptor = m_registry.componentViewDescriptorWithTag(shadowView.tag);
|
|
390
|
-
descriptor.view
|
|
391
|
-
winrt::to_hstring(commandName), winrt::make<winrt::Microsoft::ReactNative::DynamicReader>(arg));
|
|
393
|
+
winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(descriptor.view)
|
|
394
|
+
->HandleCommand(winrt::to_hstring(commandName), winrt::make<winrt::Microsoft::ReactNative::DynamicReader>(arg));
|
|
392
395
|
} else {
|
|
393
396
|
m_context.UIDispatcher().Post(
|
|
394
397
|
[wkThis = weak_from_this(), commandName, tag = shadowView.tag, args = folly::dynamic(arg)]() {
|
|
395
398
|
if (auto pThis = wkThis.lock()) {
|
|
396
399
|
auto view = pThis->m_registry.findComponentViewWithTag(tag);
|
|
397
400
|
if (view) {
|
|
398
|
-
view
|
|
401
|
+
winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(view)->HandleCommand(
|
|
399
402
|
winrt::to_hstring(commandName), winrt::make<winrt::Microsoft::ReactNative::DynamicReader>(args));
|
|
400
403
|
}
|
|
401
404
|
}
|
|
@@ -74,9 +74,7 @@ void WindowsComponentDescriptorRegistry::Add(
|
|
|
74
74
|
m_descriptorFlavors.back()->c_str(),
|
|
75
75
|
std::static_pointer_cast<void const>(m_descriptorFlavors.back()),
|
|
76
76
|
winrt::get_self<winrt::Microsoft::ReactNative::Composition::ReactCompositionViewComponentBuilder>(builder)
|
|
77
|
-
|
|
78
|
-
? &facebook::react::concreteComponentDescriptorConstructor<AbiViewComponentDescriptor>
|
|
79
|
-
: &facebook::react::concreteComponentDescriptorConstructor<AbiComponentDescriptor>});
|
|
77
|
+
->GetComponentDescriptorProvider()});
|
|
80
78
|
}
|
|
81
79
|
|
|
82
80
|
winrt::Microsoft::ReactNative::IReactViewComponentBuilder WindowsComponentDescriptorRegistry::GetDescriptor(
|
|
@@ -26,7 +26,23 @@ HostPlatformViewProps::HostPlatformViewProps(
|
|
|
26
26
|
focusable(
|
|
27
27
|
CoreFeatures::enablePropIteratorSetter
|
|
28
28
|
? sourceProps.focusable
|
|
29
|
-
: convertRawProp(context, rawProps, "focusable", sourceProps.focusable, {}))
|
|
29
|
+
: convertRawProp(context, rawProps, "focusable", sourceProps.focusable, {})),
|
|
30
|
+
accessibilityPosInSet(
|
|
31
|
+
CoreFeatures::enablePropIteratorSetter
|
|
32
|
+
? sourceProps.accessibilityPosInSet
|
|
33
|
+
: convertRawProp(context, rawProps, "accessibilityPosInSet", sourceProps.accessibilityPosInSet, 0)),
|
|
34
|
+
accessibilitySetSize(
|
|
35
|
+
CoreFeatures::enablePropIteratorSetter
|
|
36
|
+
? sourceProps.accessibilitySetSize
|
|
37
|
+
: convertRawProp(context, rawProps, "accessibilitySetSize", sourceProps.accessibilitySetSize, 0)),
|
|
38
|
+
accessibilityLiveRegion(
|
|
39
|
+
CoreFeatures::enablePropIteratorSetter ? sourceProps.accessibilityLiveRegion
|
|
40
|
+
: convertRawProp(
|
|
41
|
+
context,
|
|
42
|
+
rawProps,
|
|
43
|
+
"accessibilityLiveRegion",
|
|
44
|
+
sourceProps.accessibilityLiveRegion,
|
|
45
|
+
"none")) {}
|
|
30
46
|
|
|
31
47
|
#define WINDOWS_VIEW_EVENT_CASE(eventType) \
|
|
32
48
|
case CONSTEXPR_RAW_PROPS_KEY_HASH("on" #eventType): { \
|
|
@@ -61,6 +77,9 @@ void HostPlatformViewProps::setProp(
|
|
|
61
77
|
WINDOWS_VIEW_EVENT_CASE(MouseLeave);
|
|
62
78
|
RAW_SET_PROP_SWITCH_CASE_BASIC(enableFocusRing);
|
|
63
79
|
RAW_SET_PROP_SWITCH_CASE_BASIC(focusable);
|
|
80
|
+
RAW_SET_PROP_SWITCH_CASE_BASIC(accessibilityPosInSet);
|
|
81
|
+
RAW_SET_PROP_SWITCH_CASE_BASIC(accessibilitySetSize);
|
|
82
|
+
RAW_SET_PROP_SWITCH_CASE_BASIC(accessibilityLiveRegion);
|
|
64
83
|
RAW_SET_PROP_SWITCH_CASE_BASIC(keyDownEvents);
|
|
65
84
|
RAW_SET_PROP_SWITCH_CASE_BASIC(keyUpEvents);
|
|
66
85
|
}
|
package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.h
CHANGED
|
@@ -24,6 +24,9 @@ class HostPlatformViewProps : public BaseViewProps {
|
|
|
24
24
|
WindowsViewEvents windowsEvents{};
|
|
25
25
|
bool enableFocusRing{true};
|
|
26
26
|
bool focusable{false};
|
|
27
|
+
int accessibilityPosInSet{0};
|
|
28
|
+
int accessibilitySetSize{0};
|
|
29
|
+
std::string accessibilityLiveRegion{"none"};
|
|
27
30
|
|
|
28
31
|
// std::optional<std::string> overflowAnchor{};
|
|
29
32
|
// std::optional<std::string> tooltip{};
|
|
@@ -13,16 +13,26 @@ import "CompositionComponentView.idl";
|
|
|
13
13
|
|
|
14
14
|
namespace Microsoft.ReactNative.Composition
|
|
15
15
|
{
|
|
16
|
+
[webhosthidden]
|
|
17
|
+
[experimental]
|
|
18
|
+
delegate void ViewComponentViewInitializer(ViewComponentView view);
|
|
19
|
+
|
|
20
|
+
[webhosthidden]
|
|
16
21
|
[experimental]
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
delegate void ComponentIslandComponentViewInitializer(ContentIslandComponentView view);
|
|
23
|
+
|
|
24
|
+
[experimental]
|
|
25
|
+
[webhosthidden]
|
|
26
|
+
delegate Microsoft.UI.Composition.Visual CreateVisualDelegate(Microsoft.ReactNative.ComponentView view);
|
|
19
27
|
|
|
20
28
|
[webhosthidden]
|
|
21
29
|
[experimental]
|
|
22
30
|
DOC_STRING(".")
|
|
23
31
|
interface IReactCompositionViewComponentBuilder
|
|
24
32
|
{
|
|
25
|
-
void
|
|
33
|
+
void SetViewComponentViewInitializer(ViewComponentViewInitializer initializer);
|
|
34
|
+
void SetContentIslandComponentViewInitializer(ComponentIslandComponentViewInitializer initializer);
|
|
35
|
+
void SetCreateVisualHandler(CreateVisualDelegate impl);
|
|
26
36
|
};
|
|
27
37
|
|
|
28
38
|
} // namespace Microsoft.ReactNative
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import "ViewProps.idl";
|
|
5
5
|
import "ComponentView.idl";
|
|
6
|
+
import "IJSValueWriter.idl";
|
|
6
7
|
|
|
7
8
|
#include "DocString.h"
|
|
8
9
|
|
|
@@ -34,6 +35,18 @@ namespace Microsoft.ReactNative
|
|
|
34
35
|
LayoutDirection LayoutDirection;
|
|
35
36
|
};
|
|
36
37
|
|
|
38
|
+
[experimental]
|
|
39
|
+
runtimeclass MountChildComponentViewArgs {
|
|
40
|
+
ComponentView Child { get; };
|
|
41
|
+
UInt32 Index { get; };
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
[experimental]
|
|
45
|
+
runtimeclass UnmountChildComponentViewArgs {
|
|
46
|
+
ComponentView Child { get; };
|
|
47
|
+
UInt32 Index { get; };
|
|
48
|
+
};
|
|
49
|
+
|
|
37
50
|
[experimental]
|
|
38
51
|
DOC_STRING("A delegate that creates a @IComponentProps object for an instance of @ViewProps. See @IReactViewComponentBuilder.SetCreateProps")
|
|
39
52
|
delegate IComponentProps ViewPropsFactory(ViewProps props);
|
|
@@ -54,15 +67,39 @@ namespace Microsoft.ReactNative
|
|
|
54
67
|
delegate Object InitialStateDataFactory(IComponentProps props);
|
|
55
68
|
|
|
56
69
|
[experimental]
|
|
57
|
-
DOC_STRING("Provides a
|
|
58
|
-
delegate
|
|
70
|
+
DOC_STRING("Provides a method to initialize an instance of a ComponentView. See @IReactViewComponentBuilder.SetComponentViewInitializer")
|
|
71
|
+
delegate void ComponentViewInitializer(ComponentView view);
|
|
72
|
+
|
|
73
|
+
[experimental]
|
|
74
|
+
delegate void HandleCommandDelegate(ComponentView source, String commandName, IJSValueReader args);
|
|
75
|
+
|
|
76
|
+
[experimental]
|
|
77
|
+
delegate void UpdateFinalizerDelegate(ComponentView source, ComponentViewUpdateMask updateMask);
|
|
78
|
+
|
|
79
|
+
[experimental]
|
|
80
|
+
delegate void UpdatePropsDelegate(ComponentView source, IComponentProps newProps, IComponentProps oldProps);
|
|
81
|
+
|
|
82
|
+
[experimental]
|
|
83
|
+
delegate void UpdateStateDelegate(ComponentView source, IComponentState newState);
|
|
84
|
+
|
|
85
|
+
[experimental]
|
|
86
|
+
delegate void MountChildComponentViewDelegate(ComponentView source, MountChildComponentViewArgs args);
|
|
87
|
+
|
|
88
|
+
[experimental]
|
|
89
|
+
delegate void UnmountChildComponentViewDelegate(ComponentView source, UnmountChildComponentViewArgs args);
|
|
90
|
+
|
|
91
|
+
[experimental]
|
|
92
|
+
runtimeclass EventEmitter {
|
|
93
|
+
void DispatchEvent(String eventName, JSValueArgWriter args);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
[experimental]
|
|
97
|
+
delegate void UpdateEventEmitterDelegate(ComponentView source, EventEmitter eventEmitter);
|
|
59
98
|
|
|
60
99
|
[webhosthidden]
|
|
61
100
|
[experimental]
|
|
62
101
|
interface IReactViewComponentBuilder
|
|
63
102
|
{
|
|
64
|
-
void SetCreateComponentView(ComponentViewFactory impl);
|
|
65
|
-
|
|
66
103
|
DOC_STRING("Create an implementation of your custom Props type that will be passed to your components @Composition.ICompositionViewComponent.UpdateProps method.")
|
|
67
104
|
void SetCreateProps(ViewPropsFactory impl);
|
|
68
105
|
|
|
@@ -71,9 +108,24 @@ namespace Microsoft.ReactNative
|
|
|
71
108
|
void SetInitialStateDataFactory(InitialStateDataFactory impl);
|
|
72
109
|
void SetMeasureContentHandler(MeasureContentHandler impl);
|
|
73
110
|
void SetLayoutHandler(LayoutHandler impl);
|
|
111
|
+
|
|
112
|
+
void SetComponentViewInitializer(ComponentViewInitializer initializer);
|
|
113
|
+
void SetCustomCommandHandler(HandleCommandDelegate impl);
|
|
114
|
+
void SetFinalizeUpdateHandler(UpdateFinalizerDelegate impl);
|
|
115
|
+
void SetUpdatePropsHandler(UpdatePropsDelegate impl);
|
|
116
|
+
void SetUpdateStateHandler(UpdateStateDelegate impl);
|
|
117
|
+
void SetUpdateEventEmitterHandler(UpdateEventEmitterDelegate impl);
|
|
118
|
+
void SetMountChildComponentViewHandler(MountChildComponentViewDelegate impl);
|
|
119
|
+
void SetUnmountChildComponentViewHandler(UnmountChildComponentViewDelegate impl);
|
|
74
120
|
};
|
|
75
121
|
|
|
122
|
+
// [exclusiveto(ShadowNode)]
|
|
123
|
+
// [uuid(BF2A2A64-AB8B-47FC-BE69-E31DE6FC29A4)]
|
|
124
|
+
// interface IShadowNodeFactory
|
|
125
|
+
// {
|
|
126
|
+
// }
|
|
76
127
|
|
|
128
|
+
// [composable(IShadowNodeFactory, protected)]
|
|
77
129
|
[webhosthidden]
|
|
78
130
|
[experimental]
|
|
79
131
|
unsealed runtimeclass ShadowNode
|
|
@@ -81,6 +133,7 @@ namespace Microsoft.ReactNative
|
|
|
81
133
|
void EnsureUnsealed();
|
|
82
134
|
Object Tag { get; set; };
|
|
83
135
|
Object StateData{ get; set; };
|
|
136
|
+
EventEmitter EventEmitter { get; };
|
|
84
137
|
};
|
|
85
138
|
|
|
86
139
|
[webhosthidden]
|
|
@@ -118,11 +118,6 @@ using namespace winrt::Microsoft::ReactNative;
|
|
|
118
118
|
|
|
119
119
|
namespace Mso::React {
|
|
120
120
|
|
|
121
|
-
std::string getApplicationTempFolder() {
|
|
122
|
-
auto local = winrt::Windows::Storage::ApplicationData::Current().TemporaryFolder().Path();
|
|
123
|
-
return Microsoft::Common::Unicode::Utf16ToUtf8(local.c_str(), local.size()) + "\\";
|
|
124
|
-
}
|
|
125
|
-
|
|
126
121
|
//=============================================================================================
|
|
127
122
|
// LoadedCallbackGuard ensures that the OnReactInstanceLoaded is always called.
|
|
128
123
|
// It calls OnReactInstanceLoaded in destructor with a cancellation error.
|
|
@@ -573,6 +568,15 @@ Mso::DispatchQueueSettings CreateDispatchQueueSettings(
|
|
|
573
568
|
return queueSettings;
|
|
574
569
|
}
|
|
575
570
|
|
|
571
|
+
std::unique_ptr<facebook::jsi::PreparedScriptStore> CreatePreparedScriptStore() noexcept {
|
|
572
|
+
std::unique_ptr<facebook::jsi::PreparedScriptStore> preparedScriptStore = nullptr;
|
|
573
|
+
wchar_t tempPath[MAX_PATH];
|
|
574
|
+
if (GetTempPathW(static_cast<DWORD>(std::size(tempPath)), tempPath)) {
|
|
575
|
+
preparedScriptStore = std::make_unique<facebook::react::BasePreparedScriptStoreImpl>(winrt::to_string(tempPath));
|
|
576
|
+
}
|
|
577
|
+
return preparedScriptStore;
|
|
578
|
+
}
|
|
579
|
+
|
|
576
580
|
#ifdef USE_FABRIC
|
|
577
581
|
void ReactInstanceWin::InitializeBridgeless() noexcept {
|
|
578
582
|
InitUIQueue();
|
|
@@ -640,7 +644,7 @@ void ReactInstanceWin::InitializeBridgeless() noexcept {
|
|
|
640
644
|
}
|
|
641
645
|
|
|
642
646
|
m_jsiRuntimeHolder = std::make_shared<Microsoft::ReactNative::HermesRuntimeHolder>(
|
|
643
|
-
devSettings, m_jsMessageThread.Load(),
|
|
647
|
+
devSettings, m_jsMessageThread.Load(), CreatePreparedScriptStore());
|
|
644
648
|
auto jsRuntime = std::make_unique<Microsoft::ReactNative::HermesJSRuntime>(m_jsiRuntimeHolder);
|
|
645
649
|
jsRuntime->getRuntime();
|
|
646
650
|
m_bridgelessReactInstance = std::make_unique<facebook::react::ReactInstance>(
|
|
@@ -657,7 +661,8 @@ void ReactInstanceWin::InitializeBridgeless() noexcept {
|
|
|
657
661
|
facebook::react::ReactInstance::JSRuntimeFlags options;
|
|
658
662
|
m_bridgelessReactInstance->initializeRuntime(options, [=](facebook::jsi::Runtime &runtime) {
|
|
659
663
|
auto logger = [loggingHook = GetLoggingCallback()](const std::string &message, unsigned int logLevel) {
|
|
660
|
-
|
|
664
|
+
if (loggingHook)
|
|
665
|
+
loggingHook(static_cast<facebook::react::RCTLogLevel>(logLevel), message.c_str());
|
|
661
666
|
};
|
|
662
667
|
facebook::react::bindNativeLogger(runtime, logger);
|
|
663
668
|
|
|
@@ -713,19 +718,6 @@ void ReactInstanceWin::InitializeBridgeless() noexcept {
|
|
|
713
718
|
}
|
|
714
719
|
#endif
|
|
715
720
|
|
|
716
|
-
std::unique_ptr<facebook::jsi::PreparedScriptStore> ReactInstanceWin::CreateHermesPreparedScriptStore() noexcept {
|
|
717
|
-
std::unique_ptr<facebook::jsi::PreparedScriptStore> preparedScriptStore = nullptr;
|
|
718
|
-
if (Microsoft::ReactNative::HasPackageIdentity()) {
|
|
719
|
-
preparedScriptStore = std::make_unique<facebook::react::BasePreparedScriptStoreImpl>(getApplicationTempFolder());
|
|
720
|
-
} else {
|
|
721
|
-
wchar_t tempPath[MAX_PATH];
|
|
722
|
-
if (GetTempPathW(static_cast<DWORD>(std::size(tempPath)), tempPath)) {
|
|
723
|
-
preparedScriptStore = std::make_unique<facebook::react::BasePreparedScriptStoreImpl>(winrt::to_string(tempPath));
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
return preparedScriptStore;
|
|
727
|
-
}
|
|
728
|
-
|
|
729
721
|
void ReactInstanceWin::FireInstanceCreatedCallback() noexcept {
|
|
730
722
|
// The InstanceCreated event can be used to augment the JS environment for all JS code. So it needs to be
|
|
731
723
|
// triggered before any platform JS code is run. Using m_jsMessageThread instead of jsDispatchQueue avoids
|
|
@@ -803,7 +795,7 @@ void ReactInstanceWin::InitializeWithBridge() noexcept {
|
|
|
803
795
|
} else {
|
|
804
796
|
switch (m_options.JsiEngine()) {
|
|
805
797
|
case JSIEngine::Hermes: {
|
|
806
|
-
preparedScriptStore =
|
|
798
|
+
preparedScriptStore = CreatePreparedScriptStore();
|
|
807
799
|
|
|
808
800
|
auto hermesRuntimeHolder = std::make_shared<Microsoft::ReactNative::HermesRuntimeHolder>(
|
|
809
801
|
devSettings, m_jsMessageThread.Load(), std::move(preparedScriptStore));
|
|
@@ -815,17 +807,7 @@ void ReactInstanceWin::InitializeWithBridge() noexcept {
|
|
|
815
807
|
case JSIEngine::V8:
|
|
816
808
|
#if defined(USE_V8)
|
|
817
809
|
{
|
|
818
|
-
|
|
819
|
-
preparedScriptStore =
|
|
820
|
-
std::make_unique<facebook::react::BasePreparedScriptStoreImpl>(getApplicationTempFolder());
|
|
821
|
-
} else {
|
|
822
|
-
wchar_t tempPath[MAX_PATH];
|
|
823
|
-
if (GetTempPathW(static_cast<DWORD>(std::size(tempPath)), tempPath)) {
|
|
824
|
-
preparedScriptStore =
|
|
825
|
-
std::make_unique<facebook::react::BasePreparedScriptStoreImpl>(winrt::to_string(tempPath));
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
|
|
810
|
+
preparedScriptStore = CreatePreparedScriptStore();
|
|
829
811
|
bool enableMultiThreadSupport{false};
|
|
830
812
|
#ifdef USE_FABRIC
|
|
831
813
|
enableMultiThreadSupport = Microsoft::ReactNative::IsFabricEnabled(m_reactContext->Properties());
|
|
@@ -11,4 +11,5 @@
|
|
|
11
11
|
<Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Common.props" />
|
|
12
12
|
<!-- Fixes NuGet restore issues: -->
|
|
13
13
|
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\NuGet.CSharp.props" />
|
|
14
|
+
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\WinUI.props" />
|
|
14
15
|
</Project>
|
|
@@ -14,5 +14,9 @@
|
|
|
14
14
|
<!-- Needed for ucrtbased.dll when running a debug build. -->
|
|
15
15
|
<SDKReference Include="Microsoft.VCLibs, Version=14.0" Condition="'$(Configuration)' == 'Debug'" />
|
|
16
16
|
</ItemGroup>
|
|
17
|
+
|
|
18
|
+
<ItemGroup Condition="'$(UseExperimentalNuget)' == 'true'">
|
|
19
|
+
<PackageReference Include="$(WinUIPackageName)" Version="$(WinUIPackageVersion)" Condition="'$(OverrideWinUIPackage)'!='true'" />
|
|
20
|
+
</ItemGroup>
|
|
17
21
|
|
|
18
22
|
</Project>
|
|
@@ -5,8 +5,18 @@
|
|
|
5
5
|
-->
|
|
6
6
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
7
7
|
<!-- Only include Microsoft.ReactNative.* NuGet packages that C++ (app and lib) projects need when using UseExperimentalNuget. -->
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
<Choose>
|
|
9
|
+
<When Condition="'$(UseFabric)' == 'true'">
|
|
10
|
+
<ItemGroup>
|
|
11
|
+
<PackageReference Include="Microsoft.ReactNative" Version="$(ReactNativeWindowsVersion)-Fabric" />
|
|
12
|
+
<PackageReference Include="Microsoft.ReactNative.Cxx" Version="$(ReactNativeWindowsVersion)-Fabric" />
|
|
13
|
+
</ItemGroup>
|
|
14
|
+
</When>
|
|
15
|
+
<Otherwise>
|
|
16
|
+
<ItemGroup>
|
|
17
|
+
<PackageReference Include="Microsoft.ReactNative" Version="$(ReactNativeWindowsVersion)" />
|
|
18
|
+
<PackageReference Include="Microsoft.ReactNative.Cxx" Version="$(ReactNativeWindowsVersion)" />
|
|
19
|
+
</ItemGroup>
|
|
20
|
+
</Otherwise>
|
|
21
|
+
</Choose>
|
|
12
22
|
</Project>
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.74.
|
|
13
|
+
<ReactNativeWindowsVersion>0.74.21</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>74</ReactNativeWindowsMinor>
|
|
16
|
-
<ReactNativeWindowsPatch>
|
|
16
|
+
<ReactNativeWindowsPatch>21</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
|
-
<ReactNativeWindowsCommitId>
|
|
18
|
+
<ReactNativeWindowsCommitId>cd70c894ca067363614e483ac519e18d57a96a72</ReactNativeWindowsCommitId>
|
|
19
19
|
</PropertyGroup>
|
|
20
20
|
</Project>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
For local testing of internal versions, modify the WinUI3Version, and comment out the addition nuget source in NuGet.Config
|
|
8
8
|
-->
|
|
9
9
|
<!-- This value is also used by the CLI, see /packages/@react-native-windows/generate-windows -->
|
|
10
|
-
<WinUI3Version Condition="'$(WinUI3Version)'=='' AND '$(UseExperimentalWinUI3)'=='true'">1.
|
|
10
|
+
<WinUI3Version Condition="'$(WinUI3Version)'=='' AND '$(UseExperimentalWinUI3)'=='true'">1.6.240701003-experimental2</WinUI3Version>
|
|
11
11
|
<WinUI3Version Condition="'$(WinUI3Version)'==''">1.5.240227000</WinUI3Version>
|
|
12
12
|
</PropertyGroup>
|
|
13
13
|
|
|
@@ -66,6 +66,8 @@
|
|
|
66
66
|
|
|
67
67
|
<PropertyGroup>
|
|
68
68
|
<_ReactNativeWindowsVersionCheckNugetVersion>$$nuGetPackageVersion$$</_ReactNativeWindowsVersionCheckNugetVersion>
|
|
69
|
+
<!-- Strip out the -Fabric qualifier from the version string if present -->
|
|
70
|
+
<_ReactNativeWindowsVersionCheckNugetVersion>$(_ReactNativeWindowsVersionCheckNugetVersion.Replace('-Fabric', ''))</_ReactNativeWindowsVersionCheckNugetVersion>
|
|
69
71
|
</PropertyGroup>
|
|
70
72
|
|
|
71
73
|
<!-- Validate package.json file -->
|
package/Shared/Shared.vcxitems
CHANGED
|
@@ -89,6 +89,10 @@
|
|
|
89
89
|
<DependentUpon>$(ReactNativeWindowsDir)Microsoft.ReactNative\UriImageManager.idl</DependentUpon>
|
|
90
90
|
<SubType>Code</SubType>
|
|
91
91
|
</ClCompile>
|
|
92
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\ContentIslandComponentView.cpp">
|
|
93
|
+
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
|
|
94
|
+
<DependentUpon>$(ReactNativeWindowsDir)Microsoft.ReactNative\CompositionComponentView.idl</DependentUpon>
|
|
95
|
+
</ClCompile>
|
|
92
96
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionViewComponentView.cpp">
|
|
93
97
|
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
|
|
94
98
|
</ClCompile>
|
|
@@ -155,6 +159,9 @@
|
|
|
155
159
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiViewComponentDescriptor.cpp">
|
|
156
160
|
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
|
|
157
161
|
</ClCompile>
|
|
162
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiEventEmitter.cpp">
|
|
163
|
+
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
|
|
164
|
+
</ClCompile>
|
|
158
165
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiViewProps.cpp">
|
|
159
166
|
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
|
|
160
167
|
</ClCompile>
|
|
@@ -323,6 +323,7 @@
|
|
|
323
323
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\utils\jsi-utils.cpp" />
|
|
324
324
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\TextDrawing.cpp" />
|
|
325
325
|
<ClCompile Include="$(MSBuildThisFileDirectory)Networking\NetworkPropertyIds.cpp" />
|
|
326
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiEventEmitter.cpp" />
|
|
326
327
|
</ItemGroup>
|
|
327
328
|
<ItemGroup>
|
|
328
329
|
<Filter Include="Source Files">
|
package/just-task.js
CHANGED
|
@@ -28,7 +28,7 @@ option('clean');
|
|
|
28
28
|
|
|
29
29
|
function codegen(test) {
|
|
30
30
|
execSync(
|
|
31
|
-
`react-native-windows-codegen --files src/**/*Native*.js --namespace Microsoft::ReactNativeSpecs --libraryName rnwcore --modulesWindows --modulesCxx${
|
|
31
|
+
`react-native-windows-codegen --files src/**/*Native*.js --namespace Microsoft::ReactNativeSpecs --libraryName rnwcore --modulesWindows --internalComponents --modulesCxx${
|
|
32
32
|
test ? ' --test' : ''
|
|
33
33
|
}`,
|
|
34
34
|
{env: process.env},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-windows",
|
|
3
|
-
"version": "0.74.
|
|
3
|
+
"version": "0.74.21",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@react-native-community/cli": "13.6.9",
|
|
27
27
|
"@react-native-community/cli-platform-android": "13.6.9",
|
|
28
28
|
"@react-native-community/cli-platform-ios": "13.6.9",
|
|
29
|
-
"@react-native-windows/cli": "0.74.
|
|
29
|
+
"@react-native-windows/cli": "0.74.5",
|
|
30
30
|
"@react-native/assets": "1.0.0",
|
|
31
31
|
"@react-native/assets-registry": "0.74.87",
|
|
32
32
|
"@react-native/codegen": "0.74.87",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"yargs": "^17.6.2"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@react-native-windows/codegen": "0.74.
|
|
67
|
+
"@react-native-windows/codegen": "0.74.3",
|
|
68
68
|
"@react-native/metro-config": "0.74.87",
|
|
69
69
|
"@rnw-scripts/babel-react-native-config": "0.0.0",
|
|
70
70
|
"@rnw-scripts/eslint-config": "1.2.9",
|