-
Notifications
You must be signed in to change notification settings - Fork 10.5k
JSObjectReference #25028
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
JSObjectReference #25028
Conversation
javiercn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a great start!
javiercn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fantastic so far!
I don't have a lot of meaningful feedback because everything seems to be very well thought/written!
I would like to see a few more unit tests and so on, but other than that, it looks great!
We might also want the equivalent of DotnetObjectRef.Create on the JS side so that JS objects can be turned into JSObjectReferences for use when invoking .NET.
src/JSInterop/Microsoft.JSInterop/src/JSInProcessObjectReference.cs
Outdated
Show resolved
Hide resolved
src/JSInterop/Microsoft.JSInterop.JS/src/src/Microsoft.JSInterop.ts
Outdated
Show resolved
Hide resolved
|
This looks pretty super to me. I haven't pored over every line of it yet, or tried to think of any ways it could be misused, but it's looking very strong so far.
It sounds fine to me that we could add unmarshalled JSObject support in RC2. It's the sort of change that would have a really clear boundary and be quite easy to test. And there would be limited concerns around security since by definition it can only exist on the WebAssembly runtime. |
…to t-mabuc/js-object-reference
src/JSInterop/Microsoft.JSInterop.JS/src/src/Microsoft.JSInterop.ts
Outdated
Show resolved
Hide resolved
src/JSInterop/Microsoft.JSInterop.JS/src/src/Microsoft.JSInterop.ts
Outdated
Show resolved
Hide resolved
captainsafia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this. Learned a lot while reading through your PR. Left a few questions inline.
src/JSInterop/Microsoft.JSInterop.JS/src/src/Microsoft.JSInterop.ts
Outdated
Show resolved
Hide resolved
|
Will |
|
@mrlife It works on both. |
|
Congrats for this PR, I did this here but in way less efficient way I think. Can't wait to remove all my code! |
Summary
mono_wasm_invoke_js_blazorfunction.JSObjectReference), along with the ability to specify which object instance is handling the invocation.JSObjectReference, which supports invoking functions from JS objects.JSObjectReferenceinstance as a parameter to a JS interop call.JSInProcessObjectReference.DotNet.createJSObjectReferenceto allow passing JS objects to .NET. andDotNet.disposeJSObjectReferenceto allow disposal from JS when it's most convenient.TODO
Add support for unmarshalled JS interop calls viaJSUnmarshalledObjectReference(dependent on InputFile Component #24640).Addresses #24648