Skip to content
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

Integrating .NET 8 WebAssembly project into the Angular app #88545

Closed
socreative opened this issue Jul 8, 2023 · 5 comments
Closed

Integrating .NET 8 WebAssembly project into the Angular app #88545

socreative opened this issue Jul 8, 2023 · 5 comments
Labels
arch-wasm WebAssembly architecture area-VM-meta-mono

Comments

@socreative
Copy link

Is there a nice way to incorporate the dotnet JS runtime into an existing angular project?

I manage to do that with .NET 7 files but it was tricky still. When imported dotnet.js assumes it's run in a node environment so it tried loading fetching all files from the config .JSON using file system paths. I ended up messing about with the source code to rewrite the filesystem paths to URLs and it worked, but that seems like a dirty hack.

With .NET 8 there are more that just dotnet.js files - I can see it's trying to dynamically import dotnet.runtime.js and dotnet.native.js - that is where Webpack is having issues with importing these.

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jul 8, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jul 8, 2023
@jeffschwMSFT jeffschwMSFT added area-VM-meta-mono arch-wasm WebAssembly architecture labels Jul 10, 2023
@ghost
Copy link

ghost commented Jul 10, 2023

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Is there a nice way to incorporate the dotnet JS runtime into an existing angular project?

I manage to do that with .NET 7 files but it was tricky still. When imported dotnet.js assumes it's run in a node environment so it tried loading fetching all files from the config .JSON using file system paths. I ended up messing about with the source code to rewrite the filesystem paths to URLs and it worked, but that seems like a dirty hack.

With .NET 8 there are more that just dotnet.js files - I can see it's trying to dynamically import dotnet.runtime.js and dotnet.native.js - that is where Webpack is having issues with importing these.

Author: socreative
Assignees: -
Labels:

arch-wasm, untriaged, area-VM-meta-mono, needs-area-label

Milestone: -

@radical
Copy link
Member

radical commented Jul 10, 2023

cc @pavelsavara @maraf

@pavelsavara
Copy link
Member

hi @socreative, we are aware of it, we collect use cases here #86162

I will close this issue as duplicate.

@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jul 10, 2023
@pavelsavara
Copy link
Member

I fixed webpack sample we have #88907
It will pack only dotnet.js and load rest of it as separate files in parallel, which is likely faster than large bundle.

True single file solution would take more effort in linked issue.

@socreative
Copy link
Author

socreative commented Jul 18, 2023

Thanks. An npm package to replace dotnet.js would be an ideal scenario so it could be intergrated with front-end or node apps so.

@ghost ghost locked as resolved and limited conversation to collaborators Aug 17, 2023
@am11 am11 removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jul 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-VM-meta-mono
Projects
None yet
Development

No branches or pull requests

5 participants