Skip to content

[blazor][wasm] Revert Convert more interop to JSImport (#65895)#66069

Merged
pavelsavara merged 1 commit intodotnet:mainfrom
pavelsavara:revert_65895
Mar 30, 2026
Merged

[blazor][wasm] Revert Convert more interop to JSImport (#65895)#66069
pavelsavara merged 1 commit intodotnet:mainfrom
pavelsavara:revert_65895

Conversation

@pavelsavara
Copy link
Copy Markdown
Member

This reverts #65895
commit 8bba19e.

@pavelsavara pavelsavara added this to the .NET 11 Planning milestone Mar 30, 2026
@pavelsavara pavelsavara self-assigned this Mar 30, 2026
@pavelsavara pavelsavara requested a review from a team as a code owner March 30, 2026 09:09
@pavelsavara pavelsavara added the area-blazor Includes: Blazor, Razor Components label Mar 30, 2026
Copilot AI review requested due to automatic review settings March 30, 2026 09:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(...) with NavigationOptions.
  • Remove the JS-side navigateToWithArgs entrypoint and the corresponding shared interop constant.
  • Rework WASM console logger/provider construction to flow a JS runtime instance (and stop using JSImport for console.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.

Comment thread src/Components/test/testassets/BasicTestApp/Program.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants