-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Migrate to stock .NET runtime #20
Comments
@elringus Here is PR with webpack sample dotnet/runtime#63335 , feedback welcome. |
@pavelsavara Hey, Thanks for the info! I've checked the sample webpack config, but it doesn't seem to use UMD library target. It's to make sure the library doesn't depend on any node modules or browser-specific APIs, which is required, for example, by VS Code web extensions. Making the dotnet runtime compatible with the UMD target was the main reason I had to use a custom build. Here is a sample webpack config with UMD target: https://github.com/Elringus/DotNetJS/blob/c6ff664f930cda374a394cce79f642e1e2f8f487/JavaScript/dotnet-runtime/webpack.config.js#L7 When building with that config I had to also fix all the dependency warnings reported by webpack (mostly getting rid of various |
I updated the sample to produce UMD, it works fine. No reg-exp fiddling was necessary because I re-define |
That's great news, thank you very much! While I wasn't able to test it due to a build error:
— if dotnet.js is now packing for UMD without any warnings, the issue is most likely solved. Will check it again when the changes are available in the distributed .NET SDKs (I guess it'll be .NET 7?) |
I think there was unrelated zlib hiccup yesterday and the offending PR was reverted since. You just merged in unfortunate moment ... |
Well, I've tried one more time by cloning directly from the PR (via And here is the script I've used for build (under the repo's root): mkdir -p emsdk
curl -L https://github.com/emscripten-core/emsdk/archive/2.0.23.tar.gz | tar xz -C emsdk --strip-components=1
emsdk/emsdk update
emsdk/emsdk install 2.0.23
emsdk/emsdk activate 2.0.23
source emsdk/emsdk_env.sh
./build.sh mono+libs -os Browser -c Release
read -r -p "Press Enter key to exit..." |
@lambdageek any hints on zlib ? |
Also sometimes deleting |
I've tried a clean build, debug config (previously I've been using release) and running with elevated command prompt, but the same error occurred in all cases. Looks like
|
get rid of this I'm not sure about the ICU error (although maybe it's related? does ICU depend on zlib?) |
As long as this does not work, you can use the following workaround to not copy the file from this repo but instead automatically from the nuget package:
|
It looks like .NET 7 is now compatible with node, but worker/constrained environment support is not clear yet: dotnet/runtime#80045 Though users report its working fine, I'd like to wait until the support is officially confirmed before starting with the migration. |
We are currently using a custom .NET runtime build and JS wrapper post-processing to support webpack UMD target. This limits the options when building the projects, such as AOT and module trimming.
There is an on-going work at the .NET runtime main branch to modularize the WASM runtime and make it work outside of browser, eg:
dotnet/runtime#61313
dotnet/runtime#62292
dotnet/runtime#47336
At some point, it may become possible to use the module distributed with the runtime SDK, which will resolve the limitations.
If someone happen to know an alternative solution to make current (.NET 6) WASM compatible with UMD target, please let us know here. Sharing updates regarding changes in the .NET runtime that could help with the issue is also appreciated.
Currently blocked by:
The text was updated successfully, but these errors were encountered: