Uh oh!
There was an error while loading. Please reload this page.
[WASM] Converted mono-config.js to mono-config.json - #53606
Conversation
ghost
commented
Jun 2, 2021
Tagging subscribers to this area: @CoffeeFlux Issue DetailsWORK IN PROGRESSThis PR renames the mono-config.js file to mono-config.json, updates the contents accordingly and moves it's loading from the DOM to JS. Why is this needed? What's changed
How it works config: null,onConfigLoaded: function(config){if(!config||config.error){console.log("An error occured while loading the config file");return;}Module.config=config;},Also, note that I am very new to this project (I am an intern) so please let me know if there is anything else that should be improved including coding style, better techniques for loading the files and/or anything else.
|
ghost
commented
Jun 2, 2021
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsThis PR renames the mono-config.js file to mono-config.json, updates the contents accordingly and moves it's loading from the DOM to JS. Why is this needed? What's changed
How it works config: null,onConfigLoaded: function(config){if(!config||config.error){console.log("An error occured while loading the config file");return;}Module.config=config;},Also, note that I am very new to this project (I am an intern) so please let me know if there is anything else that should be improved including coding style, better techniques for loading the files and/or anything else.
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Daniel-Genkin
commented
Jun 14, 2021
As an update, turns out that that |
kg
commented
Jun 14, 2021
Make sure it isn't used by blazor |
Daniel-Genkin
commented
Jun 14, 2021
@kg that shouldn't be an issue because this is a file that I added in a previous commit for this PR :) |
kg
commented
Jun 14, 2021
Ah, confused it with dotnet_support :) |
lewing
left a comment
There was a problem hiding this comment.
A few small nits but looking good!
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This PR renames the mono-config.js file to mono-config.json, updates the contents accordingly and moves it's loading from the DOM to JS.
Why is this needed?
This change is step 0 before adding NodeJS support to the wasm runtime. As NodeJS doesn't have a DOM, we need to load the config file from JS. Moreover, by moving the variable declaration out of the file, we can reduce ambiguity as to what the
configvariable is. This will also have the added benefit of being able to rename the variable if needed.What's changed
MONO.mono_wasm_load_config(configFilePath)which loads the config file via promises.How it works
The user adds the snippet listed below to their
Moduleobject. Then emsdk will call it after loading the runtime but before the runtime is started. Then, when the user wants to start the runtime, they can pass theModule.configobject to theMONO.mono_load_runtime_and_bcl_argsfunction. This approach also allows the user to make runtime modifications to the config prior to passing it to the runtime by editing theModule.configobject.Also, note that I am new to this project (I am an intern) so please let me know if there is anything else that should be improved including coding style, better techniques for loading the files and/or anything else.