react-native-windows 0.81.37 → 0.81.40

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 (52) hide show
  1. package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +6 -2
  2. package/Microsoft.ReactNative/Fabric/AbiShadowNode.cpp +0 -47
  3. package/Microsoft.ReactNative/Fabric/AbiShadowNode.h +40 -8
  4. package/Microsoft.ReactNative/Fabric/AbiState.h +26 -8
  5. package/Microsoft.ReactNative/Fabric/AbiTextInputProps.h +51 -0
  6. package/Microsoft.ReactNative/Fabric/AbiTextInputShadowNode.cpp +88 -0
  7. package/Microsoft.ReactNative/Fabric/AbiTextInputShadowNode.h +65 -0
  8. package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.h +52 -18
  9. package/Microsoft.ReactNative/Fabric/AbiViewShadowNode.cpp +0 -18
  10. package/Microsoft.ReactNative/Fabric/AbiViewShadowNode.h +16 -4
  11. package/Microsoft.ReactNative/Fabric/ComponentView.cpp +2 -1
  12. package/Microsoft.ReactNative/Fabric/Composition/ComponentViewRegistry.cpp +1 -2
  13. package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +1 -1
  14. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +3 -2
  15. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +6 -4
  16. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +6 -4
  17. package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +2 -1
  18. package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp +22 -0
  19. package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +2 -1
  20. package/Microsoft.ReactNative/Fabric/Composition/TextInput/AbiTextInputState.h +38 -0
  21. package/Microsoft.ReactNative/Fabric/Composition/TextInput/ConcreteTextInputShadowNode.h +272 -0
  22. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h +21 -14
  23. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +345 -90
  24. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +24 -4
  25. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputProps.h +1 -1
  26. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +0 -205
  27. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +22 -65
  28. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h +2 -1
  29. package/Microsoft.ReactNative/Fabric/WindowsComponentDescriptorRegistry.cpp +0 -1
  30. package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +5 -0
  31. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +0 -1
  32. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +60 -5
  33. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +3 -0
  34. package/Microsoft.ReactNative/ViewProps.idl +11 -0
  35. package/Microsoft.ReactNative/Views/ViewViewManager.cpp +2 -2
  36. package/Microsoft.ReactNative.Cxx/ComponentView.Experimental.interop.h +12 -0
  37. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  38. package/PropertySheets/JSEngine.props +1 -1
  39. package/PropertySheets/React.Cpp.props +0 -1
  40. package/PropertySheets/WinUI.props +2 -1
  41. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/Instance.cpp +386 -0
  42. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.h +148 -0
  43. package/Scripts/EnableInternalWinAppSDKFeed.ps1 +12 -5
  44. package/Scripts/NuGetRestoreForceEvaluateAllSolutions.ps1 +2 -2
  45. package/Shared/Networking/WinRTWebSocketResource.h +1 -5
  46. package/Shared/OInstance.cpp +13 -8
  47. package/Shared/Shared.vcxitems +3 -3
  48. package/Shared/Shared.vcxitems.filters +1 -1
  49. package/external/folly/folly.vcxitems +10 -0
  50. package/index.windows.js +5 -0
  51. package/package.json +4 -4
  52. package/Microsoft.ReactNative/Fabric/AbiState.cpp +0 -29
@@ -14,6 +14,7 @@
14
14
  #include <folly/json.h>
15
15
  #include <jsi/jsi.h>
16
16
  #include <jsireact/JSIExecutor.h>
17
+ #include <cstring>
17
18
  #include <filesystem>
18
19
  #include "OInstance.h"
19
20
  #include "Unicode.h"
@@ -77,15 +78,13 @@ namespace Microsoft::ReactNative {
77
78
  bool isHBCBundle(const std::string &bundle) {
78
79
  static uint32_t constexpr HBCBundleMagicNumber = 0xffe7c3c3;
79
80
 
80
- // Note:: Directly access the pointer to avoid copy/length-check. It matters as this string contains the bundle which
81
- // can be potentially huge.
82
- // https://herbsutter.com/2008/04/07/cringe-not-vectors-are-guaranteed-to-be-contiguous/#comment-483
83
- auto header = reinterpret_cast<const facebook::react::BundleHeader *>(&bundle[0]);
84
- if (HBCBundleMagicNumber == header->magic32.value) {
85
- return true;
86
- } else {
81
+ // Only the leading magic number is needed; copy just those bytes rather than the whole (potentially huge) bundle.
82
+ uint32_t magic = 0;
83
+ if (bundle.size() < sizeof(magic)) {
87
84
  return false;
88
85
  }
86
+ std::memcpy(&magic, bundle.data(), sizeof(magic));
87
+ return magic == HBCBundleMagicNumber;
89
88
  }
90
89
 
91
90
  void LoadRemoteUrlScript(
@@ -136,7 +135,13 @@ void LoadRemoteUrlScript(
136
135
  // This code is based on the HBC Bundle integration on Android
137
136
  // Ref:
138
137
  // https://github.com/facebook/react-native/blob/24d91268b64c7abbd4b26547ffcc663dc90ec5e7/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp#L231
139
- if (isHBCBundle(jsBundleString)) {
138
+ // Bytecode bundles are only requested from the dev server when USE_HERMES and ENABLE_DEVSERVER_HBCBUNDLES are
139
+ // defined.
140
+ bool isBytecodeBundle = false;
141
+ #if defined(USE_HERMES) && defined(ENABLE_DEVSERVER_HBCBUNDLES)
142
+ isBytecodeBundle = isHBCBundle(jsBundleString);
143
+ #endif
144
+ if (isBytecodeBundle) {
140
145
  auto script = std::make_unique<facebook::react::JSBigStdString>(jsBundleString, false);
141
146
  const char *buffer = script->c_str();
142
147
  uint32_t bufferLength = (uint32_t)script->size();
@@ -190,6 +190,9 @@
190
190
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiViewProps.cpp">
191
191
  <ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
192
192
  </ClCompile>
193
+ <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiTextInputShadowNode.cpp">
194
+ <ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
195
+ </ClCompile>
193
196
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiShadowNode.cpp">
194
197
  <ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
195
198
  </ClCompile>
@@ -199,9 +202,6 @@
199
202
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiViewShadowNode.cpp">
200
203
  <ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
201
204
  </ClCompile>
202
- <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiState.cpp">
203
- <ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
204
- </ClCompile>
205
205
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\ComponentView.cpp">
206
206
  <ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
207
207
  </ClCompile>
@@ -273,7 +273,6 @@
273
273
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\platform\react\renderer\graphics\PlatformColorUtils.cpp" />
274
274
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiPortalShadowNode.cpp" />
275
275
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiViewShadowNode.cpp" />
276
- <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiState.cpp" />
277
276
  <ClCompile Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\Utils\ThemeUtils.cpp" />
278
277
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\DebuggingOverlayComponentView.cpp" />
279
278
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionViewComponentView.cpp" />
@@ -338,6 +337,7 @@
338
337
  </ClCompile>
339
338
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\Instance.cpp" />
340
339
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\JSExecutor.cpp" />
340
+ <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\AbiTextInputShadowNode.cpp" />
341
341
  </ItemGroup>
342
342
  <ItemGroup>
343
343
  <Filter Include="Source Files">
@@ -153,6 +153,16 @@
153
153
  <AdditionalIncludeDirectories>$(ReactNativeWindowsDir)Folly;$(ReactNativeWindowsDir)stubs;$(ExternalDir)folly;$(ExternalDir)fast-float\include;$(ExternalDir)fmt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
154
154
  </ClCompile>
155
155
  </ItemGroup>
156
+ <!-- Work around MSVC v145 ARM64 optimizer C1001 in AtForkListSingleton::init.
157
+ Disable PCH use so its Release optimization settings cannot override /Od.
158
+ Keep the forced pch.h include as an ordinary header. Remove when the compiler is fixed. -->
159
+ <ItemGroup>
160
+ <ClCompile Update="$(ExternalDir)folly\folly\system\AtFork.cpp" Condition="'$(Platform)' == 'ARM64' And '$(PlatformToolsetVersion)' != '' And $(PlatformToolsetVersion)&gt;=145">
161
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
162
+ <Optimization>Disabled</Optimization>
163
+ <WholeProgramOptimization>false</WholeProgramOptimization>
164
+ </ClCompile>
165
+ </ItemGroup>
156
166
  <!-- SysMman.cpp is Desktop-only and must not use folly's UWP pch; re-assert no-PCH after
157
167
  the blanket Update above, which would otherwise force pch.h onto it. -->
158
168
  <ItemGroup>
package/index.windows.js CHANGED
@@ -369,6 +369,11 @@ module.exports = {
369
369
  get AppTheme() {
370
370
  return require('./Libraries/AppTheme/AppTheme').AppTheme;
371
371
  },
372
+ // Export this to allow custom native textinput components to provide a full view spec
373
+ get TextInputViewSpec() {
374
+ return require('./Libraries/Components/TextInput/WindowsTextInputNativeComponent')
375
+ .__INTERNAL_VIEW_CONFIG;
376
+ },
372
377
  } as ReactNativePublicAPI;
373
378
 
374
379
  if (__DEV__) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.81.37",
3
+ "version": "0.81.40",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,7 +26,7 @@
26
26
  "@react-native-community/cli": "17.0.0",
27
27
  "@react-native-community/cli-platform-android": "17.0.0",
28
28
  "@react-native-community/cli-platform-ios": "17.0.0",
29
- "@react-native-windows/cli": "0.81.10",
29
+ "@react-native-windows/cli": "0.81.12",
30
30
  "@react-native/assets": "1.0.0",
31
31
  "@react-native/assets-registry": "0.81.6",
32
32
  "@react-native/codegen": "0.81.6",
@@ -68,7 +68,7 @@
68
68
  "yargs": "^17.6.2"
69
69
  },
70
70
  "devDependencies": {
71
- "@react-native-windows/codegen": "0.81.7",
71
+ "@react-native-windows/codegen": "0.81.8",
72
72
  "@react-native/metro-config": "0.81.6",
73
73
  "@rnw-scripts/babel-react-native-config": "0.0.0",
74
74
  "@rnw-scripts/eslint-config": "1.2.38",
@@ -85,7 +85,7 @@
85
85
  "prettier": "2.8.8",
86
86
  "react": "19.1.4",
87
87
  "react-native": "0.81.6",
88
- "react-native-platform-override": "0.81.3",
88
+ "react-native-platform-override": "0.81.4",
89
89
  "react-refresh": "^0.14.0",
90
90
  "typescript": "5.0.4"
91
91
  },
@@ -1,29 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
-
4
- #include "AbiState.h"
5
-
6
- namespace Microsoft::ReactNative {
7
-
8
- AbiComponentState::AbiComponentState(facebook::react::State::Shared const &state) {
9
- m_state = std::static_pointer_cast<facebook::react::ConcreteState<AbiStateData> const>(state);
10
- }
11
-
12
- winrt::Windows::Foundation::IInspectable AbiComponentState::Data() noexcept {
13
- return m_state->getData().userdata;
14
- }
15
-
16
- void AbiComponentState::UpdateState(const winrt::Windows::Foundation::IInspectable &data) noexcept {
17
- AbiStateData state;
18
- state.userdata = data;
19
- m_state->updateState(std::move(state));
20
- }
21
-
22
- void AbiComponentState::UpdateStateWithMutation(
23
- const winrt::Microsoft::ReactNative::StateUpdateMutation &mutation) noexcept {
24
- m_state->updateState([mutation](const AbiStateData &oldData) {
25
- return std::make_shared<AbiStateData const>(mutation(oldData.userdata));
26
- });
27
- }
28
-
29
- } // namespace Microsoft::ReactNative