react-native-windows 0.73.4 → 0.73.6

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.
@@ -64,7 +64,7 @@
64
64
  string literals. It prevents code like
65
65
  wchar_t* str = L"hello";
66
66
  from compiling. -->
67
- <AdditionalOptions>%(AdditionalOptions) /Zc:strictStrings</AdditionalOptions>
67
+ <AdditionalOptions>%(AdditionalOptions) /Zc:strictStrings /await</AdditionalOptions>
68
68
  </ClCompile>
69
69
  <Link>
70
70
  <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
@@ -78,12 +78,17 @@
78
78
  </ItemDefinitionGroup>
79
79
  <ItemGroup>
80
80
  <ClCompile Include="Unicode.cpp" />
81
+ <ClCompile Include="Utilities.cpp" />
81
82
  </ItemGroup>
82
83
  <ItemGroup>
83
84
  <ClInclude Include="Unicode.h" />
84
85
  <ClInclude Include="Utilities.h" />
85
86
  </ItemGroup>
86
87
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
88
+ <ItemGroup>
89
+ <PackageReference Include="boost" Version="1.76.0.0" />
90
+ <PackageReference Include="Microsoft.Windows.CppWinRT" Version="$(CppWinRTVersion)" PrivateAssets="all" />
91
+ </ItemGroup>
87
92
  <ImportGroup Label="ExtensionTargets">
88
93
  </ImportGroup>
89
94
  <Target Name="Deploy" />
@@ -12,6 +12,9 @@
12
12
  <ClCompile Include="Unicode.cpp">
13
13
  <Filter>Source Files</Filter>
14
14
  </ClCompile>
15
+ <ClCompile Include="Utilities.cpp">
16
+ <Filter>Source Files</Filter>
17
+ </ClCompile>
15
18
  </ItemGroup>
16
19
  <ItemGroup>
17
20
  <ClInclude Include="Unicode.h">
@@ -0,0 +1,59 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+
4
+ #include "Utilities.h"
5
+
6
+ // Boost Library
7
+ #include <boost/archive/iterators/base64_from_binary.hpp>
8
+ #include <boost/archive/iterators/binary_from_base64.hpp>
9
+ #include <boost/archive/iterators/ostream_iterator.hpp>
10
+ #include <boost/archive/iterators/transform_width.hpp>
11
+
12
+ // Windows API
13
+ #include <winrt/Windows.Security.Cryptography.h>
14
+
15
+ // Standard Library
16
+ #include <sstream>
17
+
18
+ using std::string;
19
+ using std::string_view;
20
+ using std::wstring_view;
21
+ using winrt::array_view;
22
+
23
+ using winrt::Windows::Security::Cryptography::BinaryStringEncoding;
24
+ using winrt::Windows::Security::Cryptography::CryptographicBuffer;
25
+
26
+ namespace Microsoft::React::Utilities {
27
+
28
+ string DecodeBase64(string_view base64) noexcept {
29
+ typedef array_view<char const> av_t;
30
+ auto bytes = av_t(base64.data(), static_cast<av_t::size_type>(base64.size()));
31
+
32
+ using namespace boost::archive::iterators;
33
+ typedef transform_width<binary_from_base64<const char *>, 8, 6> decode_base64;
34
+ std::ostringstream oss;
35
+ std::copy(decode_base64(bytes.cbegin()), decode_base64(bytes.cend()), ostream_iterator<char>(oss));
36
+
37
+ return oss.str();
38
+ }
39
+
40
+ // https://www.boost.org/doc/libs/1_76_0/libs/serialization/doc/dataflow.html
41
+ string EncodeBase64(string_view text) noexcept {
42
+ typedef array_view<char const> av_t;
43
+ auto bytes = av_t(text.data(), static_cast<av_t::size_type>(text.size()));
44
+
45
+ using namespace boost::archive::iterators;
46
+ typedef base64_from_binary<transform_width<const char *, 6, 8>> encode_base64;
47
+ std::ostringstream oss;
48
+ std::copy(encode_base64(bytes.cbegin()), encode_base64(bytes.cend()), ostream_iterator<char>(oss));
49
+
50
+ // https://unix.stackexchange.com/questions/631501
51
+ auto padLength = (4 - (oss.tellp() % 4)) % 4;
52
+ for (auto i = 0; i < padLength; ++i) {
53
+ oss << '=';
54
+ }
55
+
56
+ return oss.str();
57
+ }
58
+
59
+ } // namespace Microsoft::React::Utilities
@@ -1,7 +1,20 @@
1
1
  {
2
2
  "version": 1,
3
3
  "dependencies": {
4
- "native,Version=v0.0": {},
4
+ "native,Version=v0.0": {
5
+ "boost": {
6
+ "type": "Direct",
7
+ "requested": "[1.76.0, )",
8
+ "resolved": "1.76.0",
9
+ "contentHash": "p+w3YvNdXL8Cu9Fzrmexssu0tZbWxuf6ywsQqHjDlKFE5ojXHof1HIyMC3zDLfLnh80dIeFcEUAuR2Asg/XHRA=="
10
+ },
11
+ "Microsoft.Windows.CppWinRT": {
12
+ "type": "Direct",
13
+ "requested": "[2.0.211028.7, )",
14
+ "resolved": "2.0.211028.7",
15
+ "contentHash": "JBGI0c3WLoU6aYJRy9Qo0MLDQfObEp+d4nrhR95iyzf7+HOgjRunHDp/6eGFREd7xq3OI1mll9ecJrMfzBvlyg=="
16
+ }
17
+ },
5
18
  "native,Version=v0.0/win10-arm": {},
6
19
  "native,Version=v0.0/win10-arm-aot": {},
7
20
  "native,Version=v0.0/win10-arm64-aot": {},
@@ -2,6 +2,9 @@
2
2
  // Licensed under the MIT License.
3
3
 
4
4
  #pragma once
5
+
6
+ // Standard Library
7
+ #include <string>
5
8
  #include <type_traits>
6
9
  #include <utility>
7
10
 
@@ -37,3 +40,11 @@ constexpr std::size_t ArraySize(T (&)[N]) noexcept {
37
40
  }
38
41
 
39
42
  } // namespace Microsoft::Common::Utilities
43
+
44
+ namespace Microsoft::React::Utilities {
45
+
46
+ std::string DecodeBase64(std::string_view text) noexcept;
47
+
48
+ std::string EncodeBase64(std::string_view text) noexcept;
49
+
50
+ } // namespace Microsoft::React::Utilities
@@ -203,6 +203,10 @@ class TouchableBounce extends React.Component<Props, State> {
203
203
  this.state.pressability.configure(this._createPressabilityConfig());
204
204
  }
205
205
 
206
+ componentDidMount(): mixed {
207
+ this.state.pressability.configure(this._createPressabilityConfig());
208
+ }
209
+
206
210
  componentWillUnmount(): void {
207
211
  this.state.pressability.reset();
208
212
  }
@@ -363,6 +363,7 @@ class TouchableHighlight extends React.Component<Props, State> {
363
363
 
364
364
  componentDidMount(): void {
365
365
  this._isMounted = true;
366
+ this.state.pressability.configure(this._createPressabilityConfig());
366
367
  }
367
368
 
368
369
  componentDidUpdate(prevProps: Props, prevState: State) {
@@ -378,6 +378,7 @@ class TouchableHighlight extends React.Component<Props, State> {
378
378
 
379
379
  componentDidMount(): void {
380
380
  this._isMounted = true;
381
+ this.state.pressability.configure(this._createPressabilityConfig());
381
382
  }
382
383
 
383
384
  componentDidUpdate(prevProps: Props, prevState: State) {
@@ -339,6 +339,10 @@ class TouchableNativeFeedback extends React.Component<Props, State> {
339
339
  this.state.pressability.configure(this._createPressabilityConfig());
340
340
  }
341
341
 
342
+ componentDidMount(): mixed {
343
+ this.state.pressability.configure(this._createPressabilityConfig());
344
+ }
345
+
342
346
  componentWillUnmount(): void {
343
347
  this.state.pressability.reset();
344
348
  }
@@ -314,6 +314,10 @@ class TouchableOpacity extends React.Component<Props, State> {
314
314
  }
315
315
  }
316
316
 
317
+ componentDidMount(): void {
318
+ this.state.pressability.configure(this._createPressabilityConfig());
319
+ }
320
+
317
321
  componentWillUnmount(): void {
318
322
  this.state.pressability.reset();
319
323
  }
@@ -329,6 +329,10 @@ class TouchableOpacity extends React.Component<Props, State> {
329
329
  }
330
330
  }
331
331
 
332
+ componentDidMount(): void {
333
+ this.state.pressability.configure(this._createPressabilityConfig());
334
+ }
335
+
332
336
  componentWillUnmount(): void {
333
337
  this.state.pressability.reset();
334
338
  }
@@ -189,6 +189,10 @@ class TouchableWithoutFeedback extends React.Component<Props, State> {
189
189
  this.state.pressability.configure(createPressabilityConfig(this.props));
190
190
  }
191
191
 
192
+ componentDidMount(): mixed {
193
+ this.state.pressability.configure(createPressabilityConfig(this.props));
194
+ }
195
+
192
196
  componentWillUnmount(): void {
193
197
  this.state.pressability.reset();
194
198
  }
@@ -204,6 +204,10 @@ class TouchableWithoutFeedback extends React.Component<Props, State> {
204
204
  this.state.pressability.configure(createPressabilityConfig(this.props));
205
205
  }
206
206
 
207
+ componentDidMount(): mixed {
208
+ this.state.pressability.configure(createPressabilityConfig(this.props));
209
+ }
210
+
207
211
  componentWillUnmount(): void {
208
212
  this.state.pressability.reset();
209
213
  }
@@ -12,6 +12,6 @@
12
12
  exports.version = {
13
13
  major: 0,
14
14
  minor: 73,
15
- patch: 0,
15
+ patch: 4,
16
16
  prerelease: null,
17
17
  };
@@ -34,6 +34,11 @@ let rejectionTrackingOptions: $NonMaybeType<Parameters<enable>[0]> = {
34
34
  ? rejection
35
35
  : JSON.stringify((rejection: $FlowFixMe));
36
36
  }
37
+ // It could although this object is not a standard error, it still has stack information to unwind
38
+ // $FlowFixMe ignore types just check if stack is there
39
+ if (rejection.stack && typeof rejection.stack === 'string') {
40
+ stack = rejection.stack;
41
+ }
37
42
  }
38
43
 
39
44
  const warning = `Possible unhandled promise rejection (id: ${id}):\n${
@@ -10,11 +10,11 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.73.4</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.73.6</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>73</ReactNativeWindowsMinor>
16
- <ReactNativeWindowsPatch>4</ReactNativeWindowsPatch>
16
+ <ReactNativeWindowsPatch>6</ReactNativeWindowsPatch>
17
17
  <ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
18
- <ReactNativeWindowsCommitId>6461c7c30f8307c43dc78bb95aa2dbf913e75e0a</ReactNativeWindowsCommitId>
18
+ <ReactNativeWindowsCommitId>d1b6abda55649a09a35f36da61b5b184089b0db9</ReactNativeWindowsCommitId>
19
19
  </PropertyGroup>
20
20
  </Project>
@@ -991,7 +991,7 @@ void YogaLayoutableShadowNode::ensureConsistency() const {
991
991
  }
992
992
 
993
993
  void YogaLayoutableShadowNode::ensureYogaChildrenLookFine() const {
994
- #ifdef REACT_NATIVE_DEBUG
994
+ #if defined(REACT_NATIVE_DEBUG) && defined(WITH_FBSYSTRACE)
995
995
  // Checking that the shapes of Yoga node children object look fine.
996
996
  // This is the only heuristic that might produce false-positive results
997
997
  // (really broken dangled nodes might look fine). This is useful as an early
@@ -1009,7 +1009,7 @@ void YogaLayoutableShadowNode::ensureYogaChildrenLookFine() const {
1009
1009
  }
1010
1010
 
1011
1011
  void YogaLayoutableShadowNode::ensureYogaChildrenAlignment() const {
1012
- #ifdef REACT_NATIVE_DEBUG
1012
+ #if defined(REACT_NATIVE_DEBUG) && defined(WITH_FBSYSTRACE)
1013
1013
  // If the node is not a leaf node, checking that:
1014
1014
  // - All children are `YogaLayoutableShadowNode` subclasses.
1015
1015
  // - All Yoga children are owned/connected to corresponding children of
@@ -3,10 +3,7 @@
3
3
 
4
4
  #include "BaseFileReaderResource.h"
5
5
 
6
- // Boost Library
7
- #include <boost/archive/iterators/base64_from_binary.hpp>
8
- #include <boost/archive/iterators/ostream_iterator.hpp>
9
- #include <boost/archive/iterators/transform_width.hpp>
6
+ #include <utilities.h>
10
7
 
11
8
  // Windows API
12
9
  #include <winrt/base.h>
@@ -73,18 +70,9 @@ void BaseFileReaderResource::ReadAsDataUrl(
73
70
  result += type;
74
71
  result += ";base64,";
75
72
 
76
- // https://www.boost.org/doc/libs/1_76_0/libs/serialization/doc/dataflow.html
77
- using namespace boost::archive::iterators;
78
- typedef base64_from_binary<transform_width<const char *, 6, 8>> encode_base64;
79
- std::ostringstream oss;
80
- std::copy(encode_base64(bytes.cbegin()), encode_base64(bytes.cend()), ostream_iterator<char>(oss));
81
- result += oss.str();
82
-
83
- // https://unix.stackexchange.com/questions/631501
84
- auto padLength = 4 - (oss.tellp() % 4);
85
- for (auto i = 0; i < padLength; ++i) {
86
- result += '=';
87
- }
73
+ auto chars = reinterpret_cast<const char *>(bytes.data());
74
+ auto view = std::string_view(chars, bytes.size());
75
+ result += Utilities::EncodeBase64(view);
88
76
 
89
77
  resolver(std::move(result));
90
78
  }
@@ -5,12 +5,6 @@
5
5
 
6
6
  #include <CreateModules.h>
7
7
  #include <ReactPropertyBag.h>
8
- #include <sstream>
9
-
10
- // Boost Library
11
- #include <boost/archive/iterators/base64_from_binary.hpp>
12
- #include <boost/archive/iterators/ostream_iterator.hpp>
13
- #include <boost/archive/iterators/transform_width.hpp>
14
8
 
15
9
  // React Native
16
10
  #include <cxxreact/JsArgumentHelpers.h>
@@ -5,6 +5,7 @@
5
5
 
6
6
  #include <Modules/IHttpModuleProxy.h>
7
7
  #include <Modules/IWebSocketModuleProxy.h>
8
+ #include <utilities.h>
8
9
 
9
10
  // Boost Libraries
10
11
  #include <boost/uuid/uuid_io.hpp>
@@ -95,11 +96,9 @@ void DefaultBlobResource::SendOverSocket(string &&blobId, int64_t offset, int64_
95
96
  return m_callbacks.OnError(e.what());
96
97
  }
97
98
 
98
- auto buffer = CryptographicBuffer::CreateFromByteArray(data);
99
- auto base64Hstring = CryptographicBuffer::EncodeToBase64String(std::move(buffer));
100
- auto base64String = winrt::to_string(base64Hstring);
101
-
102
- wsProxy->SendBinary(std::move(base64String), socketId);
99
+ auto chars = reinterpret_cast<const char *>(data.data());
100
+ auto view = std::string_view(chars, data.size());
101
+ wsProxy->SendBinary(Utilities::EncodeBase64(view), socketId);
103
102
  }
104
103
 
105
104
  void DefaultBlobResource::CreateFromParts(msrn::JSValueArray &&parts, string &&blobId) noexcept /*override*/ {
@@ -7,6 +7,9 @@
7
7
  #include <Utils/CppWinrtLessExceptions.h>
8
8
  #include <Utils/WinRTConversions.h>
9
9
 
10
+ // Boost Libraries
11
+ #include <boost/algorithm/string.hpp>
12
+
10
13
  // MSO
11
14
  #include <dispatchQueue/dispatchQueue.h>
12
15
 
@@ -16,9 +19,6 @@
16
19
  #include <winrt/Windows.Foundation.Collections.h>
17
20
  #include <winrt/Windows.Security.Cryptography.h>
18
21
 
19
- // Standard Library
20
- #include <sstream>
21
-
22
22
  using Microsoft::Common::Utilities::CheckedReinterpretCast;
23
23
 
24
24
  using std::function;
@@ -352,8 +352,12 @@ void WinRTWebSocketResource::Connect(string &&url, const Protocols &protocols, c
352
352
 
353
353
  m_readyState = ReadyState::Connecting;
354
354
 
355
+ bool hasOriginHeader = false;
355
356
  for (const auto &header : options) {
356
357
  m_socket.SetRequestHeader(header.first, winrt::to_hstring(header.second));
358
+ if (boost::iequals(header.first, L"Origin")) {
359
+ hasOriginHeader = true;
360
+ }
357
361
  }
358
362
 
359
363
  winrt::Windows::Foundation::Collections::IVector<winrt::hstring> supportedProtocols =
@@ -362,11 +366,26 @@ void WinRTWebSocketResource::Connect(string &&url, const Protocols &protocols, c
362
366
  supportedProtocols.Append(winrt::to_hstring(protocol));
363
367
  }
364
368
 
365
- m_connectRequested = true;
366
-
367
369
  Uri uri{nullptr};
368
370
  try {
369
371
  uri = Uri{winrt::to_hstring(url)};
372
+
373
+ // #12626 - If Origin header is not provided, set to connect endpoint.
374
+ if (!hasOriginHeader) {
375
+ auto scheme = uri.SchemeName();
376
+ auto host = uri.Host();
377
+ auto port = uri.Port();
378
+
379
+ if (scheme == L"ws") {
380
+ scheme = L"http";
381
+ } else if (scheme == L"wss") {
382
+ scheme = L"https";
383
+ }
384
+
385
+ auto origin = winrt::hstring{scheme + L"://" + host + L":" + winrt::to_hstring(port)};
386
+ m_socket.SetRequestHeader(L"Origin", std::move(origin));
387
+ }
388
+
370
389
  } catch (hresult_error const &e) {
371
390
  if (m_errorHandler) {
372
391
  m_errorHandler({Utilities::HResultToString(e), ErrorType::Connection});
@@ -380,6 +399,8 @@ void WinRTWebSocketResource::Connect(string &&url, const Protocols &protocols, c
380
399
  return;
381
400
  }
382
401
 
402
+ m_connectRequested = true;
403
+
383
404
  PerformConnect(std::move(uri));
384
405
  }
385
406
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.73.4",
3
+ "version": "0.73.6",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,22 +23,22 @@
23
23
  "dependencies": {
24
24
  "@babel/runtime": "^7.0.0",
25
25
  "@jest/create-cache-key-function": "^29.6.3",
26
- "@react-native-community/cli": "12.1.1",
27
- "@react-native-community/cli-platform-android": "12.1.1",
28
- "@react-native-community/cli-platform-ios": "12.1.1",
29
- "@react-native-windows/cli": "0.73.1",
30
- "@react-native/assets": "1.0.0",
31
- "@react-native/assets-registry": "^0.73.1",
32
- "@react-native/codegen": "^0.73.2",
33
- "@react-native/community-cli-plugin": "^0.73.10",
34
- "@react-native/gradle-plugin": "^0.73.4",
35
- "@react-native/js-polyfills": "^0.73.1",
36
- "@react-native/normalize-colors": "^0.73.2",
37
- "@react-native/virtualized-lists": "^0.73.3",
26
+ "@react-native-community/cli": "12.3.2",
27
+ "@react-native-community/cli-platform-android": "12.3.2",
28
+ "@react-native-community/cli-platform-ios": "12.3.2",
29
+ "@react-native-windows/cli": "0.73.2",
30
+ "@react-native/assets-registry": "0.73.1",
31
+ "@react-native/codegen": "0.73.3",
32
+ "@react-native/community-cli-plugin": "0.73.16",
33
+ "@react-native/gradle-plugin": "0.73.4",
34
+ "@react-native/js-polyfills": "0.73.1",
35
+ "@react-native/normalize-colors": "0.73.2",
36
+ "@react-native/virtualized-lists": "0.73.4",
38
37
  "abort-controller": "^3.0.0",
39
38
  "anser": "^1.4.9",
40
39
  "ansi-regex": "^5.0.0",
41
40
  "base64-js": "^1.5.1",
41
+ "chalk": "^4.0.0",
42
42
  "deprecated-react-native-prop-types": "^5.0.0",
43
43
  "event-target-shim": "^5.0.1",
44
44
  "flow-enums-runtime": "^0.0.6",
@@ -46,8 +46,8 @@
46
46
  "jest-environment-node": "^29.6.3",
47
47
  "jsc-android": "^250231.0.0",
48
48
  "memoize-one": "^5.0.0",
49
- "metro-runtime": "^0.80.0",
50
- "metro-source-map": "^0.80.0",
49
+ "metro-runtime": "^0.80.3",
50
+ "metro-source-map": "^0.80.3",
51
51
  "mkdirp": "^0.5.1",
52
52
  "nullthrows": "^1.1.1",
53
53
  "pretty-format": "^26.5.2",
@@ -81,7 +81,7 @@
81
81
  "just-scripts": "^1.3.3",
82
82
  "prettier": "^2.4.1",
83
83
  "react": "18.2.0",
84
- "react-native": "0.73.0",
84
+ "react-native": "0.73.4",
85
85
  "react-native-platform-override": "^1.9.16",
86
86
  "react-refresh": "^0.4.0",
87
87
  "typescript": "^4.9.5"