Repository navigation
[blazor] Migrate startup callbacks to runtime builder APIs - #69848
Conversation
Register config-loaded and download-progress callbacks through the runtime host builder, keeping module-specific options in withModuleConfig. Sync the vendored runtime declarations with the runtime callback migration. Co-authored-by: Copilot App <[email protected]>
|
We shouldn't add a preview/RC milestone to PRs manually. That happens via automation after PR gets merged and flows to VMR. |
Co-authored-by: Copilot App <[email protected]>
There was a problem hiding this comment.
🔵 Needs a closer look
The consumed runtime reportedly predates the required builder APIs, leaving dependency alignment and real-browser WebAssembly and Auto startup verification unresolved.
No open issues 🎉
What changed in this PR
Moves Blazor WebAssembly startup callbacks from Emscripten Module configuration to runtime host builder APIs, aligning startup with the runtime’s lifecycle callback migration.
Changes:
- Registers configuration-loaded and download-progress callbacks before the application’s
configureRuntimehook. - Inlines runtime configuration setup while retaining environment overrides through
withApplicationEnvironment. - Refreshes the vendored runtime declarations from the linked Mono runtime snapshot.
Runtime dependency updates and browser startup verification remain pending, as noted in the PR description.
| File | Description |
|---|---|
src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts |
Moves lifecycle callbacks to builder APIs and inlines configuration setup. |
src/Components/dotnet-runtime-js/dotnet.d.ts |
Updates runtime declarations, including the new callback registration APIs. |
Review effort: Balanced
|
/review |
There was a problem hiding this comment.
Source-only review of frozen head 0ead91cd2a854244b90e2efce0109d80a9dda26d.
One externally unresolved P2 candidate is noted inline: application configureRuntime code may replace Blazor's withConfigLoaded callback, but the frozen bundle lacks the dotnet/runtime builder implementation needed to establish replace-versus-compose semantics.
Both routed guides completed their in-scope source checks: docs/CrossCuttingGuidance.md and docs/BlazorComponentsGuidance.md. Existing feedback was checked; review 5786841721 broadly notes runtime alignment/browser verification, and inline comment 4481955864 requests the latest runtime declaration, but neither establishes or duplicates this callback-semantics candidate. No fresh-feedback check after bundle preparation is claimed.
Execution, tests, CI, browser workflows, samples, and security assessment were excluded by the supplied source-only boundary. No materially changed area was left without a routed guide. Provenance: trusted version-2 bundle, guidance commit 6aacb16a27a677d16278a9814ed04f871020854b, merge base/base tip 6aacb16a27a677d16278a9814ed04f871020854b. Limitations: tracked Git bytes only; runtime implementation and browser execution evidence were unavailable.
Generated by ASP.NET Core Pull Request Review for #69848 · copilot · gpt56 · 150 AIC · ⌖ 18.3 AIC · ⊞ 18.8K
Comment /review to run again
|
Copilot's local review panel found no blocking issues at this commit. The open |
Use the generated CoreCLR declarations from runtime main CI build 1666566 and update consumers to LoaderConfig. Co-authored-by: Copilot App <[email protected]>
|
✅ No documentation PR was created. Confidence that documentation is needed: 8% No docs needed: internal refactoring of Blazor WebAssembly startup callback registration. Documentation surfaces considered
|
Migrate Blazor startup callbacks to runtime builder APIs
Move Blazor lifecycle callbacks onto the runtime host builder.
Description
The runtime migration in dotnet/runtime#134642 moved .NET lifecycle callbacks off Emscripten Module configuration and into loader-owned state. Blazor should register its callbacks through the dedicated builder APIs rather than depend on the runtime's compatibility shim. Dropped config-loaded callbacks leave application-environment accessors and related initialization unavailable.
Register
withConfigLoadedandwithDownloadResourceProgressdirectly increateRuntimeInstance, afterwithModuleConfigand before the application'sconfigureRuntimehook. Keep the remaining Module configuration and use the existingwithApplicationEnvironmentcall for the environment override. Inline the single-use configuration construction and config-loaded callback, and replace the vendoreddotnet.d.tswith the Mono runtime declaration snapshot from the runtime PR.No legacy API fallback is included. This requires runtime builds containing dotnet/runtime#134642 and dotnet/runtime#134498. The currently consumed VMR snapshot in ASP.NET Core
mainstill predates #134642, so the draft should remain blocked on the runtime dependency update and browser startup verification.Validation
Run after merging
origin/mainat8192456de8:npm run build -w src/SignalR/clients/ts/signalr -w src/SignalR/clients/ts/signalr-protocol-msgpack- passed.src/Components/Web.JS:npx eslint -c ./src/.eslintrc.js src/Platform/Mono/MonoPlatform.ts- passed.src/Components/Web.JS:npx rollup -c --environment development --forceExit- passed; four debug bundles built.src/Components/Web.JS:npx jest --runInBand- passed; 295 tests across 14 suites.git diff --check- passed before committing.No new tests were added. Browser/E2E startup and red/green regression verification were not run; the JavaScript checks do not establish runtime integration correctness.
Fixes: N/A - no originating ASP.NET Core issue identified; related runtime change linked above.
Note
This PR description was generated with the assistance of GitHub Copilot.