dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.27k stars 4.73k forks source link

[browser][doc] how to start dotnet on WebWorker + demo #95452

Open pavelsavara opened 11 months ago

pavelsavara commented 11 months ago

For use-cases which don't need C# to interact with the UI, but they just need to calculate some logic in dotnet.

It already worked in Net7 with some fiddling, there is known use in the community since.

It works well in Net8. We should create demo how to start the single-threaded dotnet on separate WebWorker and how to postMessage json messages to it.

For now it's wasmbrowser template and people have to figure out the WebWorker part themself.

dotnet workload install wasm-tools
dotnet workload install wasm-experimental
dotnet new wasmbrowser
ghost commented 11 months ago

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

Issue Details
For use-cases which don't need C# to interact with the UI, but they just need to calculate some logic in dotnet. It already worked in Net7 with some fiddling, there is known use in the community since. It works well in Net8. We should create demo how to start the single-threaded dotnet on separate WebWorker and how to pass json messages to it.
Author: pavelsavara
Assignees: pavelsavara
Labels: `arch-wasm`, `area-System.Runtime.InteropServices.JavaScript`, `os-browser`
Milestone: 9.0.0
pavelsavara commented 10 months ago

https://github.com/Tewr/BlazorWorker

hiyelbaz commented 10 months ago

https://github.com/Tewr/BlazorWorker

Lack of dotnet 8.0 support...

pavelsavara commented 10 months ago

https://github.com/Tewr/BlazorWorker

Lack of dotnet 8.0 support...

Not anymore https://github.com/Tewr/BlazorWorker/releases/tag/v4.0.0-preview2

danroth27 commented 5 months ago

@pavelsavara @lewing Where should the docs for this go? We put the JSImport/JSExport content in the Blazor docs. Do we want this content to be part of the Blazor docs as well? Are we getting to the point where we really should have a dedicated doc section on .NET runtime capabilities for WebAssembly?

maraf commented 5 months ago

Are we getting to the point where we really should have a dedicated doc section on .NET runtime capabilities for WebAssembly?

From my point of view a lot of things apply to both. In a lot of cases Blazor is really an UI library / application framework on top of runtime capabilities. Projecting such relation into docs seems good to me