Repository navigation
Conversation
Prevent Razor class library fallbacks from flowing into referencing WebView apps and colliding with the app-owned modules manifest. Add direct-reference regression coverage and harden the consumer-build feed handling. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 4bdabca4-54b7-4e91-b94f-a51598a74d0f
There was a problem hiding this comment.
Pull request overview
This PR adjusts the WebView _framework/blazor.modules.json fallback static web asset so it remains available to each direct consumer project while preventing a library-owned fallback from flowing across ProjectReference boundaries and causing duplicate-asset conflicts during static web assets aggregation.
Changes:
- Change the WebView modules fallback asset authoring from
AssetMode="All"toAssetMode="CurrentProject"to prevent project-reference propagation. - Add end-to-end publish tests covering the direct app + direct RCL WebView-reference graphs (with and without RCL JS modules) to validate a single manifest is produced/served.
- Make consumer test build infrastructure more robust by omitting a non-existent local package source and tightening “network failure” detection so missing local sources don’t cause silent skips.
Show a summary per file
| File | Description |
|---|---|
| src/Components/WebView/WebView/src/StaticWebAssets.Groups.targets | Keeps the modules-manifest fallback scoped to the current project to avoid cross-project duplicate assets. |
| src/Components/WebView/test/StaticWebAssets/WebViewBuildBehaviorTests.cs | Adds publish-behavior coverage for app+RCL graphs where both reference WebView, asserting exactly one served/published manifest. |
| src/Components/WebView/test/StaticWebAssets/ConsumerBuild.cs | Improves hermetic consumer build setup by conditionally adding local feeds and refining network-failure skip detection. |
Review details
Tip
Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
|
/azp run |
|
Azure Pipelines: Successfully started running 4 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. |
|
/azp run |
|
Azure Pipelines: Successfully started running 4 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. |
|
/azp run |
|
Azure Pipelines: Successfully started running 4 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. |
|
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime. |
kubaflo
left a comment
There was a problem hiding this comment.
Current-head review — dfc711111e06e2cae20283c4f3d484b71d8a0b6b
No new high-confidence actionable finding identified. I inspected the full fallback target, consumer-build helper, both new app/RCL graphs, and the existing manifest lookup/assertion helpers. AssetMode="CurrentProject" scopes the empty fallback rather than changing the generated-module condition or route; the two new cases distinguish an empty fallback from an RCL-generated module list. Optional nonshipping-feed handling and the narrower network classification do not turn a missing local feed into a network skip.
Prior feedback: The existing review contains no concrete finding. All review/inline/issue-comment surfaces were considered; the historical /azp run requests and inactivity notice do not prove a fresh consumer build.
Validation and limits: Target XML parsing and frozen git diff --check pass. No local package pack, SDK consumer publish, real WebView, or app/RCL runtime run was performed. The harness requires repository-built packages and its repository-local SDK; I did not bootstrap that graph. Source inspection is not empirical proof of the SDK's asset propagation. The tests also return early on recognized network failures, so a green aggregate alone cannot prove their route/content assertions executed. Head CI, template, Components E2E, and Build Analysis report success; neutral/skipped jobs are not additional validation.
Scope: GPT-6.1 Sol; no model campaign, native-device execution, visual/browser validation, approval, or merge-readiness claim.
Keep WebView modules fallback project-local
Keep the WebView modules fallback from flowing across project references.
Description
The conditional fallback introduced by #67375 and backported in #67401 correctly avoids colliding with an app-generated
blazor.modules.jsonwhen a single consumer contributes JS modules. A remaining multi-project graph can still produce two fallbacks:Microsoft.AspNetCore.Components.WebView.Both projects independently materialize the package's raw
build/blazor.modules.json. Because the fallback was authored withAssetMode="All", the RCL asset flows across the project-reference boundary asSourceType=Project, SourceId=rcl. It then conflicts with the app's independently materializedSourceType=Discovered, SourceId=appasset at_framework/blazor.modules.json.This changes the fallback to
AssetMode="CurrentProject". That keeps the fallback available to each direct consumer while preventing a library-owned fallback from flowing into referencing projects. It matches the SDK's own build and publish JS-module manifests, which are also current-project-only. SDK conflict detection remains strict; the malformed duplicate is prevented at the package-authoring boundary rather than suppressed during aggregation.The build-behavior coverage now includes the exact direct/direct no-module graph and a sibling graph where the directly-referencing RCL contributes a JS module. The consumer-build helper also omits an optional local package source when its directory does not exist and narrows network-failure detection so a missing local source cannot silently skip product assertions.
Validation
The exact new no-module assertion failed before the product change with:
After changing the fallback to
CurrentProject, the same assertion passes and publishes one empty[]manifest.All five
WebViewBuildBehaviorTestspass against currentmain, covering:Related context: #67375, #67401, and dotnet/sdk#54779.