Uh oh!
There was an error while loading. Please reload this page.
[WASM] Adding a new switch to run wasm on NodeJS - #54640
Conversation
ghost
commented
Jun 23, 2021
Tagging subscribers to this area: @CoffeeFlux Issue DetailsWORK IN PROGRESSThis PR adds the missing pieces for NodeJS support to MONO WASM! How does it workThe main differences between this and running the console sample regularly in v8 is that dotnet.js is modularized so we use These changes are triggered by specifying How to run locally
TODO LIST
|
It will be used in Daniel's dotnet/runtime#54640
For organizational purposes here is a list of the main test failures(I'll update as I progress):
|
Most of the CI issues right now are caused by the issue that the runfoapp bot reported (#55449) |
thaystg
commented
Jul 15, 2021
/azp run runtime |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Daniel-Genkin
commented
Jul 19, 2021
I just found where the NodeJS and NPM are set for the build machines. Turns out that the |
Daniel-Genkin
commented
Jul 19, 2021
@terrajobst I am an intern on @lewing 's team. So I am internal to MSFT :). |
terrajobst
commented
Jul 19, 2021
Sorry, you didn't show up as an FTE on GitHub. No worries :-) |
f84e585 to
06d2a29CompareThe current test failures are caused by having an old version of Node on Helix which don't support the newly added Update: As part of my testing for this I found that the minimum supported version of Node is the current LTS (v14) |
Daniel-Genkin
commented
Jul 31, 2021
The current idea is if we need to use node (i.e. Originally the idea (attempt 1) was to download from https://nodejs.org/dist/latest-v14.x/node-v14.17.4-linux-x64.tar.xz but the download system only supports zip files. So using emsdk should get around this while having the added benefit of also keeping the version of node synced with that of emdsk. Maybe after this works we can find a way to strip out node from the emsdk directory instead of sending the whole thing. |
3b49141 to
48f902cCompareghost
commented
Aug 2, 2021
/azp run runtime |
|
Commenter does not have sufficient privileges for PR 54640 in repo dotnet/runtime |
radical
commented
Aug 2, 2021
/azp run runtime |
|
Azure Pipelines successfully started running 1 pipeline(s). |
pavelsavara
commented
Aug 17, 2021
|
pavelsavara
commented
Aug 17, 2021
I'm thinking that the issues with old NodeJs and FinalizationRegtistry/WeakRef could be now OK, as we made them optional. |
945d2a5 to
14f7c05Compare14f7c05 to
8600ffcCompare
This PR adds the missing pieces for NodeJS support to MONO WASM!
How does it work
The main differences between this and running the console sample regularly in v8 is that dotnet.js is modularized so we use
requireto load it. We now also have apackage.jsonandpackage-lock.jsonfiles as well as thenode_modulesfolder. Besides that, most changes to the code were related to various NodeJS related nuances such as the scoping ofthisbut are ignored by the browser.These changes are triggered by specifying
/p:ForNode=truewhen building and publishing. If this switch is not specified then it is false.What has changed
/p:ForNode=trueswitch to toggle the extra steps needed for the NodeJS buildNodeJSengine, so now when running tests we can use the/p:JSEngine=NodeJSswitchHow to run locally
./build.cmd mono+libs -os Browser -c Debug /p:ForNode=true(-c Releasealso works)./dotnet.cmd publish /p:TargetArchitecture=wasm /p:TargetOS=Browser /p:ForNode=true .\src\mono\sample\wasm\console\Wasm.Console.Sample.csproj -c Debugcd src\mono\sample\wasm\console\bin\Debug\AppBundlenpm test,./run-node.sh(orrun-node.cmdif on windows) ornode runtime.js --run Wasm.Console.Sample.dllNote: If you want to run tests locally via XHarness, you will need to also include
/p:JSEngine=NodeJSin that command.TODO LIST
node --trace-warnings runtime.js --run Wasm.Console.Sample.dllpackage.jsonfile and runnpm installon itModularizeflag based on the new switchSample of how it can be used
https://github.com/Daniel-Genkin/runtime/tree/wasm-node-demo/src/mono/sample/wasm/console-node