Skip to content

[Blazor] Rename EnvironmentBoundary component to EnvironmentView - #67369

Merged
javiercn merged 2 commits into
mainfrom
copilot/add-environment-boundary-component
Jun 23, 2026
Merged

[Blazor] Rename EnvironmentBoundary component to EnvironmentView#67369
javiercn merged 2 commits into
mainfrom
copilot/add-environment-boundary-component

Conversation

Copilot AI commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Renames the newly added EnvironmentBoundary component to EnvironmentView per API review decision. The component renders child content conditionally based on the current hosting environment, analogous to MVC's <environment> tag helper.

Description

  • Renamed EnvironmentBoundaryEnvironmentView in Microsoft.AspNetCore.Components.Web
  • Updated PublicAPI.Unshipped.txt to reflect the new type name
  • Renamed unit test file and updated all nameof/type references
  • Renamed E2E test file and updated all references
  • Renamed EnvironmentBoundaryContainer.razorEnvironmentViewContainer.razor and updated component tags
  • Updated Index.razor dropdown entry to reference EnvironmentViewContainer

Usage:

<EnvironmentView Include="Development">
    <p>Debug mode enabled</p>
</EnvironmentView>

<EnvironmentView Exclude="Production">
    <p>@DateTime.Now</p>
</EnvironmentView>
  • You've read the Contributor Guide and Code of Conduct.
  • 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.

Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
Copilot AI changed the title [WIP] Add EnvironmentBoundary component for Blazor Rename EnvironmentBoundary to EnvironmentView in Blazor Components.Web Jun 22, 2026
Copilot AI requested a review from javiercn June 22, 2026 18:22
@javiercn javiercn changed the title Rename EnvironmentBoundary to EnvironmentView in Blazor Components.Web [Blazor] Rename EnvironmentBoundary component to EnvironmentView Jun 22, 2026
@javiercn
javiercn marked this pull request as ready for review June 22, 2026 18:23
@javiercn
javiercn requested a review from a team as a code owner June 22, 2026 18:23
Copilot AI review requested due to automatic review settings June 22, 2026 18:23

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.

Pull request overview

This PR applies an API review rename by changing the newly introduced Blazor component EnvironmentBoundary to EnvironmentView, keeping the feature behavior the same (conditional rendering based on IHostEnvironment.EnvironmentName) while updating public API declarations and test/assets references accordingly.

Changes:

  • Renamed the component type and docs from EnvironmentBoundary to EnvironmentView in Microsoft.AspNetCore.Components.Web.
  • Updated PublicAPI.Unshipped.txt to reflect the renamed public API surface.
  • Updated unit tests, E2E tests, and BasicTestApp test assets to use the new component/container names.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Components/Web/src/EnvironmentView.cs Renames the component type and updates XML docs/examples to EnvironmentView.
src/Components/Web/src/PublicAPI.Unshipped.txt Updates unshipped public API entries for the renamed component type and members.
src/Components/Web/test/EnvironmentViewTest.cs Renames the unit test class/helpers and updates nameof(...) references to EnvironmentView.
src/Components/test/testassets/BasicTestApp/Index.razor Updates the test selector entry to mount EnvironmentViewContainer.
src/Components/test/testassets/BasicTestApp/EnvironmentViewContainer.razor Renames the test asset container and updates component tags to <EnvironmentView>.
src/Components/test/E2ETest/Tests/EnvironmentViewTest.cs Renames the E2E test class/ctor and mounts EnvironmentViewContainer.
Comments suppressed due to low confidence (2)

src/Components/test/testassets/BasicTestApp/EnvironmentViewContainer.razor:5

  • The container still uses the old DOM id environment-boundary-test, which no longer matches the renamed component/container and makes the E2E test selectors misleading. Consider renaming this id to environment-view-test and updating the corresponding By.Id(...) lookups in the E2E test.
    src/Components/test/E2ETest/Tests/EnvironmentViewTest.cs:27
  • Later in this test, the element lookup still uses the old id environment-boundary-test. Since this test is being updated for the EnvironmentView rename, consider also renaming that id to something like environment-view-test (and updating the BasicTestApp container markup) to keep identifiers consistent and easier to search/debug.

@ilonatommy ilonatommy added the area-blazor Includes: Blazor, Razor Components label Jun 23, 2026
@javiercn
javiercn merged commit 2a0f0e0 into main Jun 23, 2026
32 checks passed
@javiercn
javiercn deleted the copilot/add-environment-boundary-component branch June 23, 2026 07:01
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants