As a developer and software business owner, I want to reduce development costs by having to develop and maintain _one_ source of code and be able to deploy it to any hosted environment.
Currently, Blazor achieves a great deal of this by allowing deployment as a website.
However, there are three other significant environments to consider:
This idea is based on a conversation started over four years ago. The idea started to seem possible when Ooui was circa late 2017. From there, I myself was able to run a test with Ooui on a local development Windows store test application, and it appeared to work. However, I never did get to deploy to the Windows Store for definitive confirmation as I do not have a developer license and preferred someone who had a license to try it out to how it fared. Unfortunately, this never happened.
But now that we have all of MSFT behind this innovative approach in Blazor, π I am sure we can find the resources to adequately attempt and confirm if this is possible -- and if not, perhaps make adjustments accordingly so that it is possible in a future version.
To be certain, the requested solution is:
WebView
or equivalent control, defined as the primary (or only) control within the application so that it displays web pages.WebView
control, make requests to the web server established in the first step.As mentioned, web deployments are very effective as all store-enabled devices listed above have a modern browser installed that support them. Additionally, with the advent of Progressive Web Applications, the case can be made that store-hosted scenarios are a dying concept or at least becoming passΓ©.
However, having the ability for native store hosting only strengthens the Blazor brand and allows for confident recommendations knowing that all major hosted environments are covered. I for one would like knowing that I can achieve store-hosted scenarios for recommendations with my own clients, as well as having it in my back pocket if the requirement should arise.
Finally, having this capability would provide a potential resolution to one of the most requested ideas in .NET's history.
I believe I have covered all aspects with links in the above description. Thank you for any consideration around this goal!
I support the idea.
Don't forget to give us a DESIGNER as this accelerates development event more ! Lately I had to design a form in which it took me a very long time of F5, looking, adjust the text base UI development aka html/js and go back and forth like this a very fair amount of time. This is completely unacceptable these days.
I see no reason to not having a designer capable of knowing the model and simulating it.
Ask and you shall receive, @GearTheWorld. π
https://www.radzen.com/blog/introducing-the-blazor-wysiwyg-design-time/
I think there are a few things we can consider doing here:
Note that the Blazor code does not need to run on WebAssembly - it could run directly on the device like Xamarin apps do today.
- Blazor Native - Run Blazor on a device using an appropriate .NET runtime (.NET Core on Win/macOS/Linux, Mono on mobile, .NET 5 in the future) and integrate with the native components of the platform. This is similar to how React Native works today.
@GearTheWorld I built a edit-and-continue like environment using dotnet watch and some VS Detach/Attach stuff, so I can just edit my .razor files, save and wait 2-3 seconds to get the browser refreshed.
@AdmiralSnyder @GearTheWorld Hopefully with the new Preview 6 release and the latest VS Preview update you should now also get that edit-save-refresh experience in VS without any additional work. We also have adding support for live reload on our backlog (#5456).
Blazor PWA gets my vote. I'm interested in client side Blazer so anything that decreases the startup time and initial payload is welcome.
Thanks @MatthewS2077! Supporting PWAs with Blazor is something we've had on our backlog to do for a while. First step is to ship the WebAssembly support of course :smile:. Also, to be clear, the options above are not mutually exclusive. We could do none, some, or all of them.
Thank you for being so engaging and providing so much dynamic input @danroth27. I'm feeling the love here. π
I think PWAs are a natural first step as that is closely aligned with the capability/intent of HTML5 as well as hosted stores. As an aside, I'm also shocked that hosted stores allow PWAs as it would seem that PWAs are basically meant to circumvent the stores altogether. π€·ββοΈ
The hybrid approach that you mention seems valuable as well. I especially <3 your comment in regards to it running directly in Xamarin. I have been wondering if that is the case, or if there was some integration involved, so good to know this.
Native seems great, too. ALL OF THE ABOVE. π Hopefully, we can get the resources to flesh this all out in earnest and make it a legitimate competitive offering in a future version. π
@danroth27 , you can target Cordova with Blazor today with some hacks. The pain would be in debugging tooling.
@danroth27 The cool thing is that theoretically these projects (Blazor Hybrid/Blazor Native) could be started immediatelly since they probably would be based on Xamarin which is stable and mature. I really think you guys should push the higher-ups to invest in these projects to start working on them asap. This is a unique opportunity for the .net ecosystem.
I'd like to add my weight (such as it is!) to this thread. I hope later this year to hire a team to develop a SaaS product based on Blazor. My dream would be for the web app to be based on AOT compiled client side Blazor (interpreted is way too slow for my computational work load), and to wrap this up as a PWA to provide offline fallback when the internet connection goes down. It feels like this is all on your radar and somehow in progress, however the sooner the better!
Many thanks for the ongoing great work with Blazor
Really excited about most of these ideas, although unfortunately they seem to be 2-3 years away at least
Relevant: https://youtu.be/6BT2AF9PO5g?t=3362
Would be nice to see a web equivalent to this. For instance, upon compiling for a web site/context, StackLayout
would get converted to a <div />
with necessary CSS to make it operate just the same as it does in the mobile/native context, only in a web page, instead. :)
/cc @SteveSandersonMS / @danroth27
For instance, upon compiling for a web site/context, StackLayout would get converted to a
with necessary CSS to make it operate just the same as it does in the mobile/native context, only in a web page, instead
BTW, this is exactly what Uno does with their magic:
https://medius.studios.ms/Embed/Video-nc/B19-CFS2009?latestplayer=true&l=2476.0675
So, it would seem that there is a battle brewing between Blazor and Uno to capture this market, and I'm... ok with this. π
@danroth27 is Blazor Hybrid tracked by any issue?
How can people show interest in it?
@paolofulgoni Great question! I've created https://github.com/dotnet/aspnetcore/issues/18670 to track Blazor Hybrid related scenarios.
https://github.com/dotnet/aspnetcore/issues/11082#issuecomment-505223600
@jzabroski Do you have any examples or can you point me in the direction of getting Blazor working on Cordova?
GETTING WARMER. :) :) :)
https://devblogs.microsoft.com/aspnet/unified-ui-mobile-blazor-bindings-preview-5/
I mentioned in the blog post, but worth mentioning here as well:
There is in fact one app in the Apple App Store that is built using Mobile Blazor Bindings: a recipe app that I built: https://github.com/Eilon/Rezipe . At this time itβs native only and not hybrid, but I plan to add hybrid features to it as well. Install on iPhone/iPad from here: https://apps.apple.com/us/app/rezipe/id1529670338
There is in fact one app in the Apple App Store that is built using Mobile Blazor Bindings: a recipe app that I built
It's like the first pebble kicked loose at the top of a mountain! π
I wanted the same thing, so we built an android app to load the Web App into a Web View and handle client-side storage, Show Ads, and run native android commands.
We first tried Xamarine, but we were unable to get google ads working on it. So this is an Android Studio project. Now it's in production on Sithiyam Ruwa app on playstore and a few other projects.
I removed most of our mess and made a clean solution, just for you guys. It's super lightweight. This template loads a simple PWA game.
@danroth27 - don't tease by not telling us the name of the app. I need to try your recipes out. I promise only to leave friendly comments! Seriously though, I'd love to see this in action.
@simonziegler the info is in my post above @danroth27 's comment:
recipe app that I built: https://github.com/Eilon/Rezipe . At this time itβs native only and not hybrid, but I plan to add hybrid features to it as well. Install on iPhone/iPad from here: https://apps.apple.com/us/app/rezipe/id1529670338
The source is on GitHub, the Apple App Store link is there! Enjoy π
@Eilon thanks - I'm looking forward to seeing where you folks have reached. Having a single platform to support any kind of app I can reasonably conceive is exciting!
Most helpful comment
I think there are a few things we can consider doing here: