You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add URL and URLSearchParams browser platform APIs - #69925
Project URL and URLSearchParams through the Components Platform package, including caller-owned URL lifetimes, live search parameter iterators, unit coverage, and Interactive Server and WebAssembly browser tests.
You've included unit or integration tests for your change, where applicable.
You've included inline docs for your change, where applicable.
There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.
Summary of the changes (Less than 80 chars)
Description
Add typed URL and URLSearchParams browser APIs
Description
Projects the browser URL and URLSearchParams APIs through Microsoft.AspNetCore.Components.Platform.
Adds Window.Url and Window.UrlSearchParams constructor facades.
Supports URL construction, parsing, validation, property access, mutation, and serialization.
Makes caller-created Url instances caller-owned through IAsyncDisposable.
Exposes Url.SearchParams as a stable, non-disposable borrowed wrapper.
Uses UrlSearchParamsOwner for independently constructed query parameter collections.
Supports string, record, and ordered sequence URLSearchParams constructor inputs.
Projects live entries(), keys(), and values() iterators as caller-owned asynchronous wrappers.
Adds complete XML documentation and updates PublicAPI.Unshipped.txt.
Adds focused unit and public API tests.
Adds real-browser coverage for Interactive Server and WebAssembly.
URL.createObjectURL(), URL.revokeObjectURL(), and callback-based URLSearchParams.forEach() are deferred. Object URLs require a projected Blob or MediaSource, and JavaScript-to-.NET callbacks do not yet have an established Components Platform design.
Project URL and URLSearchParams through the Components Platform package, including caller-owned URL lifetimes, live search parameter iterators, unit coverage, and Interactive Server and WebAssembly browser tests.
Co-authored-by: Copilot <[email protected]>
Refactor disposal logic to ensure _searchParams is checked before disposal and use finally block for _reference disposal.
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Unresolved issues allow pending SearchParams acquisition to leak a browser reference after disposal and cause iterator advancement to fail when reflection-based JSON serialization is disabled.
No open issues 🎉
2 previously missed issues
In code that hasn't changed since last review
Release SearchParams references acquired after URL disposal
Disposing a URL while its first SearchParams reference acquisition is pending skips cleanup permanently; the awaiting operation can then use the late reference, which remains cached in the browser. Release late references and reject the awaiting operation in the acquisition-completion path, without making DisposeAsync wait. Extend UrlDisposal_DoesNotWaitForPendingSearchParamsAcquisition to complete acquisition after disposal and assert that the returned reference is released.
Provide source-generated JSON metadata for iterator results
With reflection-based JSON serialization disabled and source-generated circuit resolvers configured, the first iterator advance fails because no resolver supplies metadata for IteratorResult. Application source-generated contexts cannot reference this private nested type. Use JsonElement with registered metadata and read its done/value fields, or supply package-owned serialization metadata for the internal result.
⚠️ Documentation appears necessary, but a draft PR could not be created.
Confidence that documentation is needed: 85%
Drafted a new Blazor JS interop article for the browser URL and URLSearchParams APIs, with a TOC entry scoped to 12.0+. The IBrowserPlatform xref wasn't verified against dotnet-api-docs.
Documentation surfaces considered
Conceptual article: Required — New public Url/UrlSearchParams/WindowUrlExtensions APIs in PublicAPI.Unshipped.txt.
Migration guidance: Not required — New opt-in APIs; no upgrade action.
Breaking change: Not required — Purely additive; no removed or changed behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Project URL and URLSearchParams through the Components Platform package, including caller-owned URL lifetimes, live search parameter iterators, unit coverage, and Interactive Server and WebAssembly browser tests.
Add URL and URLSearchParams browser platform APIs
Summary of the changes (Less than 80 chars)
Description
Add typed URL and URLSearchParams browser APIs
Description
Projects the browser
URLandURLSearchParamsAPIs throughMicrosoft.AspNetCore.Components.Platform.Window.UrlandWindow.UrlSearchParamsconstructor facades.Urlinstances caller-owned throughIAsyncDisposable.Url.SearchParamsas a stable, non-disposable borrowed wrapper.UrlSearchParamsOwnerfor independently constructed query parameter collections.URLSearchParamsconstructor inputs.entries(),keys(), andvalues()iterators as caller-owned asynchronous wrappers.PublicAPI.Unshipped.txt.URL.createObjectURL(),URL.revokeObjectURL(), and callback-basedURLSearchParams.forEach()are deferred. Object URLs require a projectedBloborMediaSource, and JavaScript-to-.NET callbacks do not yet have an established Components Platform design.API proposal: #69924
Part of #69881