dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.55k stars 10.05k forks source link

Embed WebAssembly components inside Blazor Hybrid #48568

Open qrzychu opened 1 year ago

qrzychu commented 1 year ago

Is there an existing issue for this?

Is your feature request related to a problem? Please describe the problem.

Some Blazor components work only with WebAssembly Blazor, for example SkiaSharp: https://www.nuget.org/packages/SkiaSharp.Views.Blazor

It would be great to be able to wrap them in a simple component, mark it as RenderMode=WebAssembly, and then expose a property that would be debounced/throttled in WA, so that we can pass some values both ways

Blazor Hybrid is very similar to Blazor Server, just instead of web sockets, there communication happens by passing around base64 data. Performance for that wasn't the focus so far (for example https://github.com/dotnet/maui/issues/12767 is still opened and in backlog).

That means that I cannot write the whole app in Blazor in an easy way - I can hack some custom html component and put that in wwwroot directory (I think). That adds way too much complexity.

Alternative is to high perf parts in the hosting tech, like MAUI, but that makes matching styles super hard, and it requires some hacks to display native control on top of webview.

Describe the solution you'd like

I would like to be able to use RenderMode.WebAssembly in Blazor Hybrid app, with all the out-of-box goodies, like parameter binding

Additional context

Part of my WPF app is doing image editing, similar to Ms Paint - with SkiaSharp.Blazor I expected to be able to just replace the bitmap drawing part with Skia and be good to go, but doing that in the native process means that the image has to be transported as base64 to the WebView - with image being bigger than 300x300px this becomes super slow.

I can do it in JS and just refernce it in Blazor, but being able to do it in Blazor directly would obviosly be so much better. And it is possible today, but only in WebAssembly mode

ghost commented 1 year ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

ghost commented 11 months ago

Thanks for contacting us.

We're moving this issue to the .NET 9 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s). If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

ghost commented 10 months ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.