react-native-windows 0.0.0-canary.435 → 0.0.0-canary.436

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.
Files changed (39) hide show
  1. package/.flowconfig +1 -1
  2. package/Libraries/Animated/nodes/AnimatedValue.js +8 -2
  3. package/Libraries/Components/ScrollView/ScrollView.js +8 -1
  4. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +1 -0
  5. package/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +1 -0
  6. package/Libraries/Components/ScrollView/ScrollViewViewConfig.js +1 -0
  7. package/Libraries/Components/TextInput/TextInput.js +30 -0
  8. package/Libraries/Components/TextInput/TextInput.windows.js +30 -0
  9. package/Libraries/Core/ReactNativeVersion.js +1 -1
  10. package/Libraries/Image/Image.android.js +1 -1
  11. package/Libraries/Image/Image.ios.js +1 -1
  12. package/Libraries/Image/Image.windows.js +1 -1
  13. package/Libraries/Image/TextInlineImageNativeComponent.js +1 -1
  14. package/Libraries/Pressability/HoverState.js +4 -0
  15. package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +28 -28
  16. package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +22 -33
  17. package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +23 -34
  18. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +35 -28
  19. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +22 -33
  20. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +23 -34
  21. package/Microsoft.ReactNative/ABIViewManager.cpp +4 -0
  22. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +2 -2
  23. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +2 -2
  24. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +2 -0
  25. package/Microsoft.ReactNative/Modules/Animated/DiffClampAnimatedNode.cpp +1 -1
  26. package/Microsoft.ReactNative/Views/RawTextViewManager.cpp +1 -0
  27. package/Microsoft.ReactNative/Views/TextInputViewManager.cpp +13 -0
  28. package/Microsoft.ReactNative/Views/TextViewManager.cpp +11 -0
  29. package/Microsoft.ReactNative/Views/TextViewManager.h +1 -0
  30. package/Microsoft.ReactNative/Views/ViewManagerBase.cpp +5 -9
  31. package/Microsoft.ReactNative/Views/ViewManagerBase.h +1 -0
  32. package/Microsoft.ReactNative/Views/VirtualTextViewManager.cpp +11 -0
  33. package/Microsoft.ReactNative/Views/VirtualTextViewManager.h +2 -0
  34. package/PropertySheets/Generated/PackageVersion.g.props +1 -1
  35. package/Scripts/OfficeReact.Win32.nuspec +0 -1
  36. package/Shared/Shared.vcxitems +0 -1
  37. package/Shared/Shared.vcxitems.filters +0 -3
  38. package/package.json +7 -7
  39. package/Shared/IUIManager.h +0 -90
@@ -11,7 +11,7 @@ DiffClampAnimatedNode::DiffClampAnimatedNode(
11
11
  int64_t tag,
12
12
  const folly::dynamic &config,
13
13
  const std::shared_ptr<NativeAnimatedNodeManager> &manager)
14
- : ValueAnimatedNode(tag, config, manager) {
14
+ : ValueAnimatedNode(tag, manager) {
15
15
  m_inputNodeTag = static_cast<int64_t>(config.find(s_inputName).dereference().second.asDouble());
16
16
  m_min = config.find(s_minName).dereference().second.asDouble();
17
17
  m_max = config.find(s_maxName).dereference().second.asDouble();
@@ -43,6 +43,7 @@ bool RawTextViewManager::UpdateProperty(
43
43
  return true;
44
44
 
45
45
  if (propertyName == "text") {
46
+ MarkDirty(nodeToUpdate->m_tag);
46
47
  run.Text(asHstring(propertyValue));
47
48
  static_cast<RawTextShadowNode *>(nodeToUpdate)->originalText = winrt::hstring{};
48
49
  ApplyTextTransformToChild(nodeToUpdate);
@@ -475,16 +475,20 @@ void TextInputShadowNode::updateProperties(winrt::Microsoft::ReactNative::JSValu
475
475
  auto passwordBox = control.try_as<xaml::Controls::PasswordBox>();
476
476
  auto hasKeyDownEvents = false;
477
477
 
478
+ auto markDirty = false;
478
479
  for (auto &pair : props) {
479
480
  const std::string &propertyName = pair.first;
480
481
  const auto &propertyValue = pair.second;
481
482
 
482
483
  // Applicable properties for both TextBox and PasswordBox
483
484
  if (TryUpdateFontProperties(control, propertyName, propertyValue)) {
485
+ markDirty = true;
484
486
  continue;
485
487
  } else if (TryUpdateCharacterSpacing(control, propertyName, propertyValue)) {
488
+ markDirty = true;
486
489
  continue;
487
490
  } else if (propertyName == "allowFontScaling") {
491
+ markDirty = true;
488
492
  if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Boolean)
489
493
  control.IsTextScaleFactorEnabled(propertyValue.AsBoolean());
490
494
  else if (propertyValue.IsNull())
@@ -509,6 +513,7 @@ void TextInputShadowNode::updateProperties(winrt::Microsoft::ReactNative::JSValu
509
513
  HideCaretIfNeeded();
510
514
  }
511
515
  } else if (propertyName == "secureTextEntry") {
516
+ markDirty = true;
512
517
  if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Boolean) {
513
518
  if (propertyValue.AsBoolean()) {
514
519
  if (m_isTextBox) {
@@ -537,6 +542,7 @@ void TextInputShadowNode::updateProperties(winrt::Microsoft::ReactNative::JSValu
537
542
  }
538
543
  }
539
544
  } else if (propertyName == "maxLength") {
545
+ markDirty = true;
540
546
  if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Double ||
541
547
  propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Int64) {
542
548
  control.SetValue(
@@ -613,6 +619,7 @@ void TextInputShadowNode::updateProperties(winrt::Microsoft::ReactNative::JSValu
613
619
  if (TryUpdateTextAlignment(textBox, propertyName, propertyValue)) {
614
620
  continue;
615
621
  } else if (propertyName == "multiline") {
622
+ markDirty = true;
616
623
  if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Boolean) {
617
624
  const bool isMultiline = propertyValue.AsBoolean();
618
625
  textBox.TextWrapping(isMultiline ? xaml::TextWrapping::Wrap : xaml::TextWrapping::NoWrap);
@@ -643,6 +650,7 @@ void TextInputShadowNode::updateProperties(winrt::Microsoft::ReactNative::JSValu
643
650
  else if (propertyValue.IsNull())
644
651
  textBox.ClearValue(xaml::Controls::TextBox::IsSpellCheckEnabledProperty());
645
652
  } else if (propertyName == "text") {
653
+ markDirty = true;
646
654
  SetText(propertyValue);
647
655
  } else if (propertyName == "autoCapitalize") {
648
656
  if (textBox.try_as<xaml::Controls::ITextBox6>()) {
@@ -659,12 +667,17 @@ void TextInputShadowNode::updateProperties(winrt::Microsoft::ReactNative::JSValu
659
667
  }
660
668
  } else { // Applicable properties for PasswordBox
661
669
  if (propertyName == "text" && !m_isTextBox) {
670
+ markDirty = true;
662
671
  SetText(propertyValue);
663
672
  }
664
673
  }
665
674
  }
666
675
  }
667
676
 
677
+ if (markDirty) {
678
+ GetViewManager()->MarkDirty(m_tag);
679
+ }
680
+
668
681
  Super::updateProperties(props);
669
682
 
670
683
  // We need to re-register the PreviewKeyDown handler so it is invoked after the ShadowNodeBase handler
@@ -197,6 +197,17 @@ XamlView TextViewManager::CreateViewCore(int64_t /*tag*/, const winrt::Microsoft
197
197
  return textBlock;
198
198
  }
199
199
 
200
+ void TextViewManager::UpdateProperties(
201
+ ShadowNodeBase *nodeToUpdate,
202
+ winrt::Microsoft::ReactNative::JSValueObject &props) {
203
+ // This could be optimized further, but rather than paying a penalty to mark
204
+ // the node dirty for each relevant property in UpdateProperty (which should
205
+ // be reasonably cheap given it just does an O(1) lookup of the Yoga node
206
+ // for the tag, for now this just marks the node dirty for any prop update.
207
+ MarkDirty(nodeToUpdate->m_tag);
208
+ Super::UpdateProperties(nodeToUpdate, props);
209
+ }
210
+
200
211
  bool TextViewManager::UpdateProperty(
201
212
  ShadowNodeBase *nodeToUpdate,
202
213
  const std::string &propertyName,
@@ -21,6 +21,7 @@ class TextViewManager : public FrameworkElementViewManager {
21
21
  void AddView(const XamlView &parent, const XamlView &child, int64_t index) override;
22
22
  void RemoveAllChildren(const XamlView &parent) override;
23
23
  void RemoveChildAt(const XamlView &parent, int64_t index) override;
24
+ void UpdateProperties(ShadowNodeBase *nodeToUpdate, winrt::Microsoft::ReactNative::JSValueObject &props) override;
24
25
 
25
26
  YGMeasureFunc GetYogaCustomMeasureFunc() const override;
26
27
 
@@ -240,15 +240,6 @@ void ViewManagerBase::ReplaceChild(const XamlView &parent, const XamlView &oldCh
240
240
  void ViewManagerBase::UpdateProperties(
241
241
  ShadowNodeBase *nodeToUpdate,
242
242
  winrt::Microsoft::ReactNative::JSValueObject &props) {
243
- // Directly dirty this node since non-layout changes like the text property do
244
- // not trigger relayout
245
- // There isn't actually a yoga node for RawText views, but it will invalidate
246
- // the ancestors which
247
- // will include the containing Text element. And that's what matters.
248
- int64_t tag = GetTag(nodeToUpdate->GetView());
249
- if (auto uiManager = GetNativeUIManager(GetReactContext()).lock())
250
- uiManager->DirtyYogaNode(tag);
251
-
252
243
  for (const auto &pair : props) {
253
244
  const std::string &propertyName = pair.first;
254
245
  const auto &propertyValue = pair.second;
@@ -392,6 +383,11 @@ bool ViewManagerBase::IsNativeControlWithSelfLayout() const {
392
383
  return GetYogaCustomMeasureFunc() != nullptr;
393
384
  }
394
385
 
386
+ void ViewManagerBase::MarkDirty(int64_t tag) {
387
+ if (auto uiManager = GetNativeUIManager(GetReactContext()).lock())
388
+ uiManager->DirtyYogaNode(tag);
389
+ }
390
+
395
391
  void ViewManagerBase::OnPointerEvent(
396
392
  ShadowNodeBase *node,
397
393
  const winrt::Microsoft::ReactNative::ReactPointerEventArgs &args) {
@@ -78,6 +78,7 @@ class REACTWINDOWS_EXPORT ViewManagerBase : public IViewManager {
78
78
  virtual YGMeasureFunc GetYogaCustomMeasureFunc() const;
79
79
  virtual bool RequiresYogaNode() const;
80
80
  bool IsNativeControlWithSelfLayout() const;
81
+ void MarkDirty(int64_t tag);
81
82
 
82
83
  virtual void OnPointerEvent(ShadowNodeBase *node, const winrt::Microsoft::ReactNative::ReactPointerEventArgs &args);
83
84
 
@@ -56,6 +56,17 @@ XamlView VirtualTextViewManager::CreateViewCore(int64_t /*tag*/, const winrt::Mi
56
56
  return winrt::Span();
57
57
  }
58
58
 
59
+ void VirtualTextViewManager::UpdateProperties(
60
+ ShadowNodeBase *nodeToUpdate,
61
+ winrt::Microsoft::ReactNative::JSValueObject &props) {
62
+ // This could be optimized further, but rather than paying a penalty to mark
63
+ // the node dirty for each relevant property in UpdateProperty (which should
64
+ // be reasonably cheap given it just does an O(1) lookup of the Yoga node
65
+ // for the tag, for now this just marks the node dirty for any prop update.
66
+ MarkDirty(nodeToUpdate->m_tag);
67
+ Super::UpdateProperties(nodeToUpdate, props);
68
+ }
69
+
59
70
  bool VirtualTextViewManager::UpdateProperty(
60
71
  ShadowNodeBase *nodeToUpdate,
61
72
  const std::string &propertyName,
@@ -43,6 +43,8 @@ class VirtualTextViewManager : public ViewManagerBase {
43
43
 
44
44
  bool RequiresYogaNode() const override;
45
45
 
46
+ void UpdateProperties(ShadowNodeBase *nodeToUpdate, winrt::Microsoft::ReactNative::JSValueObject &props);
47
+
46
48
  protected:
47
49
  bool UpdateProperty(
48
50
  ShadowNodeBase *nodeToUpdate,
@@ -10,7 +10,7 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.0.0-canary.435</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.0.0-canary.436</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>0</ReactNativeWindowsMinor>
16
16
  <ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
@@ -49,7 +49,6 @@
49
49
  <file src="$nugetroot$\inc\Shared\InstanceManager.h" target="inc"/>
50
50
  <file src="$nugetroot$\inc\Shared\IReactRootView.h" target="inc"/>
51
51
  <file src="$nugetroot$\inc\Shared\IRedBoxHandler.h" target="inc"/>
52
- <file src="$nugetroot$\inc\Shared\IUIManager.h" target="inc"/>
53
52
  <file src="$nugetroot$\inc\Shared\IWebSocketResource.h" target="inc"/>
54
53
  <file src="$nugetroot$\inc\Shared\JSBigAbiString.h" target="inc"/>
55
54
  <file src="$nugetroot$\inc\Shared\LayoutAnimation.h" target="inc"/>
@@ -102,7 +102,6 @@
102
102
  <ClInclude Include="$(MSBuildThisFileDirectory)InstanceManager.h" />
103
103
  <ClInclude Include="$(MSBuildThisFileDirectory)IReactRootView.h" />
104
104
  <ClInclude Include="$(MSBuildThisFileDirectory)IRedBoxHandler.h" />
105
- <ClInclude Include="$(MSBuildThisFileDirectory)IUIManager.h" />
106
105
  <ClInclude Include="$(MSBuildThisFileDirectory)IWebSocketResource.h" />
107
106
  <ClInclude Include="$(MSBuildThisFileDirectory)JSBigAbiString.h" />
108
107
  <ClInclude Include="$(MSBuildThisFileDirectory)LayoutAnimation.h" />
@@ -266,9 +266,6 @@
266
266
  <ClInclude Include="$(MSBuildThisFileDirectory)IRedBoxHandler.h">
267
267
  <Filter>Header Files</Filter>
268
268
  </ClInclude>
269
- <ClInclude Include="$(MSBuildThisFileDirectory)IUIManager.h">
270
- <Filter>Header Files</Filter>
271
- </ClInclude>
272
269
  <ClInclude Include="$(MSBuildThisFileDirectory)IWebSocketResource.h">
273
270
  <Filter>Header Files</Filter>
274
271
  </ClInclude>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.0.0-canary.435",
3
+ "version": "0.0.0-canary.436",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,7 +27,7 @@
27
27
  "@react-native-community/cli-platform-android": "^6.0.0",
28
28
  "@react-native-community/cli-platform-ios": "^6.0.0",
29
29
  "@react-native-windows/cli": "0.0.0-canary.108",
30
- "@react-native-windows/virtualized-list": "0.0.0-canary.22",
30
+ "@react-native-windows/virtualized-list": "0.0.0-canary.23",
31
31
  "@react-native/assets": "1.0.0",
32
32
  "@react-native/normalize-color": "2.0.0",
33
33
  "@react-native/polyfills": "2.0.0",
@@ -46,8 +46,8 @@
46
46
  "pretty-format": "^26.5.2",
47
47
  "promise": "^8.0.3",
48
48
  "prop-types": "^15.7.2",
49
- "react-devtools-core": "4.21.0",
50
- "react-native-codegen": "^0.0.11",
49
+ "react-devtools-core": "4.22.1",
50
+ "react-native-codegen": "^0.0.12",
51
51
  "react-refresh": "^0.4.0",
52
52
  "regenerator-runtime": "^0.13.2",
53
53
  "scheduler": "^0.20.2",
@@ -67,13 +67,13 @@
67
67
  "@types/react-native": "^0.66.0",
68
68
  "eslint": "^7.32.0",
69
69
  "eslint-plugin-prettier": "^4.0.0",
70
- "flow-bin": "^0.165.0",
70
+ "flow-bin": "^0.167.1",
71
71
  "jscodeshift": "^0.11.0",
72
72
  "just-scripts": "^1.3.3",
73
73
  "metro-config": "^0.66.0",
74
74
  "prettier": "^2.4.1",
75
75
  "react": "17.0.2",
76
- "react-native": "0.0.0-20211202-2008-9e2ec4d3d",
76
+ "react-native": "0.0.0-20211217-2008-aef843bfe",
77
77
  "react-native-platform-override": "^1.6.2",
78
78
  "react-refresh": "^0.4.0",
79
79
  "react-shallow-renderer": "16.14.1",
@@ -81,7 +81,7 @@
81
81
  },
82
82
  "peerDependencies": {
83
83
  "react": "17.0.2",
84
- "react-native": "0.0.0-20211202-2008-9e2ec4d3d"
84
+ "react-native": "0.0.0-20211217-2008-aef843bfe"
85
85
  },
86
86
  "beachball": {
87
87
  "defaultNpmTag": "canary",
@@ -1,90 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
-
4
- #pragma once
5
-
6
- #include <cxxreact/CxxModule.h>
7
-
8
- #include <folly/dynamic.h>
9
- #include <stdint.h>
10
- #include <string>
11
-
12
- namespace facebook {
13
- namespace react {
14
-
15
- struct INativeUIManager;
16
- struct IReactRootView;
17
- class IViewManager;
18
- struct ShadowNode;
19
- class MessageQueueThread;
20
-
21
- class IUIManager {
22
- public:
23
- virtual ~IUIManager(){};
24
- virtual int64_t AddMeasuredRootView(IReactRootView *rootView) = 0;
25
-
26
- // TODO: Remove if moduleRegistry exposes onBatchComplete
27
- virtual void onBatchComplete() = 0;
28
-
29
- virtual folly::dynamic getConstantsForViewManager(const std::string &viewManager) = 0;
30
- virtual void populateViewManagerConstants(std::map<std::string, folly::dynamic> &constants) = 0;
31
- virtual void createView(int64_t tag, std::string &&className, int64_t rootViewTag, folly::dynamic &&props) = 0;
32
- virtual void configureNextLayoutAnimation(
33
- folly::dynamic &&config,
34
- facebook::xplat::module::CxxModule::Callback success,
35
- facebook::xplat::module::CxxModule::Callback error) = 0;
36
- virtual void removeRootView(int64_t rootViewTag) = 0;
37
- virtual void setChildren(int64_t viewTag, folly::dynamic &&childrenTags) = 0;
38
- virtual void updateView(int64_t tag, const std::string &className, folly::dynamic &&props) = 0;
39
- virtual void removeSubviewsFromContainerWithID(int64_t containerTag) = 0;
40
- virtual void manageChildren(
41
- int64_t viewTag,
42
- folly::dynamic &moveFrom,
43
- folly::dynamic &moveTo,
44
- folly::dynamic &addChildTags,
45
- folly::dynamic &addAtIndices,
46
- folly::dynamic &removeFrom) = 0;
47
- virtual void
48
- dispatchViewManagerCommand(int64_t reactTag, const std::string &commandId, folly::dynamic &&commandArgs) = 0;
49
- virtual void replaceExistingNonRootView(int64_t oldTag, int64_t newTag) = 0;
50
- virtual void measure(int64_t reactTag, facebook::xplat::module::CxxModule::Callback callback) = 0;
51
- virtual void measureInWindow(int64_t reactTag, facebook::xplat::module::CxxModule::Callback callback) = 0;
52
- virtual void measureLayout(
53
- int64_t reactTag,
54
- int64_t ancestorReactTag,
55
- facebook::xplat::module::CxxModule::Callback errorCallback,
56
- facebook::xplat::module::CxxModule::Callback callback) = 0;
57
- virtual INativeUIManager *getNativeUIManager() = 0;
58
-
59
- virtual void focus(int64_t tag) = 0;
60
- virtual void blur(int64_t tag) = 0;
61
-
62
- // needed for control specific native modules to get the shadow node from the
63
- // UIManager given its tag
64
- virtual ShadowNode *FindShadowNodeForTag(int64_t tag) = 0;
65
- virtual void findSubviewIn(
66
- int64_t reactTag,
67
- folly::dynamic &&coordinates,
68
- facebook::xplat::module::CxxModule::Callback callback) = 0;
69
- };
70
-
71
- std::shared_ptr<IUIManager> createIUIManager(
72
- std::vector<std::unique_ptr<IViewManager>> &&viewManagers,
73
- INativeUIManager *nativeManager);
74
-
75
- std::unique_ptr<facebook::xplat::module::CxxModule> createUIManagerModule(
76
- std::shared_ptr<IUIManager> &&uimanager,
77
- std::shared_ptr<MessageQueueThread> &&uiQueue) noexcept;
78
-
79
- // Deprecated: use the overloaded version with two parameters.
80
- // It is here because it is being exported
81
- std::unique_ptr<facebook::xplat::module::CxxModule> createUIManagerModule(std::shared_ptr<IUIManager> uimanager);
82
-
83
- std::shared_ptr<IUIManager> createBatchingUIManager(
84
- std::vector<std::unique_ptr<IViewManager>> &&viewManagers,
85
- INativeUIManager *nativeManager);
86
- std::unique_ptr<facebook::xplat::module::CxxModule> createBatchingUIManagerModule(
87
- std::shared_ptr<IUIManager> uimanager);
88
-
89
- } // namespace react
90
- } // namespace facebook