react-native-windows 0.82.0-preview.7 → 0.82.0

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 (28) hide show
  1. package/Libraries/Components/Switch/Switch.windows.js +1 -1
  2. package/Microsoft.ReactNative/ComponentView.idl +2 -0
  3. package/Microsoft.ReactNative/Composition.Input.idl +7 -0
  4. package/Microsoft.ReactNative/CompositionComponentView.idl +3 -0
  5. package/Microsoft.ReactNative/CompositionSwitcher.idl +8 -1
  6. package/Microsoft.ReactNative/Fabric/ComponentView.cpp +18 -0
  7. package/Microsoft.ReactNative/Fabric/ComponentView.h +9 -0
  8. package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.cpp +12 -0
  9. package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.h +15 -0
  10. package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +15 -0
  11. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +75 -0
  12. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +1 -0
  13. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +161 -17
  14. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +4 -0
  15. package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +56 -82
  16. package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +7 -4
  17. package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +46 -8
  18. package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.h +6 -4
  19. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +33 -0
  20. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +17 -0
  21. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +45 -22
  22. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +3 -0
  23. package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +42 -15
  24. package/PropertySheets/Generated/PackageVersion.g.props +2 -2
  25. package/PropertySheets/WinUI.props +1 -1
  26. package/Scripts/NuGetRestoreForceEvaluateAllSolutions.ps1 +5 -11
  27. package/Scripts/rnw-dependencies.ps1 +15 -1
  28. package/package.json +6 -6
@@ -24,15 +24,28 @@ using namespace Windows::Storage::Streams;
24
24
 
25
25
  namespace Microsoft::ReactNative {
26
26
 
27
+ static const char *ERROR_INVALID_URI = "E_INVALID_URI";
28
+ static const char *ERROR_GET_SIZE_FAILURE = "E_GET_SIZE_FAILURE";
29
+
27
30
  winrt::fire_and_forget GetImageSizeAsync(
28
31
  const winrt::Microsoft::ReactNative::IReactPropertyBag &properties,
29
32
  std::string uriString,
30
33
  winrt::Microsoft::ReactNative::JSValue &&headers,
31
34
  Mso::Functor<void(int32_t width, int32_t height)> successCallback,
32
- Mso::Functor<void()> errorCallback) {
35
+ Mso::Functor<void(const char *errorCode, std::string errorMessage)> errorCallback) {
33
36
  bool succeeded{false};
37
+ const char *errorCode = ERROR_GET_SIZE_FAILURE;
38
+ std::string errorMessage;
34
39
 
35
40
  try {
41
+ // Validate URI is not empty
42
+ if (uriString.empty()) {
43
+ errorCode = ERROR_INVALID_URI;
44
+ errorMessage = "Cannot get the size of an image for an empty URI";
45
+ errorCallback(errorCode, errorMessage);
46
+ co_return;
47
+ }
48
+
36
49
  ReactImageSource source;
37
50
  source.uri = uriString;
38
51
  if (!headers.IsNull()) {
@@ -45,28 +58,38 @@ winrt::fire_and_forget GetImageSizeAsync(
45
58
  winrt::hstring scheme{uri.SchemeName()};
46
59
  bool needsDownload = (scheme == L"http") || (scheme == L"https");
47
60
  bool inlineData = scheme == L"data";
61
+ bool isLocalFile = (scheme == L"file") || (scheme == L"ms-appx") || (scheme == L"ms-appdata");
48
62
 
49
63
  winrt::IRandomAccessStream memoryStream;
50
- if (needsDownload) {
64
+ if (needsDownload || isLocalFile) {
51
65
  memoryStream = co_await GetImageStreamAsync(properties, source);
52
66
  } else if (inlineData) {
53
67
  memoryStream = co_await GetImageInlineDataAsync(source);
54
68
  }
55
- auto result = wicBitmapSourceFromStream(memoryStream);
56
- if (!std::get<std::shared_ptr<facebook::react::ImageErrorInfo>>(result)) {
57
- auto imagingFactory = std::get<winrt::com_ptr<IWICImagingFactory>>(result);
58
- auto wicBmpSource = std::get<winrt::com_ptr<IWICBitmapSource>>(result);
59
- UINT width, height;
60
- if (SUCCEEDED(wicBmpSource->GetSize(&width, &height))) {
61
- successCallback(width, height);
62
- succeeded = true;
69
+
70
+ if (memoryStream) {
71
+ auto result = wicBitmapSourceFromStream(memoryStream);
72
+ if (!std::get<std::shared_ptr<facebook::react::ImageErrorInfo>>(result)) {
73
+ auto imagingFactory = std::get<winrt::com_ptr<IWICImagingFactory>>(result);
74
+ auto wicBmpSource = std::get<winrt::com_ptr<IWICBitmapSource>>(result);
75
+ UINT width, height;
76
+ if (SUCCEEDED(wicBmpSource->GetSize(&width, &height))) {
77
+ successCallback(width, height);
78
+ succeeded = true;
79
+ }
63
80
  }
64
81
  }
65
- } catch (winrt::hresult_error const &) {
82
+ } catch (winrt::hresult_error const &e) {
83
+ errorMessage = "Failed to get image size: " + Microsoft::Common::Unicode::Utf16ToUtf8(std::wstring(e.message())) +
84
+ " for URI: " + uriString;
66
85
  }
67
86
 
68
- if (!succeeded)
69
- errorCallback();
87
+ if (!succeeded) {
88
+ if (errorMessage.empty()) {
89
+ errorMessage = "Failed to get image size for URI: " + uriString;
90
+ }
91
+ errorCallback(errorCode, errorMessage);
92
+ }
70
93
 
71
94
  co_return;
72
95
  }
@@ -85,7 +108,9 @@ void ImageLoader::getSize(std::string uri, React::ReactPromise<std::vector<doubl
85
108
  [result](double width, double height) noexcept {
86
109
  result.Resolve(std::vector<double>{width, height});
87
110
  },
88
- [result]() noexcept { result.Reject("Failed"); });
111
+ [result](const char *errorCode, std::string errorMessage) noexcept {
112
+ result.Reject(React::ReactError{errorCode, errorMessage});
113
+ });
89
114
  });
90
115
  }
91
116
 
@@ -105,7 +130,9 @@ void ImageLoader::getSizeWithHeaders(
105
130
  [result](double width, double height) noexcept {
106
131
  result.Resolve(Microsoft::ReactNativeSpecs::ImageLoaderIOSSpec_getSizeWithHeaders_returnType{width, height});
107
132
  },
108
- [result]() noexcept { result.Reject("Failed"); });
133
+ [result](const char *errorCode, std::string errorMessage) noexcept {
134
+ result.Reject(React::ReactError{errorCode, errorMessage});
135
+ });
109
136
  });
110
137
  }
111
138
 
@@ -10,11 +10,11 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.82.0-preview.7</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.82.0</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>82</ReactNativeWindowsMinor>
16
16
  <ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
17
17
  <ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
18
- <ReactNativeWindowsCommitId>f2e1f06e74a3ae1719f62f057eb02eaa588d4b97</ReactNativeWindowsCommitId>
18
+ <ReactNativeWindowsCommitId>b550ed8512916d3f58fc43e314f25aef5118605e</ReactNativeWindowsCommitId>
19
19
  </PropertyGroup>
20
20
  </Project>
@@ -10,7 +10,7 @@
10
10
  <WinUI3ExperimentalVersion Condition="'$(WinUI3ExperimentalVersion)'==''">2.0.0-experimental3</WinUI3ExperimentalVersion>
11
11
  <!-- This value is also used by the CLI, see /packages/@react-native-windows/cli/.../autolinkWindows.ts -->
12
12
  <WinUI3Version Condition="'$(WinUI3Version)'=='' AND '$(UseExperimentalWinUI3)'=='true'">$(WinUI3ExperimentalVersion)</WinUI3Version>
13
- <WinUI3Version Condition="'$(WinUI3Version)'==''">1.8.251106002</WinUI3Version>
13
+ <WinUI3Version Condition="'$(WinUI3Version)'==''">1.8.260209005</WinUI3Version>
14
14
  <!-- This is needed to prevent build errors with WinAppSDK >= 1.7 trying to double build WindowsAppRuntimeAutoInitializer.cpp -->
15
15
  <WindowsAppSdkAutoInitialize Condition="'$(WindowsAppSdkAutoInitialize)'=='' And $([MSBuild]::VersionGreaterThan('$(WinUI3Version)', '1.7.0'))">false</WindowsAppSdkAutoInitialize>
16
16
  </PropertyGroup>
@@ -20,23 +20,17 @@ try {
20
20
  $packagesSolutions = (Get-ChildItem -File -Recurse -Path $RepoRoot\packages -Filter *.sln ) | Where-Object { !$_.FullName.Contains('node_modules') -and !$_.FullName.Contains('e2etest') }
21
21
  $vnextSolutions = (Get-ChildItem -File -Path $RepoRoot\vnext -Filter *.sln)
22
22
 
23
- # Run all solutions for each platform to ensure all projects are restored
24
- # (some projects are only configured for specific platforms)
25
- $platforms = @("x64","x86","ARM64")
23
+ # Run all solutions with their defaults
26
24
  $($packagesSolutions; $vnextSolutions) | Foreach-Object {
27
- foreach ($platform in $platforms) {
28
- Write-Host Restoring $_.FullName with Platform=$platform
29
- & msbuild /t:Restore /p:RestoreForceEvaluate=true /p:Platform=$platform $_.FullName
30
- }
25
+ Write-Host Restoring $_.FullName with defaults
26
+ & msbuild /t:Restore /p:RestoreForceEvaluate=true $_.FullName
31
27
  }
32
28
 
33
29
  # Re-run solutions that build with UseExperimentalWinUI3
34
30
  $experimentalSolutions = @("playground-composition.sln", "Microsoft.ReactNative.NewArch.sln", "ReactWindows-Desktop.sln");
35
31
  $($packagesSolutions; $vnextSolutions) | Where-Object { $experimentalSolutions -contains $_.Name } | Foreach-Object {
36
- foreach ($platform in $platforms) {
37
- Write-Host Restoring $_.FullName with UseExperimentalWinUI3=true Platform=$platform
38
- & msbuild /t:Restore /p:RestoreForceEvaluate=true /p:UseExperimentalWinUI3=true /p:Platform=$platform $_.FullName
39
- }
32
+ Write-Host Restoring $_.FullName with UseExperimentalWinUI3=true
33
+ & msbuild /t:Restore /p:RestoreForceEvaluate=true /p:UseExperimentalWinUI3=true $_.FullName
40
34
  }
41
35
  }
42
36
  finally {
@@ -469,7 +469,7 @@ $requirements = @(
469
469
  Name = 'Node.js (LTS, >= 22.0)';
470
470
  Tags = @('appDev');
471
471
  Valid = { CheckNode; }
472
- Install = { WinGetInstall OpenJS.NodeJS.LTS "22.14.0" };
472
+ Install = { WinGetInstall OpenJS.NodeJS.22 "22.22.0"};
473
473
  HasVerboseOutput = $true;
474
474
  },
475
475
  @{
@@ -600,6 +600,9 @@ function WinGetInstall {
600
600
  Write-Verbose "Executing `winget install `"$wingetPackage`"";
601
601
  & winget install "$wingetPackage" --accept-source-agreements --accept-package-agreements
602
602
  }
603
+
604
+ # Refresh PATH environment variable to pick up newly installed tools
605
+ $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
603
606
  }
604
607
 
605
608
  function IsElevated {
@@ -685,6 +688,17 @@ foreach ($req in $filteredRequirements)
685
688
  $LASTEXITCODE = 0;
686
689
  $outputFromInstall = Invoke-Command $req.Install -ErrorAction Stop;
687
690
 
691
+ # Re-validate after install attempt - winget may return non-zero for "already installed"
692
+ $validAfterInstall = $false;
693
+ try {
694
+ $validAfterInstall = Invoke-Command $req.Valid;
695
+ } catch { }
696
+
697
+ if ($validAfterInstall) {
698
+ $Installed++;
699
+ continue; # go to the next item
700
+ }
701
+
688
702
  if ($LASTEXITCODE -ne 0) {
689
703
  throw "Last exit code was non-zero: $LASTEXITCODE - $outputFromInstall";
690
704
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.82.0-preview.7",
3
+ "version": "0.82.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,7 +26,7 @@
26
26
  "@react-native-community/cli": "20.0.0",
27
27
  "@react-native-community/cli-platform-android": "20.0.0",
28
28
  "@react-native-community/cli-platform-ios": "20.0.0",
29
- "@react-native-windows/cli": "0.82.0-preview.3",
29
+ "@react-native-windows/cli": "0.82.0",
30
30
  "@react-native/assets": "1.0.0",
31
31
  "@react-native/assets-registry": "0.82.1",
32
32
  "@react-native/codegen": "0.82.1",
@@ -69,7 +69,7 @@
69
69
  "yargs": "^17.6.2"
70
70
  },
71
71
  "devDependencies": {
72
- "@react-native-windows/codegen": "0.82.0-preview.2",
72
+ "@react-native-windows/codegen": "0.82.0",
73
73
  "@react-native/metro-config": "0.82.1",
74
74
  "@rnw-scripts/babel-react-native-config": "0.0.0",
75
75
  "@rnw-scripts/eslint-config": "1.2.38",
@@ -86,7 +86,7 @@
86
86
  "prettier": "2.8.8",
87
87
  "react": "19.1.1",
88
88
  "react-native": "0.82.1",
89
- "react-native-platform-override": "0.82.0-preview.1",
89
+ "react-native-platform-override": "0.82.0",
90
90
  "react-refresh": "^0.14.0",
91
91
  "typescript": "5.0.4"
92
92
  },
@@ -96,11 +96,11 @@
96
96
  "react-native": "^0.82.0"
97
97
  },
98
98
  "beachball": {
99
- "defaultNpmTag": "preview",
99
+ "defaultNpmTag": "latest",
100
100
  "disallowedChangeTypes": [
101
101
  "major",
102
102
  "minor",
103
- "patch",
103
+ "prerelease",
104
104
  "premajor",
105
105
  "preminor",
106
106
  "prepatch"