[blazor][wasm] Revert JSExport for events (#65897)#66068
Merged
pavelsavara merged 2 commits intodotnet:mainfrom Mar 30, 2026
Merged
[blazor][wasm] Revert JSExport for events (#65897)#66068pavelsavara merged 2 commits intodotnet:mainfrom
pavelsavara merged 2 commits intodotnet:mainfrom
Conversation
This reverts commit 41822ee. Keep new tests
Contributor
There was a problem hiding this comment.
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
DispatchEventAsyncinvokeMethodAsync-based pipeline. - Moves JSExport interop entry points (InvokeDotNet/BeginInvokeDotNet/EndInvokeJS/etc.) into
DefaultWebAssemblyJSRuntime.csand updates root component update plumbing to callUpdateRootComponentsCore. - Routes navigation callbacks through
[JSInvokable]methods onJSInteropMethodsinstead 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. |
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 #65897
commit 41822ee.
Keep new tests