-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[wasm] rationalize internal exports #60075
Conversation
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. |
Tagging subscribers to 'arch-wasm': @lewing Issue Detailsnull
|
Cleaning up the 'Module' goo is good, but i feel like INTERNAL is probably the wrong name especially if we end up touching it from tests, etc. |
I don't insist on INTERNAL. Do you have other candidates on mind @kg ? |
18362df
to
368b27d
Compare
…e only use internally or for testing - reduce BINDING and MONO exports to minimal scope necessary - as used by Blazor - fix all internal usages in tests - produce dotnet.d.ts and include it in the workload - moved Module.config to MONO.config - added mono_load_runtime_and_bcl_args into MONO export - removed obsolete debugger test InvalidScopeId - introduced INTERNAL.mono_wasm_set_main_args
368b27d
to
812cb2e
Compare
@jeromelaban could you please let me know if this change would break any of Uno's use cases. runtime/src/mono/wasm/runtime/exports.ts Line 212 in 812cb2e
|
cc @SteveSandersonMS @mkArtakMSFT, this PR should have no impact to Blazor, but perhaps you could share your comments. |
Thanks @pavelsavara. Uno can cope with the change, but many extensions or projects (not just uno-based) are using this particular one: https://github.com/search?q=mono_bind_static_method&type=Code |
I personally think bind_static_method should be public |
Thanks for the hint. Using it via |
Blazor uses Module._malloc, but we could expose our own blessed version of it via MONO. instead. I think people would have to be using FS right now to do various things, maybe we should expose an API for that as well (though they can load things ahead of time via mono-config) |
It happens yes (both memory manipulation and FS). SkiaSharp does memory manipulation for instance, Uno as well. Modularizing would be very nice indeed. Is this for net6 or net7 ? |
net7 |
I will keep |
We could make all the Module accessors produce a warning or error in console on first (all?) uses so people fix them |
I added Obviously all 29 of the extern C methods which emcc linker needs to see are there as |
…roots to the MONO interface
BINDING
andMONO
exports to minimal scope necessary - as used by BlazorglobalThis.INTERNAL
and move all exported methods which we only use internally or for testingdotnet.d.ts
and include it in the workloadModule.config
toMONO.config
mono_load_runtime_and_bcl_args
intoMONO
exportmono_wasm_new_root_buffer
,mono_wasm_new_root
,mono_wasm_release_roots
to theMONO
exportInvalidScopeId
INTERNAL.mono_wasm_set_main_args