Skip to content

Flow mapped assemblies to the Router - #68471

Draft
PureWeen with Copilot wants to merge 6 commits into
mainfrom
copilot/update-router-default-assembly
Draft

Flow mapped assemblies to the Router#68471
PureWeen with Copilot wants to merge 6 commits into
mainfrom
copilot/update-router-default-assembly

Conversation

Copilot AI commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Flow mapped assemblies to the Router

  • 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.

Flow mapped assemblies to the Router

Description

Router required applications to duplicate assembly configuration already supplied to MapRazorComponents. This change flows that configuration through persistent component state.

  • Endpoint configuration

    • Captures the root and additional mapped assemblies as endpoint metadata.
    • Persists their names for interactive Server, WebAssembly, and Auto render modes.
  • Router behavior

    • Uses mapped assemblies when AppAssembly or AdditionalAssemblies are omitted.
    • Preserves explicitly supplied parameters.
    • Retains existing requirements for standalone and classic hosted WebAssembly applications.
  • Templates

    • Simplifies mapped Blazor Web Apps to:
<Router NotFoundPage="typeof(Pages.NotFound)">
    ...
</Router>

Copilot AI and others added 3 commits August 13, 2026 09:00
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 AI changed the title [WIP] Update router to default to current executing assembly Flow mapped assemblies to the Router Aug 13, 2026
Copilot AI requested a review from PureWeen August 13, 2026 09:21
@PureWeen

Copy link
Copy Markdown
Member

@copilot Please revise this draft at 51ee336150fc448ed889ed8766d48f9563b7c5b9 to fix a deterministic Router lifecycle regression.

RouterTest.CanceledFailedOnNavigateAsyncDoesNothing now reaches RefreshRouteTable through RunOnNavigateAsync without first calling SetParametersAsync. The PR makes _appAssembly and _additionalAssemblies authoritative for the route key, but assigns them only in SetParametersAsync. The effective key therefore remains default, Routes is not initialized, and Router.Refresh throws NullReferenceException at line 296. The same failure appeared in Components CI on macOS, Linux, and Windows.

Please remove the SetParameters-only snapshot dependency. Resolve effective assemblies at route-table consumption, with explicit AppAssembly/AdditionalAssemblies taking precedence and configured assemblies used only as fallback. Preserve the endpoint RouteData bypass, the missing-AppAssembly error, explicit parameter authority, and standalone WebAssembly behavior.

Use the existing failing test as the regression, run it directly, then run the complete RouterTest class and the failed Components CI leg. The focused correction has been independently shown to turn the failing test green while all 16 adjacent Router tests pass. After the lifecycle correction, strengthen coverage so at least one test witnesses the mapped-assembly producer/transport path instead of manually seeding only Router state. Keep the PR draft and summarize the correction and exact test results when done.

Copilot AI and others added 2 commits August 13, 2026 14:04
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>

Copilot AI commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Please revise this draft at 51ee336150fc448ed889ed8766d48f9563b7c5b9 to fix a deterministic Router lifecycle regression.

`RouterTest.CanceledFailedOnNavigateAsyncDoesNothi...

Addressed in e1378128 and 3f653b6e. Router now resolves explicit-or-configured assemblies when consuming the route table, without SetParameters-only snapshots. Added endpoint metadata → persistent state → assembly provider coverage. Results: focused regression 1/1 passed; complete RouterTest 16/16 passed; complete Components test assembly 1,291 total (1,283 passed, 8 skipped); complete Endpoints test assembly 877/877 passed. The broader ./src/Components/build.sh -test was also attempted but remained blocked by unrelated local environment failures (missing Playwright browsers and a Photino static-asset conflict). The PR remains draft.

@PureWeen

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Router to default to the current executing assembly for the app assembly if it isn't explicitly specified

2 participants