Skip to content

[blazor][wasm] Revert JSExport for events (#65897)#66068

Merged
pavelsavara merged 2 commits intodotnet:mainfrom
pavelsavara:revert_65897
Mar 30, 2026
Merged

[blazor][wasm] Revert JSExport for events (#65897)#66068
pavelsavara merged 2 commits intodotnet:mainfrom
pavelsavara:revert_65897

Conversation

@pavelsavara
Copy link
Copy Markdown
Member

This reverts #65897
commit 41822ee.

Keep new tests

@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:02
Copilot AI review requested due to automatic review settings March 30, 2026 09:02
@pavelsavara pavelsavara added the area-blazor Includes: Blazor, Razor Components label Mar 30, 2026
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 JSExport-based event dispatch fast paths introduced in #65897 while keeping related infrastructure changes (e.g., JSExport interop entry points and updated navigation interop).

Changes:

  • Removes the JS-side direct (JSExport) event dispatch path and restores the DispatchEventAsync invokeMethodAsync-based pipeline.
  • Moves JSExport interop entry points (InvokeDotNet/BeginInvokeDotNet/EndInvokeJS/etc.) into DefaultWebAssemblyJSRuntime.cs and updates root component update plumbing to call UpdateRootComponentsCore.
  • Routes navigation callbacks through [JSInvokable] methods on JSInteropMethods instead of JSExport event methods.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Components/WebAssembly/WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.cs Removes event-dispatch JSExport dependencies and adds/moves JSExport entry points + UpdateRootComponentsCore.
src/Components/WebAssembly/WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.Interop.cs Deleted (interop members moved into main runtime file).
src/Components/WebAssembly/WebAssembly/src/Services/DefaultWebAssemblyJSRuntime.EventDispatch.cs Deleted (removes JSExport event dispatch implementation + helper methods).
src/Components/WebAssembly/WebAssembly/src/Rendering/WebAssemblyRenderer.cs Removes renderer hookup for event dispatch; keeps root component update subscription.
src/Components/WebAssembly/WebAssembly/src/PublicAPI.Unshipped.txt Adjusts API tracking entries related to JSInteropMethods.
src/Components/WebAssembly/WebAssembly/src/Infrastructure/JSInteropMethods.cs Adds [JSInvokable] navigation notification methods for framework JS->.NET calls.
src/Components/WebAssembly/WebAssembly/src/Hosting/WebAssemblyHostBuilder.cs Adds trimming preservation for JS-invoked navigation methods.
src/Components/WebAssembly/WebAssembly/src/Hosting/WebAssemblyHost.cs Keeps JSInteropMethods type alive to reduce trimming risk.
src/Components/Web.JS/src/Rendering/WebRendererInteropMethods.ts Removes JSExport event dispatch fast path; always uses DispatchEventAsync.
src/Components/Web.JS/src/GlobalExports.ts Removes event-dispatch JSExport typings; keeps only the remaining JSExport surface.
src/Components/Web.JS/src/Boot.WebAssembly.Common.ts Switches navigation events to dispatcher.invokeDotNetStaticMethodAsync and uses UpdateRootComponentsCore.

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