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
Add WebSite project type to MAUI Hybrid project type (Blazor Hybrid + Web) #1069
Comments
Same question for me. |
If MAUI allows on preview 5 the ability to create Web Assembly either using blazor or any other will be awesome. It will be just perfect and super multiplatform, due to it can be used for platforms like LG WebOS, web systems, etc. |
I believe that having a single project, write code and compile for mobile, desktop, and web... is really needed. Not including the web would be not good. If you look at Flutter they already support all of these platforms. Thanks. |
I vote for this as well. |
Being able to wrote both server and client side coce in ONE language for all major platforms (including Web), would be awesome. Im not aware of any viable way of doing it now. Flutter does this in theory, But Darts inherent bad design as language regarding performance makes it a no go on the server side and hence there is not any strong server side eco system developing. |
I would love if, at the very least, there were RCL and Blazor web (either WASM or server-side) projects included along with the MAUI project in a Blazor Maui template. |
I recently worked on this which might be useful, multiple frontends where the common blazor stuff is located under DefaultBlazor.Desktop.Common Although bearing in mind the way Blazorwebview works is similar to server side Blazor instead of wasm MudBlazor/Templates#17 |
This is certainly something we will consider. We're anticipating that many developers choosing .NET MAUI Blazor will re-use Blazor components in a web app as well, so setting things up in this manner could be convenient. Of course, some people might already have RCLs that they built and want to use, so if this template also has an RCL, it might be annoying. We'll have to figure something out here! |
For info you can pretty much write everything for the app in a Razor Control Library with Blazor components. The only thing I couldn't put into the RCL which tends to be more front end specific is the root index page where the blazor page is hosted. |
This comment was marked as off-topic.
This comment was marked as off-topic.
I need a United solution, please make Blazor be a part of MAUI. |
To be clear MAUI isn't web, it's basically a renamed / newer version of Xamarin.Forms Blazor on the other hand is Web, it's main difference compared to other frameworks is that .Net code can be compiled into web assembly then run inside the web browser. Blazor can be hosted "inside" MAUI / WebForms / WPF Apps using a special control called webview2 which is a stripped down version of MS Edge without all the browser bloat. It's something included by default under Windows 11 I think. |
Hi folks! Please note that we're now using this issue to track creating a single project experience for Blazor Hybrid + Web. For folks interested in .NET MAUI supporting web as a target platform with XAML please refer to #4528. |
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process. |
PR for this is here: #21867 There are still a few things to figure out, but for now we plan to ship a new template called .NET MAUI Blazor Hybrid and Web App that has:
Some notes:
|
@Eilon Wait, so it wont contain "Web" Platform in .NET MAUI project ? Because what you currently described is basically structure we use in our project. Whole logic in blazor library project and then 2 projects: Maui and Blazor Wasm that consume that project containing whole business logic. Even though I see the benefit to have this structure as a template it still feels more like a workaround. |
When will this PR be approved? |
@Kebechet said:
Yes, that's correct. In this template you get three projects: .NET MAUI Blazor Hybrid project, Blazor Web project, and a shared Razor Class Library with the shared Razor components, static assets, and other items. There is optionally a 4th project to contain the Blazor WebAssembly content (if needed). We tried approaches where there's a single project that contains everything, but it simply doesn't work well (or at all) in too many cases. It's still something we're interested in, but the complexity of it meant that it's not something we could fit in. If you're already following this approach, that's actually really good to hear. If you have thoughts on the challenges you've hit or successes you've had with that pattern we'd love to hear it so that we can make this as great as possible. |
@alizer-in said:
There are a few more things I need to add to this PR, but it should be merged soon! |
In that case is somewhere ticket regarding this flow so I can follow it ? And can you please give a few examples of those problems you experienced ?
These are the main disadvantages we faces with this approach. |
Some of the problems of a single project for web + MAUI:
I'm sure these are all solvable with enough time and effort, but we felt that at this time there is far too much uncertainty with that approach to try to make it a product feature. |
New combined Blazor Hybrid + Web app solution template with shared UI in a Razor Class Library Fixes #1069
The PR is now merged! #22234 So expect this to be available in an upcoming .NET 9 preview (and also will be available in upcoming Visual Studio previews). |
I write my code in blazor and razor in MAUI Hybrid.
It lets me to build my app for desktop and mobile, why not web?
The text was updated successfully, but these errors were encountered: