WASM - How to Correctly Use Low-Level Javascript Interop APIs #59769
-
First off, I've not been able to find any real documentation on the low-level Javascript APIs (such as these https://github.com/dotnet/runtime/blob/360df71eadde0d1394ee7b89693f83913f75575d/src/mono/wasm/runtime/binding_support.js) so apologies if I missed something. If there is documentation somewhere I'd hugely appreciate pointing me in the right direction. Barring that, I have a few questions about low-level interop and specifically the idea of passing Mono object references to and from JS. Suppose I do something like this: C#:
TS:
Later (TS):
Finally (C#):
So - the above all works - impressively! But I'm nervous it's too good to be true and will come back to bite me. Thus, my questions:
Many thanks for any assistance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Is there really no one able or willing to answer some of these questions? Would the folks in AspNetCore / Blazor be more knowledgeable here? |
Beta Was this translation helpful? Give feedback.
-
I guess you are asking from Net6.0 perspective. Note that the API for dotnet JavaScript are currently changing for Net7.0 and they are not "Shipped API" (long term commitment) at this time. I'm preparing samples of the usage of new API here #62292 |
Beta Was this translation helpful? Give feedback.
I guess you are asking from Net6.0 perspective.
Some of the code you are referring to is part of Blazor codebase and internal.
Note that the API for dotnet JavaScript are currently changing for Net7.0 and they are not "Shipped API" (long term commitment) at this time. I'm preparing samples of the usage of new API here #62292