react-native-windows 0.73.10 → 0.73.12

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.
@@ -172,16 +172,16 @@ export interface ViewPropsAndroid {
172
172
 
173
173
  // [Windows
174
174
 
175
- export enum EventPhase {
176
- None = 0,
177
- Capturing,
178
- AtTarget,
179
- Bubbling,
175
+ export namespace EventPhase {
176
+ export const None = 0;
177
+ export const Capturing = 1;
178
+ export const AtTarget = 2;
179
+ export const Bubbling = 3;
180
180
  }
181
181
 
182
- export enum HandledEventPhase {
183
- Capturing = EventPhase.Capturing,
184
- Bubbling = EventPhase.Bubbling,
182
+ export namespace HandledEventPhase {
183
+ const Capturing = EventPhase.Capturing;
184
+ const Bubbling = EventPhase.Bubbling;
185
185
  }
186
186
 
187
187
  export interface INativeKeyboardEvent {
@@ -191,7 +191,11 @@ export interface INativeKeyboardEvent {
191
191
  shiftKey: boolean;
192
192
  key: string;
193
193
  code: string;
194
- eventPhase: EventPhase;
194
+ eventPhase:
195
+ | EventPhase.None
196
+ | EventPhase.Capturing
197
+ | EventPhase.AtTarget
198
+ | EventPhase.Bubbling;
195
199
  }
196
200
 
197
201
  export interface IHandledKeyboardEvent {
@@ -200,7 +204,7 @@ export interface IHandledKeyboardEvent {
200
204
  metaKey?: boolean;
201
205
  shiftKey?: boolean;
202
206
  code: string;
203
- handledEventPhase?: HandledEventPhase;
207
+ handledEventPhase?: EventPhase.Capturing | EventPhase.Bubbling;
204
208
  }
205
209
 
206
210
  export type IKeyboardEvent = NativeSyntheticEvent<INativeKeyboardEvent>;
@@ -12,6 +12,6 @@
12
12
  exports.version = {
13
13
  major: 0,
14
14
  minor: 73,
15
- patch: 4,
15
+ patch: 6,
16
16
  prerelease: null,
17
17
  };
@@ -192,7 +192,7 @@ export function parseComponentStack(message: string): ComponentStack {
192
192
  if (!s) {
193
193
  return null;
194
194
  }
195
- const match = s.match(/(.*) \(at (.*\.js):([\d]+)\)/);
195
+ const match = s.match(/(.*) \(at (.*\.(?:js|jsx|ts|tsx)):([\d]+)\)/);
196
196
  if (!match) {
197
197
  return null;
198
198
  }
@@ -10,11 +10,11 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.73.10</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.73.12</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>73</ReactNativeWindowsMinor>
16
- <ReactNativeWindowsPatch>10</ReactNativeWindowsPatch>
16
+ <ReactNativeWindowsPatch>12</ReactNativeWindowsPatch>
17
17
  <ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
18
- <ReactNativeWindowsCommitId>f0a17a652b6bbd8437fece5ae54bc39b2e9caae9</ReactNativeWindowsCommitId>
18
+ <ReactNativeWindowsCommitId>f8a684071f7e12095dd89543b5217843086ee400</ReactNativeWindowsCommitId>
19
19
  </PropertyGroup>
20
20
  </Project>
@@ -18,6 +18,7 @@
18
18
  #include <regex>
19
19
 
20
20
  using std::set;
21
+ using std::string;
21
22
  using std::wstring;
22
23
 
23
24
  using winrt::hresult_error;
@@ -114,15 +115,6 @@ bool OriginPolicyHttpFilter::CaseInsensitiveComparer::operator()(const wstring &
114
115
  /*static*/ set<const wchar_t *, OriginPolicyHttpFilter::CaseInsensitiveComparer>
115
116
  OriginPolicyHttpFilter::s_corsForbiddenRequestHeaderNamePrefixes = {L"Proxy-", L"Sec-"};
116
117
 
117
- /*static*/ Uri OriginPolicyHttpFilter::s_origin{nullptr};
118
-
119
- /*static*/ void OriginPolicyHttpFilter::SetStaticOrigin(std::string &&url) {
120
- if (!url.empty())
121
- s_origin = Uri{to_hstring(url)};
122
- else
123
- s_origin = nullptr;
124
- }
125
-
126
118
  /*static*/ bool OriginPolicyHttpFilter::IsSameOrigin(Uri const &u1, Uri const &u2) noexcept {
127
119
  return (u1 && u2) && u1.SchemeName() == u2.SchemeName() && u1.Host() == u2.Host() && u1.Port() == u2.Port();
128
120
  }
@@ -387,10 +379,14 @@ bool OriginPolicyHttpFilter::CaseInsensitiveComparer::operator()(const wstring &
387
379
  }
388
380
  }
389
381
 
390
- OriginPolicyHttpFilter::OriginPolicyHttpFilter(IHttpFilter const &innerFilter) : m_innerFilter{innerFilter} {}
382
+ OriginPolicyHttpFilter::OriginPolicyHttpFilter(string &&origin, IHttpFilter const &innerFilter)
383
+ : m_origin{nullptr}, m_innerFilter{innerFilter} {
384
+ if (!origin.empty())
385
+ m_origin = Uri{to_hstring(origin)};
386
+ }
391
387
 
392
- OriginPolicyHttpFilter::OriginPolicyHttpFilter()
393
- : OriginPolicyHttpFilter(winrt::Windows::Web::Http::Filters::HttpBaseProtocolFilter{}) {}
388
+ OriginPolicyHttpFilter::OriginPolicyHttpFilter(string &&origin)
389
+ : OriginPolicyHttpFilter(std::move(origin), winrt::Windows::Web::Http::Filters::HttpBaseProtocolFilter{}) {}
394
390
 
395
391
  OriginPolicy OriginPolicyHttpFilter::ValidateRequest(HttpRequestMessage const &request) {
396
392
  auto effectiveOriginPolicy =
@@ -400,17 +396,17 @@ OriginPolicy OriginPolicyHttpFilter::ValidateRequest(HttpRequestMessage const &r
400
396
  return effectiveOriginPolicy;
401
397
 
402
398
  case OriginPolicy::SameOrigin:
403
- if (!IsSameOrigin(s_origin, request.RequestUri()))
399
+ if (!IsSameOrigin(m_origin, request.RequestUri()))
404
400
  throw hresult_error{E_INVALIDARG, L"SOP (same-origin policy) is enforced"};
405
401
  break;
406
402
 
407
403
  case OriginPolicy::SimpleCrossOriginResourceSharing:
408
404
  // Check for disallowed mixed content
409
405
  if (GetRuntimeOptionBool("Http.BlockMixedContentSimpleCors") &&
410
- s_origin.SchemeName() != request.RequestUri().SchemeName())
406
+ m_origin.SchemeName() != request.RequestUri().SchemeName())
411
407
  throw hresult_error{E_INVALIDARG, L"The origin and request URLs must have the same scheme"};
412
408
 
413
- if (IsSameOrigin(s_origin, request.RequestUri()))
409
+ if (IsSameOrigin(m_origin, request.RequestUri()))
414
410
  // Same origin. Therefore, skip Cross-Origin handling.
415
411
  effectiveOriginPolicy = OriginPolicy::SameOrigin;
416
412
  else if (!IsSimpleCorsRequest(request))
@@ -426,7 +422,7 @@ OriginPolicy OriginPolicyHttpFilter::ValidateRequest(HttpRequestMessage const &r
426
422
  // Example: On the Edge browser, an XHR request with the "Host" header set gets rejected as unsafe.
427
423
  // https://fetch.spec.whatwg.org/#forbidden-header-name
428
424
 
429
- if (s_origin.SchemeName() != request.RequestUri().SchemeName())
425
+ if (m_origin.SchemeName() != request.RequestUri().SchemeName())
430
426
  throw hresult_error{E_INVALIDARG, L"The origin and request URLs must have the same scheme"};
431
427
 
432
428
  if (!AreSafeRequestHeaders(request.Headers()))
@@ -435,7 +431,7 @@ OriginPolicy OriginPolicyHttpFilter::ValidateRequest(HttpRequestMessage const &r
435
431
  if (s_forbiddenMethods.find(request.Method().ToString().c_str()) != s_forbiddenMethods.cend())
436
432
  throw hresult_error{E_INVALIDARG, L"Request method not allowed in cross-origin resource sharing"};
437
433
 
438
- if (IsSameOrigin(s_origin, request.RequestUri()))
434
+ if (IsSameOrigin(m_origin, request.RequestUri()))
439
435
  effectiveOriginPolicy = OriginPolicy::SameOrigin;
440
436
  else if (IsSimpleCorsRequest(request))
441
437
  effectiveOriginPolicy = OriginPolicy::SimpleCrossOriginResourceSharing;
@@ -472,7 +468,7 @@ void OriginPolicyHttpFilter::ValidateAllowOrigin(
472
468
  // 4.10.4 - Mismatched allow origin
473
469
  auto taintedOriginProp = props.TryLookup(L"TaintedOrigin");
474
470
  auto taintedOrigin = taintedOriginProp && winrt::unbox_value<bool>(taintedOriginProp);
475
- auto origin = taintedOrigin ? nullptr : s_origin;
471
+ auto origin = taintedOrigin ? nullptr : m_origin;
476
472
  if (allowedOrigin.empty() || !IsSameOrigin(origin, Uri{allowedOrigin})) {
477
473
  hstring errorMessage;
478
474
  if (allowedOrigin.empty())
@@ -603,7 +599,7 @@ void OriginPolicyHttpFilter::ValidateResponse(HttpResponseMessage const &respons
603
599
  bool originAllowed = false;
604
600
  for (const auto &header : response.Headers()) {
605
601
  if (boost::iequals(header.Key(), L"Access-Control-Allow-Origin")) {
606
- originAllowed |= L"*" == header.Value() || s_origin == Uri{header.Value()};
602
+ originAllowed |= L"*" == header.Value() || m_origin == Uri{header.Value()};
607
603
  }
608
604
  }
609
605
 
@@ -691,7 +687,7 @@ ResponseOperation OriginPolicyHttpFilter::SendPreflightAsync(HttpRequestMessage
691
687
  }
692
688
 
693
689
  preflightRequest.Headers().Insert(L"Access-Control-Request-Headers", headerNames);
694
- preflightRequest.Headers().Insert(L"Origin", GetOrigin(s_origin));
690
+ preflightRequest.Headers().Insert(L"Origin", GetOrigin(m_origin));
695
691
  preflightRequest.Headers().Insert(L"Sec-Fetch-Mode", L"CORS");
696
692
 
697
693
  co_return {co_await m_innerFilter.SendRequestAsync(preflightRequest)};
@@ -708,7 +704,7 @@ bool OriginPolicyHttpFilter::OnRedirecting(
708
704
  // origin=http://a.com. Since the origin matches the URL, the request is authorized at http://a.com, but it actually
709
705
  // allows http://b.com to bypass the CORS check at http://a.com since the redirected URL is from http://b.com.
710
706
  if (!IsSameOrigin(response.Headers().Location(), request.RequestUri()) &&
711
- !IsSameOrigin(s_origin, request.RequestUri())) {
707
+ !IsSameOrigin(m_origin, request.RequestUri())) {
712
708
  // By masking the origin field in the request header, we make it impossible for the server to set a single value for
713
709
  // the access-control-allow-origin header. It means, the only way to support redirect is that server allows access
714
710
  // from all sites through wildcard.
@@ -740,7 +736,7 @@ ResponseOperation OriginPolicyHttpFilter::SendRequestAsync(HttpRequestMessage co
740
736
  // Allow only HTTP or HTTPS schemes
741
737
  if (GetRuntimeOptionBool("Http.StrictScheme") && coRequest.RequestUri().SchemeName() != L"https" &&
742
738
  coRequest.RequestUri().SchemeName() != L"http")
743
- throw hresult_error{E_INVALIDARG, L"Invalid URL scheme: [" + s_origin.SchemeName() + L"]"};
739
+ throw hresult_error{E_INVALIDARG, L"Invalid URL scheme: [" + m_origin.SchemeName() + L"]"};
744
740
 
745
741
  if (!GetRuntimeOptionBool("Http.OmitCredentials")) {
746
742
  coRequest.Properties().Lookup(L"RequestArgs").as<RequestArgs>()->WithCredentials = false;
@@ -777,7 +773,7 @@ ResponseOperation OriginPolicyHttpFilter::SendRequestAsync(HttpRequestMessage co
777
773
 
778
774
  if (originPolicy == OriginPolicy::SimpleCrossOriginResourceSharing ||
779
775
  originPolicy == OriginPolicy::CrossOriginResourceSharing) {
780
- coRequest.Headers().Insert(L"Origin", GetOrigin(s_origin));
776
+ coRequest.Headers().Insert(L"Origin", GetOrigin(m_origin));
781
777
  }
782
778
 
783
779
  auto response = co_await m_innerFilter.SendRequestAsync(coRequest);
@@ -37,9 +37,6 @@ class OriginPolicyHttpFilter
37
37
  static std::set<const wchar_t *, CaseInsensitiveComparer> s_corsForbiddenRequestHeaderNamePrefixes;
38
38
  static std::set<const wchar_t *, CaseInsensitiveComparer> s_cookieSettingResponseHeaders;
39
39
 
40
- // NOTE: Assumes static origin through owning client/resource/module/(React) instance's lifetime.
41
- static winrt::Windows::Foundation::Uri s_origin;
42
-
43
40
  struct AccessControlValues {
44
41
  winrt::hstring AllowedOrigin;
45
42
  winrt::hstring AllowedCredentials;
@@ -49,11 +46,11 @@ class OriginPolicyHttpFilter
49
46
  size_t MaxAge;
50
47
  };
51
48
 
49
+ winrt::Windows::Foundation::Uri m_origin;
50
+
52
51
  winrt::Windows::Web::Http::Filters::IHttpFilter m_innerFilter;
53
52
 
54
53
  public:
55
- static void SetStaticOrigin(std::string &&url);
56
-
57
54
  static bool IsSameOrigin(
58
55
  winrt::Windows::Foundation::Uri const &u1,
59
56
  winrt::Windows::Foundation::Uri const &u2) noexcept;
@@ -80,9 +77,9 @@ class OriginPolicyHttpFilter
80
77
  winrt::Windows::Web::Http::HttpResponseMessage const &response,
81
78
  bool removeAll);
82
79
 
83
- OriginPolicyHttpFilter(winrt::Windows::Web::Http::Filters::IHttpFilter const &innerFilter);
80
+ OriginPolicyHttpFilter(std::string &&origin, winrt::Windows::Web::Http::Filters::IHttpFilter const &innerFilter);
84
81
 
85
- OriginPolicyHttpFilter();
82
+ OriginPolicyHttpFilter(std::string &&origin);
86
83
 
87
84
  OriginPolicy ValidateRequest(winrt::Windows::Web::Http::HttpRequestMessage const &request);
88
85
 
@@ -641,8 +641,7 @@ void WinRTHttpResource::AddResponseHandler(shared_ptr<IResponseHandler> response
641
641
 
642
642
  #pragma region IHttpResource
643
643
 
644
- /*static*/ shared_ptr<IHttpResource> IHttpResource::Make(
645
- winrt::Windows::Foundation::IInspectable const &inspectableProperties) noexcept {
644
+ /*static*/ shared_ptr<IHttpResource> IHttpResource::Make(IInspectable const &inspectableProperties) noexcept {
646
645
  using namespace winrt::Microsoft::ReactNative;
647
646
  using winrt::Windows::Web::Http::HttpClient;
648
647
 
@@ -653,8 +652,7 @@ void WinRTHttpResource::AddResponseHandler(shared_ptr<IResponseHandler> response
653
652
  client = HttpClient{redirFilter};
654
653
  } else {
655
654
  auto globalOrigin = GetRuntimeOptionString("Http.GlobalOrigin");
656
- OriginPolicyHttpFilter::SetStaticOrigin(std::move(globalOrigin));
657
- auto opFilter = winrt::make<OriginPolicyHttpFilter>(redirFilter);
655
+ auto opFilter = winrt::make<OriginPolicyHttpFilter>(std::move(globalOrigin), redirFilter);
658
656
  redirFilter.as<RedirectHttpFilter>()->SetRedirectSource(opFilter.as<IRedirectEventSource>());
659
657
 
660
658
  client = HttpClient{opFilter};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.73.10",
3
+ "version": "0.73.12",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,13 +23,13 @@
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.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",
26
+ "@react-native-community/cli": "12.3.6",
27
+ "@react-native-community/cli-platform-android": "12.3.6",
28
+ "@react-native-community/cli-platform-ios": "12.3.6",
29
+ "@react-native-windows/cli": "0.73.3",
30
30
  "@react-native/assets-registry": "0.73.1",
31
31
  "@react-native/codegen": "0.73.3",
32
- "@react-native/community-cli-plugin": "0.73.16",
32
+ "@react-native/community-cli-plugin": "0.73.17",
33
33
  "@react-native/gradle-plugin": "0.73.4",
34
34
  "@react-native/js-polyfills": "0.73.1",
35
35
  "@react-native/normalize-colors": "0.73.2",
@@ -64,7 +64,7 @@
64
64
  "yargs": "^17.6.2"
65
65
  },
66
66
  "devDependencies": {
67
- "@react-native-windows/codegen": "0.73.0",
67
+ "@react-native-windows/codegen": "0.73.1",
68
68
  "@react-native/metro-config": "^0.73.0",
69
69
  "@rnw-scripts/babel-react-native-config": "0.0.0",
70
70
  "@rnw-scripts/eslint-config": "1.2.3",
@@ -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.4",
84
+ "react-native": "0.73.6",
85
85
  "react-native-platform-override": "^1.9.16",
86
86
  "react-refresh": "^0.4.0",
87
87
  "typescript": "^4.9.5"
@@ -91,11 +91,14 @@
91
91
  "react-native": "^0.73.0"
92
92
  },
93
93
  "beachball": {
94
- "defaultNpmTag": "latest",
94
+ "defaultNpmTag": "v0.73-stable",
95
95
  "disallowedChangeTypes": [
96
96
  "major",
97
97
  "minor",
98
- "prerelease"
98
+ "prerelease",
99
+ "premajor",
100
+ "preminor",
101
+ "prepatch"
99
102
  ],
100
103
  "gitTags": true
101
104
  },