[Blazor] Rename EnvironmentBoundary component to EnvironmentView - #67369
Merged
Conversation
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
javiercn
marked this pull request as ready for review
June 22, 2026 18:23
Contributor
There was a problem hiding this comment.
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
EnvironmentBoundarytoEnvironmentViewinMicrosoft.AspNetCore.Components.Web. - Updated
PublicAPI.Unshipped.txtto 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 toenvironment-view-testand updating the correspondingBy.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 likeenvironment-view-test(and updating the BasicTestApp container markup) to keep identifiers consistent and easier to search/debug.
javiercn
enabled auto-merge (squash)
June 22, 2026 20:03
Open
3 tasks
ilonatommy
approved these changes
Jun 23, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Renames the newly added
EnvironmentBoundarycomponent toEnvironmentViewper API review decision. The component renders child content conditionally based on the current hosting environment, analogous to MVC's<environment>tag helper.Description
EnvironmentBoundary→EnvironmentViewinMicrosoft.AspNetCore.Components.WebPublicAPI.Unshipped.txtto reflect the new type namenameof/type referencesEnvironmentBoundaryContainer.razor→EnvironmentViewContainer.razorand updated component tagsIndex.razordropdown entry to referenceEnvironmentViewContainerUsage: