Conversation
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
|
@copilot Please revise this draft at
Please remove the SetParameters-only snapshot dependency. Resolve effective assemblies at route-table consumption, with explicit Use the existing failing test as the regression, run it directly, then run the complete |
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Addressed in |
|
/azp run |
|
Azure Pipelines: Successfully started running 4 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. |
There was a problem hiding this comment.
Pull request overview
This PR removes the need for Blazor apps to duplicate MapRazorComponents assembly configuration in <Router> by flowing the mapped assemblies through endpoint metadata and persistent component state, allowing Router to default AppAssembly/AdditionalAssemblies when they’re not explicitly provided.
Changes:
- Captures mapped assemblies as endpoint metadata and persists their names into
PersistentComponentStateduring prerendering. - Updates
Routerto use configured assemblies whenAppAssembly/AdditionalAssembliesare omitted, while preserving explicitly supplied parameters. - Simplifies template/test usage by omitting explicit router assembly parameters in mapped Blazor Web App scenarios.
Show a summary per file
| File | Description |
|---|---|
| src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Routes.razor | Simplifies template router usage by removing explicit assembly parameters. |
| src/Components/test/testassets/Components.WasmMinimal/Routes.razor | Adds a switch to test Router behavior with/without explicitly supplied assemblies. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/GlobalInteractivityApp.razor | Exercises configured-assemblies routing path in a test host app. |
| src/Components/Endpoints/test/RazorComponentEndpointFactoryTest.cs | Updates endpoint factory tests for the new assemblies metadata parameter. |
| src/Components/Endpoints/test/RazorComponentEndpointDataSourceTest.cs | Verifies endpoints include the new assemblies metadata. |
| src/Components/Endpoints/test/EndpointHtmlRendererTest.cs | Adds coverage ensuring mapped assemblies are restored via endpoint metadata + persistent state. |
| src/Components/Endpoints/src/Rendering/EndpointHtmlRenderer.cs | Seeds and persists configured assembly names into component state during endpoint initialization. |
| src/Components/Endpoints/src/Discovery/ComponentApplicationBuilder.cs | Exposes configured assembly names for metadata construction. |
| src/Components/Endpoints/src/Builder/RazorComponentEndpointFactory.cs | Attaches the new assemblies metadata to endpoints. |
| src/Components/Endpoints/src/Builder/RazorComponentEndpointDataSource.cs | Builds the configured assembly-name list and creates assemblies metadata. |
| src/Components/Endpoints/src/Builder/RazorComponentApplicationAssembliesMetadata.cs | Introduces endpoint metadata type carrying configured assembly names. |
| src/Components/Components/test/Routing/RouterTest.cs | Adds a test validating Router defaults to configured assemblies when AppAssembly is omitted. |
| src/Components/Components/src/Routing/Router.cs | Implements defaulting logic for AppAssembly / AdditionalAssemblies using configured assemblies. |
| src/Components/Components/src/Routing/RazorComponentApplicationAssemblyProvider.cs | Adds a provider that restores configured assemblies from persistent component state. |
| src/Components/Components/src/PersistentState/PersistentStateProviderServiceCollectionExtensions.cs | Registers the new assembly provider with the persistent-state services. |
Review details
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 15/15 changed files
- Comments generated: 1
- Review effort level: Lite
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 66f5fa5c-4468-42a4-b23d-69ad8b2f1550
|
🕵️ 🤖 LGTM ✅ Agents used: blazor-components-reviewer, cross-cutting-reviewer |
Flow mapped assemblies to the Router
Flow mapped assemblies to the Router
Description
Routerrequired applications to duplicate assembly configuration already supplied toMapRazorComponents. This change flows that configuration through persistent component state.Endpoint configuration
Router behavior
AppAssemblyorAdditionalAssembliesare omitted.Templates