Skip to content

Move BasePath into Components.Web - #69118

Closed
Youssef1313 wants to merge 2 commits into
release/11.0from
dev/ygerges/basepath-rebased
Closed

Move BasePath into Components.Web#69118
Youssef1313 wants to merge 2 commits into
release/11.0from
dev/ygerges/basepath-rebased

Conversation

@Youssef1313

@Youssef1313 Youssef1313 commented Sep 8, 2026

Copy link
Copy Markdown
Member

Move BasePath into Components.Web

BasePath is a new component (public API) introduced in .NET 11 Preview 1. It was put in the wrong namespace (and wrong assembly).

Description

We added BasePath in #64590, but it requires users to pay attention to the namespaces they imported and add an additional @using.

Fixes #69115

Customer Impact

The change makes it for a more friendly usage of a new component that we added in .NET 11.

Regression?

No

Risk

Low.

BasePath is a new component in .NET 11 and the change here is just the namespace.

Verification

No verification needed. This is a public API change.

Packaging changes reviewed?

N/A

@Youssef1313 Youssef1313 added the Servicing-consider Shiproom approval is required for the issue label Sep 8, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hi @Youssef1313. Please make sure you've updated the PR description to use the Shiproom Template. Also, make sure this PR is not marked as a draft and is ready-to-merge.

To learn more about how to prepare a servicing PR click here.

namespace Microsoft.AspNetCore.Components.Endpoints;
namespace Microsoft.AspNetCore.Components.Web;

public class BasePathTest

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Can his class be moved to src/Components/web/test?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved it to src/Components/Web/test/BasePathTest.cs (commit 9cbec92) — all 3 tests pass there.

Note: pushing is currently blocked in my environment by a repository ruleset ("Cannot create ref due to creations being restricted" for refs/heads/dev/ygerges/basepath-rebased), so the commit may not appear on the PR until that's resolved.

@javiercn
javiercn marked this pull request as ready for review September 8, 2026 13:35
Copilot AI lite review requested due to automatic review settings September 8, 2026 13:35
@javiercn
javiercn requested a review from a team as a code owner September 8, 2026 13:35
@javiercn

javiercn commented Sep 8, 2026

Copy link
Copy Markdown
Member

#69117

@javiercn javiercn closed this Sep 8, 2026
@Youssef1313
Youssef1313 deleted the dev/ygerges/basepath-rebased branch September 8, 2026 13:38
@Youssef1313

Copy link
Copy Markdown
Member Author

#69117

It was intentional to get it faster - but fine for me if you want to get it in main first.

In general though, during RC2, I personally have always preferred to deal with release/11.0 PR only and then let the automation do its thing to get it in main.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The API move is consistently applied across templates/samples/tests and public API files, with only a minor test-ownership/discoverability nit.

Pull request overview

Moves the new BasePath Blazor component into the Microsoft.AspNetCore.Components.Web namespace (and corresponding public API surface) so typical Blazor Web apps can use <BasePath /> without adding an extra @using.

Changes:

  • Relocates the BasePath public API from Microsoft.AspNetCore.Components.Endpoints to Microsoft.AspNetCore.Components.Web.
  • Updates shipped templates/samples/testassets to stop importing Microsoft.AspNetCore.Components.Endpoints just to use BasePath.
  • Updates PublicAPI.Unshipped.txt files to reflect the API move between Components assemblies.
File summaries
File Description
src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/_Imports.razor Removes the Endpoints @using now that BasePath is in Components.Web.
src/Components/Web/src/PublicAPI.Unshipped.txt Adds Microsoft.AspNetCore.Components.Web.BasePath to the Web API surface.
src/Components/Web/src/BasePath.cs Changes BasePath namespace to Microsoft.AspNetCore.Components.Web.
src/Components/test/testassets/Components.TestServer/RazorComponents/Root.razor Removes Endpoints @using while still using <BasePath />.
src/Components/test/testassets/Components.TestServer/RazorComponents/RemoteAuthenticationApp.razor Removes Endpoints @using while still using <BasePath />.
src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/ResourceCollection/Index.razor Removes Endpoints @using (no longer needed).
src/Components/test/testassets/Components.TestServer/RazorComponents/NamedFormContextNoFormContextApp.razor Removes Endpoints @using while still using <BasePath />.
src/Components/test/testassets/Components.TestServer/RazorComponents/App.razor Removes Endpoints @using while still using <BasePath />.
src/Components/Samples/BlazorWebAppPerPage/Components/_Imports.razor Removes Endpoints @using now that BasePath is in Components.Web.
src/Components/Samples/BlazorWebAppGlobal/Components/_Imports.razor Removes Endpoints @using now that BasePath is in Components.Web.
src/Components/Endpoints/test/Routing/BasePathTest.cs Updates test namespace to Microsoft.AspNetCore.Components.Web.
src/Components/Endpoints/src/PublicAPI.Unshipped.txt Removes the BasePath API entries from the Endpoints surface.
Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

#nullable enable

namespace Microsoft.AspNetCore.Components.Endpoints;
namespace Microsoft.AspNetCore.Components.Web;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Servicing-consider Shiproom approval is required for the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants