-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[wasm] encapsulate emscripten js runtime #60504
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
|
Tagging subscribers to 'arch-wasm': @lewing Issue Details
|
|
Changing everything from |
|
This all is in preparation for ES6 modularization and no variable in global namespace. Intermediate step. Both are good thing (tm). One of possible motivations is to be able to instantiate dotnet multiple times per web page as independent components. Perhaps WebComponents. We could have CommonJS module and thin ES6 wrapper. Or we could switch completely. If/When we switch to ES6 module it would be breaking change for sure. But I'm not that far with prototyping yet. There are following challenges:
So maybe we will have |
|
Your example of the final state looks good, but this interim state feels unacceptable. It churns all this code and we'll just have to change it all again later. Is there some way we can stage this without making everything gross in the interim? |
|
Yes, it could be in the branch the whole time :-D |
|
If that's unavoidable, so be it. Is there some way we could auto-export these symbols from Module into the global scope as a default, so that old code doesn't break? Then we smoothly transition stuff to the clean new approach one at a time? |
Squashed commit: [7790da7c125] - unwraped mono_wasm_invoke_js from C into ts - replaced eval with Function constructor and closure [df70b86f69c] wip [e5b9ddceeaa] remove obsolete blazor [2d742949f3a] wip [abed5e9db3e] - encapsulate emscripten js runtime into IFFE, so that it doesn't leak into global namespace - keep Module object in the global namespace - keep MONO,BINDING,cwrap,addRunDependency,removeRunDependency in the global namespace with deprecation warning - improve test loading script
5bb3111 to
07a3d26
Compare
Moduleobject in the global namespaceMONO,BINDING,cwrap,addRunDependency,removeRunDependencyin the global namespace with deprecation warning