## Description
This PR upgrades the minimum version of `Microsoft.NETCore.UniversalWindowsPlatform` to 6.2.14 for UWP C# projects.
### Type of Change
- Bug fix (non-breaking change which fixes an issue)
### Why
This is long over-due as the latest (and probably last) version of this package hasn't changed in over two years. There's no reason for us to build against an older version. Just as importantly, this brings in a newer version of the .NetNative toolchain, which seems to resolve issues around C# builds hanging at the .NetNative step.
Resolves#14055Resolves#9194Resolves#4869
### What
Updated the minimum version of `Microsoft.NETCore.UniversalWindowsPlatform` to 6.2.14 for UWP C# projects. Added new entries to the props that enable C++ apps to consume C# modules to see the latest versions of .NetNative.
## Screenshots
N/A
## Testing
Verified E2Etests build and run.
## Changelog
Should this change be included in the release notes: _yes_
Update to Microsoft.NETCore.UniversalWindowsPlatform 6.2.14
* Update WinAppSDK from 1.5 to 1.6 (1.6.240923002)
* Change files
* Adding more build fixes due to the fact that WinAppSDK 1.6 has a dependency on Microsoft.Web.WebView2
* Prevent Microsoft.Web.WebView2.Core.dll from being copied to avoid errors on arm64ec
---------
Co-authored-by: winappsdkdata_bot <winappsdkdata_bot@microsoft.com>
## Description
SourceLink is needed to ensure that our NuGet packages have matching source information when symbols are resolved. So we have an `EnableSourceLink` property which tells some of our projects to add source link, and we enable that when doing CI/PR/official builds by setting the property to true when we call msbuild in our pipelines.
This PR makes it so that instead of having to pass that property, the projects themselves automatically build with source link when they need to.
### Type of Change
- New feature (non-breaking change which adds functionality)
### Why
This makes it so that local builds of RNW are closer to the the same nuget restore behavior / packages.lock.json file as when they're built in pipelines.
This is part is working toward resolving #12004 and this functionality was extracted from PR #13634.
### What
Instead of requiring us to call msbuild with `/p:EnableSourceLink=true` for every solution (or relying on setting it in `ExperimentalFeatures.props`) we now detect when our library projects are being built within the repo (detecting the `src-win` folder which isn't present in the NPM publish) and enable source link then.
## Screenshots
N/A
## Testing
N/A
## Changelog
Should this change be included in the release notes: _yes_
Automatically set EnableSourceLink for in-repo builds only
## Description
This PR updates the default versions of `Microsoft.WindowsAppSDK` used to 1.4.240211001 when `<UseWinUI3>true</UseWinUI3>` is specified, and 1.5.240124002-experimental2 when `<UseExperimentalWinUI3>true</UseExperimentalWinUI3>` is specified.
This PR also updates all of the `packages.lock json` files to the defaults.
### Type of Change
- Bug fix (non-breaking change which fixes an issue)
### Why
To keep up with the latest public versions of WinAppSDK.
### What
See above.
## Screenshots
N/A
## Testing
Ran both PR and new Secure PR checks to make sure that everything still builds and works.
## Changelog
Should this change be included in the release notes: yes
Updated WindowsAppSDK dependency to 1.4.240211001
## Description
This PR specifies that all projects should set the msbuild property `RestorePackagesWithLockFile` to `true` by default, not just the C# ones.
This way we can ensure that PR/CI will build reliably because every locked version should be available in the react-native-public ADO feed. Changes to NuGet dependencies in PRs should now explicilty fail if the new package version is not in the ADO feed, and therefore require us to manually approve the addition to the feed (as required by compliance).
Closes#11998
### Type of Change
- Bug fix (non-breaking change which fixes an issue)
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
### Why
This way we can ensure that PR/CI will build reliably because every locked version should be available in the react-native-public ADO feed. Changes to NuGet dependencies in PRs should now explicilty fail if the new package version is not in the ADO feed, and therefore require us to manually approve the addition to the feed (as required by compliance).
Closes#11998
### What
This PR specifies that all projects should set the msbuild property `RestorePackagesWithLockFile` to `true` by default, not just the C# ones.
## Screenshots
N/A
## Testing
N/A
## Changelog
Should this change be included in the release notes: no
* Update packages.lock
* Remove HttpModule.h from OInstance.cpp
* Remove runtime option Blob.EnableModule
* Call SetupHttpResource only once
* Attempt AddNetworkingHandler if HTTP module was not ready
* Change files
* ABI-safe Hermes API and new JSI for Node-API
* Change files
* Use Hermes version 0.1.13 that supports UAP
* Format code
* Merge node-api-jsi project into ReactCommon project
* Fix x86 issues
* Eliminate Linker warnings
* Copy Node-API JSI files to MS.RN.Cxx Nuget
* Remove unnecessary settings from shared projects
* Format code and fix Layout-MSRN-Headers.ps1
* Fix loading Node-API JSI zip
* Remove node-api-jsi project from the playground project
* Update Hermes package version
* Change files
* Fix playground project compilation
* Use node-api-jsi with fixes for C++20
* Fix building playground apps
* Format code
* Make sure that the Hermes inspector works
* Update packages.lock.json files
* Update Hermes version with fixes for prepared scripts
* Use Hermes package 0.1.15 to fix UWP .Net projects
* Use SafeLoadLibrary and remove thread Id check for Jsi::Runtime
## Description
This PR adds configuration files for `cspell`, which is available as a recommended VS Code plugin for this repo. This PR also fixes most "non-breaking" typos (comments, error messages, local names) for code files within the repo.
This PR **does not** add any kind of spell-checking enforcement on the repo.
### Type of Change
N/A
### Why
Clear up misunderstandings in comments / error messages.
### What
What changes were made to the codebase to solve the bug, add the functionality, etc. that you specified above.
## Screenshots
N/A
## Testing
N/A
* fix typescript pathing to react-native/types
* integration 9/26/22
* Change files
* try to fix snapshot test
* fix playground build
* update hermes package
* match ts-jest version to jest version
* update yarn file
* jest done callback not used on async jest tests
* minor fixes
* Change files
* Increase timeout for configToProjectInfo
* fix failure transpiling jest-runner
* another attempt at timeout fix
* more fixes
* defork virtualizedlist
* realign jest version with core - add sample test to rnw and rnwin32 to allow jest to run
* missing space in repo-config package.json
* suppress new c++ warning CI hits
* fix
* Unblock most E2E
* update snapshot
* update snapshot
Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com>
*Description*
This PR updates RNW to build with (and require) Visual Studio 2022. This includes upgrading the `Microsoft.ReactNative.Managed.CodeGen` project to .NET 6.0
This PR does not change the minimum / target Windows SDK versions for RNW or RNW apps.
This PR does not change the language versions of C++ (17) and C# (8.0) used.
*Type of Change*
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
- This change requires a documentation update
*Why*
Visual Studio 2022 is the currently supported version of Visual Studio and what is available to download without an MSDN subscription to access older versions. As Visual Studio 2019 support is reduced/deprecated, we need to migrate.
Closes#8750Closes#9499Closes#10130
*What*
What's changed:
* All VS project files have been updated to require a minimum of VS 2022 (aka version 17.0).
* NuGet-based dependencies that are tied to VS version have been upgraded.
* The `Microsoft.ReactNative.Managed.CodeGen` project has been updated to .NET 6.0
* The snapshots for the codegen tests have been updated to pass
* The E2E Test app has been updated to the latest version of `react-native-xaml` (needed to fix build issues)
* Snapshots for E2E tests have been updated to pass
*Testing*
Builds and tests All tests
* Update packages.lock.json
* Import WinUI package only if OverrideWinUIPackage is not true
* Change files
* Revert Microsoft.ReactNative.Managed.UnitTests.csproj
* CG: Update Newtonsoft.Json to 13.0.1
This PR updates our usage of Newtonsoft.Json to 13.0.1 to resolve two CG
alerts: WS-2022-0161 and GHSA-5crp-9r3c-p9vr
* Change files
* Do not use Blob/FileReader modules on UWP
* Change files
* Upgrade packages.lock.json
* Use runtime option Blob.EnableModule to condition instantiation
* Added BlobModule and IWSModuleContHandler headers
* Implement Blob module
* Avoid raw self pointer in BlobModule
* Implement WebSocketModule msg processing
* clang format
* Don't return until websocketMessage event is sent
* Define CreateBlobModule()
* Add DEF exports
* Add Blob JS tests
* Add Blob JS tests
* Change files
* yarn lint
* Add overrides
* Register BlobModule in DesktopTestRunner
* Keep ignoring WebSocketBlob test by default
* Add BlobModule to default modules list
* Allow 'blob' responseType in HTTP module
* Ensure React Instance can be accessed when using older versions of react-native
* Emit error message on createFromParts failure
* Remove redundant extra modules in Desktop integration tests
* Declare IWebSocketModuleProxy
* Remove Blob and WS module factories from DLL boundary
* Implement IWebSocketModuleProxy
* clang format
* Update packages.lock
* Use winrt::array_view directly in ResolveMessage
* Define InstanceImpl::m_transitionalModuleProperties
* Include CreateModules.h in projects accessing MSRN.Cxx
* Define WinRT class WebSocketModuleContentHandler
- Have BlobModule constructor register the content handler in transitive
property bag CxxNativeModule/WebSocketModuleContentHandler
* Have WebSocketModule use IInspectable as props arg
* Use property bag instead of global singletons for blob helpers
* Store blob helpers in prop bag as weak_ptr
* Replace remaining lock_guard<mutex> in BlobModule
* Define IUriHandler, IReqBodyHandler, IRespHandler.
* IHttpResource::SendRequest - add folly::dynamic data arg
* Add data arg to test SendRequest calls
* First implementation for BlobModuleUriHandler
* Remove WebSocketModuleContentHandler WinRT class
* Implement IBlobPersistor, MemoryBlobPersistor
* clang format
* Update yarn.lock
* Update RctRootVieTagGen location
* Implement addNetworkingHandler
* Fix createFromParts buffer persistence
* Drop WebSocketModule s_sharedState in favor of property bag
* Disable back WebSocketBlob test
* Rename iProperties to inspectableProperties
* Pass ReactContext properties to CreateHttpModule in InstanceWin
* Remove WebSocketModule constructor from x86 DLL boundary
* yarn lint
* Update packages.lock
* Make transitional property bag non-member
* Use blobURIScheme wherever possible
* Pass request content as folly::dynaic.
- Pass request ID directly from JavaScript layer.
* Use constexpr for folly indexes
* Implement GetMimeTypeFromUri
* Finish BlobModule handler implementations.
* Remove unused includes
* Ensure HttpModule::m_resource is set
* clang format
* clang format
* Allow blob responseType
* Use winrt::to_hstring instead of Utf8ToUtf16
* Pass inspectableProperties down to WinRTHttpResource
* Implement IHttpModuleProxy via WinRTHttpResource
* Consume URI handler
- IHttpResource
- Rename SetOnRequest to SetOnRequestSuccess
- Declare SetOnBlobData to pass complex (non-string) response data
* Consume IRequestBodyHandler
* Consume IResponseHandler
* Ensure properties exist in bag before using value
* Update packages lock
* Add missing call to Modules::SendEvent
* Fix Shared filters
* Rename SetOnBlobData to SetOnData (different args)
* Correctly retrieve blob slices
* Correctly retrieve blob slices
* Clang format
* Update project filters
* Drop BlobModuleUriHandler
* Continue handling requests when not blob-supported
* Add BlobTest
* Update packages.lock.json
* Define FileReaderModule
* Implement FileReaderModule
* Complete BlobTest
* Make IBlobPersistor::ResolveMessage throw std::invalid_argument
* Fail on Content-Encoding parsing even if no error handler
* Remove MIME mappings. Currently unused
* MemoryBlobPersistor::ResolveMessage throw on out of bounds
* lint
* Enable BlobTest by default
* Disable Blob test in CI (may hang)
* Move all awaitable code into PerformSendRequest
* Await coroutine methods
* Remove blank lines
* Simplify co_return UntrackResponse
* Use dynamic body for server internal request
* Defne SetOnOptions
* Move url before headers in Response type
* Add dummy preflight filter
* Update x64 exports
* Use strand for server IO context
* Use HTTP message aliases
* Use HTTP message aliases
* Do not keep session references
Allows dropping server scope in tests.
* Comment out server scopes
* Use DynamicRequest|Response alias
* Format
* Use thread vector
* Drop outdated boost package validation in ReactCommon
* Define experimental write strand
* Drop server scope in default test
* Also pass server context to sessions
* Disable resource in default test
* Use Beast example
* Remove unused sample code
* Create HttpServer as listener wrapper
* Pass callbacks down to session
* Strong-name response as DynamicResponse
* Use DynamicRequest in handle_request
* Define HandleRequest as member function
* Lambda-based Respond()
* #if-out original sample code
* Keep count on get: ReaGetSucceeds
* Implement lambda_ using std::function
* Run context in io thread
* Join threads in Stop method
* Port send lambda to MS::R::T::HttpServer
* Update other basic tests
* Ensure Get+Options sequencing
* Clean up comments
* Use Callbacks() method
* Add concurrency argument
* Reduce macro usage
* Fix default OPTIONS handler
* Ensure number of headers
* Define ResponseType
* Use ResponseWrapper for polymorphism
* Define remaining wrapped types (File, String)
* Clean up server code
* (WIP) add test PreflightSucceeds
* catch hresult_error
* Use ProcessRequest result in PreformSendReq
* Rename test header value to Requested
* Propagate orror in ProcessRequest
* Rename OPReqFilter to PrototypeReqFilter
* Port request filter to WinRT IHttpFilter subtype
* Define allowed/forbidden methods and headers
* Define MSRN::Networking::OriginPolicyHttpFilter
* Move networking types into Shared\Networking folder
* Refactor: Move network types to Microsoft::React::Networking
* Clean up commented inline
* Make OPFilter::SendAsync non const
* Remove PrototypeHttpFilter
* Temporarily have desk.ITs depend on CppWinRT
* Define test OriginPolicyHttpFilterTest::UrlsHaveSameOrigin
* Add more same origin tests
* Start implementing ValidateRequest
* Finish ValidateRequest()
* Rename SingleOrigin to SameOrigin
* Implement SendPreflightAsync
* Fix OP assignment and GetOrigin rendering
* Parse Access-Control-Allow-Headers
* Done extracting access control values
* Use request as argument of ValidatePreflightResponse
* clang format
* Pass RequestArgs to request properties
* Pass RequestArgs to ValidateAllowOrigin
* Remove prototype non-WinRT filter
* Implement CorsUnsafeNotForbiddenRequestHeaderNames
* Test WinRT RequestHeader case sensitivity
* Fix ValidateAllowOrigin 4.10.5
* Add HttpOriginPolicyIntegrationTest
* Use boost:iequals to compare method names
* Add server support for CONNECT and TRACE methods
* Make HttpServer port uint16_t
* Prelfight only when OP is CORS.
- Add test SimpleCorsSameOriginSucceededs
- Add test NoCorsCrossOriginPatchSucceededs
- Add test NoCorsCrossOriginFetchRequestSucceeds
- Add test HTTP Server support for PATCH
* Use runtime option Http.StrictScheme
* Drop namespace from OriginPolicy
* Remove Origin from request heders
* Clean includes and usings in WinRTHttpResource.cpp
* Update preflight cache issue references (#9770)
* Pass origin in IHttpResource constructor
* clang format
* Prevent nullptr access when iterating preflight request headers
* Include request content headers in preflight headers list
* Send preflight to original request URL.
- Change test origin URL to non-existing http://example.rnw
- Have OriginPolicyHttpFilter::SendRequestAsync catch hresult_error to
avoid losing info in (...) clause.
* Export APIs Set/GetRuntimeOptionString
- Switch to class-level static origin Uri.
- Define static (global) origin Uri via runtime option
"Http.GlobalOrigin".
* clang format
* Implement TestOriginPolicy to parameterize OP tests
* Clean up non-parameterized tests
* Use constant for dummy cross origin
* Simplify test param constructors
* Start implementing ValidateResponse
* Add more tests
- FullCorsCrossOriginMissingCorsHeadersFails
- FullCorsCrossOriginMismatchedCorsHeaderFails
* clang format
* Change files
* Update namespaces in MSRN solution
* Move RequestArgs and ResponseType into new header
* Implement ExtractAccessControlValues
- Validate test result against ServerParams::Response::result
* Report specific origin mismatch errors in ValidatePreflightResponse
* Declare FullCorsCrossOriginCheckFailsOnPreflightRedirectFails
* Add ABI-safe runtime options free functions.
- Microsoft_React_SetRuntimeOptionBool
- Microsoft_React_SetRuntimeOptionInt
- Microsoft_React_SetRuntimeOptionString
- Microsoft_React_GetRuntimeOptionBool
- Microsoft_React_GetRuntimeOptionInt
- Microsoft_React_GetRuntimeOptionString
* Drop namespaced GetRuntimeOptionString
* Use case-insensitive comparison
* Drop newline from error message
* Return unmanaged copy in GetRuntimeOptionString
* Update FullCorsCrossOriginCheckFailsOnPreflightRedirectFails args
* Disallow preflight redirect.
See https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSExternalRedirectNotAllowed
* Replace winrt::get_self<D,I> with .as<D>
* Drop LF from error messages
* Use self-managed variable port in tests
* Start writing FullCorsCorsCheckFailsOnResponseRedirectFails
* Scope disabling autoredirect to preflight request only
* Update TODOs with open issues
* Compute originAllowed
* Add test FullCorsSameOriginToSameOriginRedirectSucceeds
* Test FullCorsSameOriginToCrossOriginRedirectSucceeds
* Test FullCorsCrossOriginToOriginalOriginRedirectFails
* Declare FullCorsCrossOriginToAnotherCrossOriginRedirectSucceeds
* Implement OriginPolicyHttpFilter::ConstWcharComparer
* Use _wcsicmp instead of boost::iequals in ConstWcharComparer
* Correct SimpleCORS value search
* Disable FullCorsCrossOriginWithCredentialsSucceeds for now
* Rename type alias ResponseType to ResponseOperation
* clang format
* Handle originPolicy a request property instead of a member variable
* Avoid iterating response headers while removing items
* Gracefully fail when adding bad request headers
- Write remaining integration tests
* Use boost::iequals in PerformSendRequest
* clang format
* Use s_port for redirServer args
* Rename TestOriginPolicy to TestOriginPolicyWithRedirect
* Temporarily disabled tests
- FullCorsCrossOriginToAnotherCrossOriginRedirectWithPreflightSucceeds -
pending redirect
- FullCorsRequestWithHostHeaderFails - Host request header is probematic
* Use std::queue for nonSimpleNames
* Finish ValidateResponse
* Clean up comments
* Add Test ExcludeHttpOnlyCookies
* Add tests KeepNonHttpOnlyCookies, RemoveAllCookies
* Address TODO comments
* Always allow simple-CORS methods in preflight
* Avoid auto for loop indexe sused against container .size()
* Update Desktop.Test.DLL exports for ARM64
* Skip test FullCorsCrossOriginToAnotherCrossOriginRedirectSucceeds
* Disable FullCorsCrossOriginToAnotherCrossOriginRedirectWithPreflightFails
* Ignore SimpleCorsForbiddenMethodFails
* Ignore SimpleCorsCrossOriginFetchFails
* RequestWithProxyAuthorizationHeaderFails
* Ignore SimpleCorsSameOriginSucceededs
* Ignore NoCorsCrossOriginFetchRequestSucceeds
* Revert "Ignore NoCorsCrossOriginFetchRequestSucceeds"
This reverts commit b5445fb5af.
* Revert "Ignore SimpleCorsSameOriginSucceededs"
This reverts commit ab75c37373.
* Revert "RequestWithProxyAuthorizationHeaderFails"
This reverts commit 70148b17de.
* Revert "Ignore SimpleCorsCrossOriginFetchFails"
This reverts commit 982e4508b9.
* Revert "Ignore SimpleCorsForbiddenMethodFails"
This reverts commit 869bda9782.
* Revert "Disable FullCorsCrossOriginToAnotherCrossOriginRedirectWithPreflightFails"
This reverts commit e9e178a07a.
* Revert "Skip test FullCorsCrossOriginToAnotherCrossOriginRedirectSucceeds"
This reverts commit 6688e7dce5.
* Skip OP integration tests
* Empty commit
* Use scoped_lock for runtime options
* Testing signature
* Have C++ Rt Option functions call ABI-safe ones
* Ensure different ports for each netwk test class
* Remove remaining hard-coded ports from WS tests
* Use ABI-safe callback for GetRtOptString
* Only insert boolean rt options when true
* Use static variable for port in HttpResourceIntegrationTest
* Add HttpResourceIntegrationTest::SimpleRedirectSucceeds
* Move C++ Rt Optio APIs to new header CppRuntimeOptions.h
* Implement internal Set/GetRuntimeOptionString
* clang format
* Rename Microsoft_React_* functions to MicrosoftReact*
* Update nuspec
* Normalize package reference for WinUI between C# and C++ templates
The targets for RNW UWP apps followed different patterns when trying to include WinUI. C++ included a one-liner with the WinUI package name and version props, directly in the app project file. C# ignored the props and used a large MSBuild conditional block directly in the app project file.
This change moves to using the one-liner for both, and puts it into the external targets file. Users who want to specify a different version can override the props (what we want) rather than modifying their project file. I've also moved around some of the other references so that the CsharpApp and CppApp targets are more normalized.
Closes#8486
* Migrate `vnext` projects to `PackageReference`.
* Allow `run-windows` to directly restore `package.config` files when conflicting with `PackageReference` items.
* Allow parameterizing package names and versions which can be handled as any MSBuild property.
* Migrate C++ templates to `PackageReference`.
* Drop `packages` directory for `vnext` projects NuGet dependencies.\
Dependencies will be accessed directly at the downloaded NuGet `globalPackagesFolder` using `msbuild /restore`.\
This removes redundant copies of downloaded packages.
* NuGet Caching Improvements
We are only caching the directory that packages.config style projects restore to. Cache the ProjectReference ones.
Enforces that lockfiles are updated in CI, so that we do not see lockfile changes during build interfering with cache. Updated related projects to look more like template, and fix non-deterministic lockfiles.
Adds logic to only cache the zipped nupkg files, since the nuget cache directory redundantly includes both them, and loose extracted files.
* fixes
* try diffferent glob
* fixes
* update directoeries
* typo
* try different glob
* No partial restore
* remove caching
* Cache NuGet Packages in CI
We keep on seeing network instability with NuGet restore. Locally cache the NuGet packages to try to fix some instability, and maybe speed things up a bit.
* Add PackageReference Locks
* Change files
* rnw-img-test
* separate dir
* typo
* invalidate cache
* Update msbuild.sln
* smh
* Update `run-windows-with-certificates` cache key
* Revert test image