Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In mono_wasm_invoke_js_marshalled, pass through treatResultAsVoid param #39435

Merged
merged 1 commit into from
Aug 5, 2020

Conversation

SteveSandersonMS
Copy link
Member

When invoking JS functions, sometimes they return values that aren't JSON serializable. This would then result in a JSON serialization exception.

But this doesn't make sense in the case where the developer made the call using InvokeVoid or InvokeVoidAsync. In these cases, we know they don't want the response, so why would we even try serializing and sending it?

This PR adds a new parameter that Blazor can use to control whether the result value is to be JSON-serialized or just discarded. The real implementation of the rest of the functionality will happen in the aspnetcore repo.

@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@SteveSandersonMS
Copy link
Member Author

Not sure what area labels are most applicable. @lewing, could you help route this to the right person? Or maybe the right person is you :)

Copy link
Member

@kg kg left a comment

Choose a reason for hiding this comment

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

This looks fine to me as long as we're sure invokeJSFromDotNet never uses arguments.length.

@SteveSandersonMS
Copy link
Member Author

It doesn't (code here). The current implementation will ignore the extra param right now, and we'll update it to handle it usefully once this runtime change flows through.

@lewing lewing added this to the 5.0.0 milestone Aug 5, 2020
@lewing lewing merged commit 04e86c3 into master Aug 5, 2020
@lewing
Copy link
Member

lewing commented Aug 5, 2020

The windows failure is unrelated to the browser javascript changes.

Jacksondr5 pushed a commit to Jacksondr5/runtime that referenced this pull request Aug 10, 2020
@jkotas jkotas deleted the stevesa/blazor-js-interop-void-calls branch August 22, 2020 14:30
@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants