-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[draft][wasm] JSImport/JSExport prototype #64493
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
Conversation
|
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
|
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsThis steals many ideas from #60765 and also from conversation with @kg Design
Open questions
TODO
|
This comment was marked as resolved.
This comment was marked as resolved.
6530adb to
8999809
Compare
...vaScript/src/System/Runtime/InteropServices/JavaScript/Private/JavaScriptMarshalImpl.Bind.cs
Outdated
Show resolved
Hide resolved
...vaScript/src/System/Runtime/InteropServices/JavaScript/Private/JavaScriptMarshalImpl.ToCs.cs
Outdated
Show resolved
Hide resolved
...vaScript/src/System/Runtime/InteropServices/JavaScript/Private/JavaScriptMarshalImpl.ToJs.cs
Outdated
Show resolved
Hide resolved
...es.JavaScript/src/System/Runtime/InteropServices/JavaScript/Private/JavaScriptMarshalImpl.cs
Outdated
Show resolved
Hide resolved
...es.JavaScript/src/System/Runtime/InteropServices/JavaScript/Private/JavaScriptMarshalImpl.cs
Outdated
Show resolved
Hide resolved
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
...vaScript/src/System/Runtime/InteropServices/JavaScript/Private/JavaScriptMarshalImpl.ToJs.cs
Outdated
Show resolved
Hide resolved
...ces.JavaScript/tests/System/Runtime/InteropServices/JavaScript/GeneratedInvokeJsTest.part.cs
Outdated
Show resolved
Hide resolved
a57b4e8 to
2c9d0aa
Compare
...ntime.InteropServices.JavaScript/gen/MarshalerGenerator/JavaScript.MarshalerGenerator.csproj
Outdated
Show resolved
Hide resolved
...ntime.InteropServices.JavaScript/gen/MarshalerGenerator/JavaScript.MarshalerGenerator.csproj
Outdated
Show resolved
Hide resolved
...time.InteropServices.JavaScript/src/System.Private.Runtime.InteropServices.JavaScript.csproj
Outdated
Show resolved
Hide resolved
...eropServices.JavaScript/tests/System.Private.Runtime.InteropServices.JavaScript.Tests.csproj
Outdated
Show resolved
Hide resolved
...ate.Runtime.InteropServices.JavaScript/System.Private.Runtime.InteropServices.JavaScript.sln
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.Runtime.InteropServices.JavaScript/gen/Directory.Build.props
Outdated
Show resolved
Hide resolved
...eropServices.JavaScript/tests/System.Private.Runtime.InteropServices.JavaScript.Tests.csproj
Outdated
Show resolved
Hide resolved
...ript/src/System/Runtime/InteropServices/JavaScript/Private/JavaScriptMarshalImpl.JsInvoke.cs
Outdated
Show resolved
Hide resolved
...eropServices.JavaScript/tests/System.Private.Runtime.InteropServices.JavaScript.Tests.csproj
Outdated
Show resolved
Hide resolved
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.
I'd put .Private to the end so you can use same prefix for namespace aswell
...ntime.InteropServices.JavaScript/gen/MarshalerGenerator/JavaScript.MarshalerGenerator.csproj
Outdated
Show resolved
Hide resolved
...ystem.Private.Runtime.InteropServices.JavaScript/gen/MarshalerGenerator/JsImportGenerator.cs
Outdated
Show resolved
Hide resolved
...ystem.Private.Runtime.InteropServices.JavaScript/gen/MarshalerGenerator/JsImportGenerator.cs
Outdated
Show resolved
Hide resolved
...Script/src/System/Runtime/InteropServices/JavaScript/Private/JavaScriptMarshalImpl.CsBind.cs
Outdated
Show resolved
Hide resolved
...Script/src/System/Runtime/InteropServices/JavaScript/Private/JavaScriptMarshalImpl.JsBind.cs
Outdated
Show resolved
Hide resolved
...ipt/src/System/Runtime/InteropServices/JavaScript/Private/JavaScriptMarshalImpl.Signature.cs
Outdated
Show resolved
Hide resolved
...ipt/src/System/Runtime/InteropServices/JavaScript/Private/JavaScriptMarshalImpl.Signature.cs
Outdated
Show resolved
Hide resolved
...ipt/src/System/Runtime/InteropServices/JavaScript/Private/JavaScriptMarshalImpl.Signature.cs
Outdated
Show resolved
Hide resolved
...teropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Private/Marshalers.cs
Outdated
Show resolved
Hide resolved
4f6886c to
aacf17f
Compare
…_invoke_js3 # Conflicts: # src/libraries/System.Private.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Runtime.cs # src/mono/wasm/runtime/corebindings.ts # src/mono/wasm/runtime/cwraps.ts # src/mono/wasm/runtime/exports.ts # src/mono/wasm/runtime/method-binding.ts # src/mono/wasm/runtime/startup.ts # src/mono/wasm/runtime/types.ts
|
This pull request has been automatically marked |
|
This pull request will now be closed since it had been marked |
Design
This steals many ideas from #60765 and also from conversations with @kg
stackallocMonoObject*to user javaScriptMonoString*is still used for strings and exception Messagetypeof(T).TypeHandleas method signature[TRes,T1,T2,T3, ...][res,t1,t2,t3, ...]Out of scope
TODO
JavaScript.MarshalerGeneratorJSImportJSExportJSImportJSExportVector3MarshalUsingattributeIJSObject, set property, get propertyJSExport/JSImportattributesSystem.Runtime.InteropServices.JavaScript- dropPrivaterefassemblySystem\Runtime\InteropServices\JavaScript\Public\**Int32, Int64, Double<=>NumberSystem.String<=>stringSystem.Object,JSObject<=>ManagerObject,objectSystem.Exception,JSException<=>Error,ManagedErrorDateTime<=>DateDateTimeOffset<=>DateTask,ValueTask<=>PromiseIntPtr<=>VoidPtrvoid*,byte*<=> ??? by ref or by value ?Span<byte><=> ???byte[]<=> ???URI<=>stringas custom marshaller onlyDelegate<=>functiondo we really need it ? It opens us to dispatch to dynamic C# signatures on runtime.System.Private.Runtime.InteropServices.JavaScriptimplementationTypedArray,MapandHostObjectInFlightcwrap+ccall+mono_runtime_invokeinBindCSFunctionByNamewith something fasterassert, viaterserpipelinemono_wasm_new_root_bufferwith pool+stack based allocatorBINDING.bind_static_method->JSExport.JSExport, otherwise we are open to dynamic C# signatures on runtime.BrowserWebSocketimplementationwrapped_cs_functionsJSImportJSExportccallsWasm.BrowserProfile.Sample