[blazor][wasm] Revert Convert more interop to JSImport (#65895)#66069
Merged
pavelsavara merged 1 commit intodotnet:mainfrom Mar 30, 2026
Merged
[blazor][wasm] Revert Convert more interop to JSImport (#65895)#66069pavelsavara merged 1 commit intodotnet:mainfrom
pavelsavara merged 1 commit intodotnet:mainfrom
Conversation
This reverts commit 8bba19e.
Contributor
There was a problem hiding this comment.
Pull request overview
Reverts the Blazor WebAssembly changes from #65895 by moving Navigation/Refresh and console logging back away from JSImport-based interop and restoring the prior JS-call patterns.
Changes:
- Switch WebAssembly navigation and refresh interop back to
DefaultWebAssemblyJSRuntime.Instance.InvokeVoid(...)withNavigationOptions. - Remove the JS-side
navigateToWithArgsentrypoint and the corresponding shared interop constant. - Rework WASM console logger/provider construction to flow a JS runtime instance (and stop using
JSImportforconsole.log).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Components/test/testassets/BasicTestApp/Program.cs | Updates logger provider registration to pass IJSRuntime into the provider. |
| src/Components/test/testassets/BasicTestApp/PrependMessageLoggerProvider.cs | Updates provider/console logger construction to use IJSRuntime. |
| src/Components/WebAssembly/WebAssembly/src/Services/WebAssemblyNavigationManager.cs | Reverts navigation/refresh interop to InvokeVoid and adds trimming annotations for NavigationOptions. |
| src/Components/WebAssembly/WebAssembly/src/Services/WebAssemblyConsoleLoggerProvider.cs | Changes provider to be constructed with a WebAssemblyJSRuntime and pass it into loggers. |
| src/Components/WebAssembly/WebAssembly/src/Services/WebAssemblyConsoleLogger.cs | Injects/holds a JS runtime to call console.log via JS interop (removing ConsoleLog JSImport). |
| src/Components/WebAssembly/WebAssembly/src/Hosting/WebAssemblyHostBuilder.cs | Updates default logging provider construction to pass the default JS runtime instance. |
| src/Components/Web.JS/src/Services/NavigationManager.ts | Removes navigateToWithArgs export/implementation. |
| src/Components/Shared/src/BrowserNavigationManagerInterop.cs | Removes the NavigateToWithArgs constant. |
maraf
approved these changes
Mar 30, 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.
This reverts #65895
commit 8bba19e.