react-native-windows 0.66.2 → 0.66.3

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/CHANGELOG.json CHANGED
@@ -2,7 +2,28 @@
2
2
  "name": "react-native-windows",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 25 Oct 2021 15:07:02 GMT",
5
+ "date": "Mon, 01 Nov 2021 19:10:15 GMT",
6
+ "tag": "react-native-windows_v0.66.3",
7
+ "version": "0.66.3",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "comment": "Fix Microsoft.ReactNative.dll version string",
12
+ "author": "asklar@microsoft.com",
13
+ "commit": "61da34482a055ee52ba23b826d154a7a9fbf0bee",
14
+ "package": "react-native-windows"
15
+ },
16
+ {
17
+ "comment": "Fix crash when using TextInput.blur()",
18
+ "author": "30809111+acoates-ms@users.noreply.github.com",
19
+ "commit": "da602613ebf5593feebb432bffd8a14f0679f2cc",
20
+ "package": "react-native-windows"
21
+ }
22
+ ]
23
+ }
24
+ },
25
+ {
26
+ "date": "Mon, 25 Oct 2021 15:07:26 GMT",
6
27
  "tag": "react-native-windows_v0.66.2",
7
28
  "version": "0.66.2",
8
29
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,21 +1,30 @@
1
1
  # Change Log - react-native-windows
2
2
 
3
- This log was last generated on Mon, 25 Oct 2021 15:07:02 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 01 Nov 2021 19:10:15 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## 0.66.2
7
+ ## 0.66.3
8
8
 
9
- Mon, 25 Oct 2021 15:07:02 GMT
9
+ Mon, 01 Nov 2021 19:10:15 GMT
10
10
 
11
11
  ### Patches
12
12
 
13
- - Add more symbols to Hermes DLL Loader Shim (ngerlem@microsoft.com)
14
- - Fix win32 apps referencing the M.RN nuget package so they can use RNW (asklar@microsoft.com)
15
- - Fix EBUSY race conditions between metro bundler and msbuild (dannyvv@microsoft.com)
16
- - Fix crash when direct debugging Chakra (anandrag@microsoft.com)
17
- - Fix AppTheme Regressions (ngerlem@microsoft.com)
13
+ - Fix Microsoft.ReactNative.dll version string (asklar@microsoft.com)
14
+ - Fix crash when using TextInput.blur() (30809111+acoates-ms@users.noreply.github.com)
18
15
 
16
+ ## 0.66.2
17
+
18
+ Mon, 25 Oct 2021 15:07:26 GMT
19
+
20
+ ### Patches
21
+
22
+ - Add more symbols to Hermes DLL Loader Shim (ngerlem@microsoft.com)
23
+ - Fix win32 apps referencing the M.RN nuget package so they can use RNW (asklar@microsoft.com)
24
+ - Fix EBUSY race conditions between metro bundler and msbuild (dannyvv@microsoft.com)
25
+ - Fix crash when direct debugging Chakra (anandrag@microsoft.com)
26
+ - Fix AppTheme Regressions (ngerlem@microsoft.com)
27
+
19
28
  ## 0.66.1
20
29
 
21
30
  Mon, 18 Oct 2021 15:08:36 GMT
@@ -173,11 +173,9 @@ struct RootShadowNode final : public ShadowNodeBase {
173
173
  }
174
174
 
175
175
  void AddView(ShadowNode &child, int64_t index) override {
176
- auto panel(GetView().as<winrt::Panel>());
177
- if (panel != nullptr) {
178
- auto childView = static_cast<ShadowNodeBase &>(child).GetView().as<xaml::UIElement>();
179
- panel.Children().InsertAt(static_cast<uint32_t>(index), childView);
180
- }
176
+ auto panel(GetView().as<winrt::Microsoft::ReactNative::ReactRootView>());
177
+ winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactRootView>(panel)->AddView(
178
+ static_cast<uint32_t>(index), static_cast<ShadowNodeBase &>(child).GetView().as<xaml::UIElement>());
181
179
  }
182
180
  };
183
181
 
@@ -337,9 +337,6 @@ void ReactRootView::ShowInstanceLoading() noexcept {
337
337
 
338
338
  void ReactRootView::EnsureFocusSafeHarbor() noexcept {
339
339
  if (!m_focusSafeHarbor) {
340
- // focus safe harbor is delayed to be inserted to the visual tree
341
- VerifyElseCrash(Children().Size() == 1);
342
-
343
340
  m_focusSafeHarbor = xaml::Controls::ContentControl{};
344
341
  m_focusSafeHarbor.Width(0.0);
345
342
  m_focusSafeHarbor.IsTabStop(false);
@@ -526,4 +523,32 @@ Windows::Foundation::Size ReactRootView::ArrangeOverride(Windows::Foundation::Si
526
523
  return finalSize;
527
524
  }
528
525
 
526
+ // Maps react-native's view of the root view to the actual UI
527
+ // react-native is unaware that there are non-RN elements within the ReactRootView
528
+ uint32_t ReactRootView::RNIndexToXamlIndex(uint32_t index) noexcept {
529
+ // If m_focusSafeHarbor exists, it should be at index 0
530
+ // m_xamlRootView is the next element, followed by any RN content.
531
+ #if DEBUG
532
+ uint32_t findIndex{0};
533
+ Assert(!m_focusSafeHarbor || Children().IndexOf(m_focusSafeHarbor, findIndex) && findIndex == 0);
534
+ Assert(Children().IndexOf(m_xamlRootView, findIndex) && findIndex == (m_focusSafeHarbor ? 1 : 0));
535
+ #endif
536
+
537
+ return index + (m_focusSafeHarbor ? 2 : 1);
538
+ }
539
+
540
+ void ReactRootView::AddView(uint32_t index, xaml::UIElement child) {
541
+ Children().InsertAt(RNIndexToXamlIndex(index), child);
542
+ }
543
+
544
+ void ReactRootView::RemoveAllChildren() {
545
+ const uint32_t numLeft = m_focusSafeHarbor ? 2 : 1;
546
+ while (Children().Size() > numLeft)
547
+ Children().RemoveAt(numLeft);
548
+ }
549
+
550
+ void ReactRootView::RemoveChildAt(uint32_t index) {
551
+ Children().RemoveAt(RNIndexToXamlIndex(index));
552
+ }
553
+
529
554
  } // namespace winrt::Microsoft::ReactNative::implementation
@@ -42,6 +42,11 @@ struct ReactRootView : ReactRootViewT<ReactRootView>, ::Microsoft::ReactNative::
42
42
 
43
43
  void ReloadView() noexcept;
44
44
 
45
+ // Used by RootViewManager
46
+ void AddView(uint32_t index, xaml::UIElement child);
47
+ void RemoveAllChildren();
48
+ void RemoveChildAt(uint32_t index);
49
+
45
50
  public: // IXamlRootView
46
51
  ::Microsoft::ReactNative::XamlView GetXamlView() const noexcept override;
47
52
 
@@ -98,6 +103,7 @@ struct ReactRootView : ReactRootViewT<ReactRootView>, ::Microsoft::ReactNative::
98
103
  // JS created children
99
104
  winrt::Grid m_xamlRootView{nullptr};
100
105
 
106
+ uint32_t RNIndexToXamlIndex(uint32_t index) noexcept;
101
107
  void UpdatePerspective();
102
108
  void UpdateRootViewInternal() noexcept;
103
109
  void ClearLoadingUI() noexcept;
@@ -4,7 +4,7 @@
4
4
  #define STRINGIZE(s) #s
5
5
 
6
6
  #ifdef RNW_PKG_VERSION_STR
7
- #define VER_FILEVERSION_STR STRINGIZE(RNW_PKG_VERSION_STR)
7
+ #define VER_FILEVERSION_STR XSTRINGIZE(RNW_PKG_VERSION_STR)
8
8
  #else
9
9
  #define VER_FILEVERSION_STR "Private Build"
10
10
  #endif
@@ -6,6 +6,7 @@
6
6
  #include "RootViewManager.h"
7
7
 
8
8
  #include <IXamlRootView.h>
9
+ #include <ReactRootView.h>
9
10
  #include <UI.Xaml.Controls.h>
10
11
 
11
12
  namespace winrt {
@@ -29,21 +30,19 @@ XamlView RootViewManager::CreateViewCore(int64_t /*tag*/, const winrt::Microsoft
29
30
  }
30
31
 
31
32
  void RootViewManager::AddView(const XamlView &parent, const XamlView &child, int64_t index) {
32
- auto panel(parent.as<winrt::Panel>());
33
- if (panel != nullptr)
34
- panel.Children().InsertAt(static_cast<uint32_t>(index), child.as<xaml::UIElement>());
33
+ // Goes through RootShadowNode::AddView instead of here
34
+ assert(false);
35
35
  }
36
36
 
37
37
  void RootViewManager::RemoveAllChildren(const XamlView &parent) {
38
- auto panel(parent.as<winrt::Panel>());
39
- if (panel != nullptr)
40
- panel.Children().Clear();
38
+ auto panel(parent.as<winrt::Microsoft::ReactNative::ReactRootView>());
39
+ winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactRootView>(panel)->RemoveAllChildren();
41
40
  }
42
41
 
43
42
  void RootViewManager::RemoveChildAt(const XamlView &parent, int64_t index) {
44
- auto panel(parent.as<winrt::Panel>());
45
- if (panel != nullptr)
46
- panel.Children().RemoveAt(static_cast<uint32_t>(index));
43
+ auto panel(parent.as<winrt::Microsoft::ReactNative::ReactRootView>());
44
+ winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactRootView>(panel)->RemoveChildAt(
45
+ static_cast<uint32_t>(index));
47
46
  }
48
47
 
49
48
  void RootViewManager::SetLayoutProps(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.66.2",
3
+ "version": "0.66.3",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",