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

Enable Ability to Host Blazor Applications in Microsoft, Apple, and Google Play Stores #11082

Closed
Mike-E-angelo opened this issue Jun 11, 2019 · 26 comments
Labels
affected-very-few This issue impacts very few customers area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one External This is an issue in a component not contained in this repository. It is open for tracking purposes. feature-blazor-deployment Issues related to deploying Blazor severity-blocking This label is used by an internal tool
Milestone

Comments

@Mike-E-angelo
Copy link

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

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:

Describe the solution you'd like

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:

  1. Host an ASP.NET Core server locally within a store-hosted application context, much like (or exactly) the same way it is hosted within a WebAssembly application context.
  2. Utilize a WebView or equivalent control, defined as the primary (or only) control within the application so that it displays web pages.
  3. From the WebView control, make requests to the web server established in the first step.

Describe alternatives you've considered

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.

Additional context

I believe I have covered all aspects with links in the above description. Thank you for any consideration around this goal!

@GearTheWorld
Copy link

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.

@Mike-E-angelo
Copy link
Author

Ask and you shall receive, @GearTheWorld. 😆

https://www.radzen.com/blog/introducing-the-blazor-wysiwyg-design-time/

@analogrelay analogrelay added the area-blazor Includes: Blazor, Razor Components label Jun 11, 2019
@danroth27
Copy link
Member

danroth27 commented Jun 12, 2019

I think there are a few things we can consider doing here:

  • Blazor PWA - Make it simple to build Blazor progressive web apps that support offline scenarios and native integration where possible. Tracked by PWA template #5479. These apps can be installed via most app stores.
  • Blazor Hybrid - Run Blazor on mobile devices that then drives a WebView. This is very similar to how our Blazor Electron prototype works today and sounds closest to what is being proposed here. I believe it's also similar to how Cordova/Ionic based apps work today and would share similar trade offs (convenient to reuse web skills and code, platform agnostic UI code, tricky to make feel truly native)

    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.

@AdmiralSnyder
Copy link

@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.

@danroth27
Copy link
Member

@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).

@MatthewS2077
Copy link

Blazor PWA gets my vote. I'm interested in client side Blazer so anything that decreases the startup time and initial payload is welcome.

@danroth27
Copy link
Member

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 😄. Also, to be clear, the options above are not mutually exclusive. We could do none, some, or all of them.

@Mike-E-angelo
Copy link
Author

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. 👍

@mkArtakMSFT mkArtakMSFT added this to the Backlog milestone Jun 19, 2019
@mkArtakMSFT mkArtakMSFT added the enhancement This issue represents an ask for new feature or an enhancement to an existing one label Jun 19, 2019
@jzabroski
Copy link

@danroth27 , you can target Cordova with Blazor today with some hacks. The pain would be in debugging tooling.

@stavroskasidis
Copy link

@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.

@simonziegler
Copy link

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

@menasheh
Copy link

Really excited about most of these ideas, although unfortunately they seem to be 2-3 years away at least

@Mike-E-angelo
Copy link
Author

Mike-E-angelo commented Nov 9, 2019

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

@Mike-E-angelo
Copy link
Author

Mike-E-angelo commented Nov 9, 2019

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. 😁

@paolofulgoni
Copy link

@danroth27 is Blazor Hybrid tracked by any issue?
How can people show interest in it?

@danroth27
Copy link
Member

@paolofulgoni Great question! I've created #18670 to track Blazor Hybrid related scenarios.

@scottkuhl
Copy link

#11082 (comment)

@jzabroski Do you have any examples or can you point me in the direction of getting Blazor working on Cordova?

@mkArtakMSFT mkArtakMSFT added affected-very-few This issue impacts very few customers severity-blocking This label is used by an internal tool labels Oct 12, 2020 — with ASP.NET Core Issue Ranking
@Mike-E-angelo
Copy link
Author

GETTING WARMER. :) :) :)

https://devblogs.microsoft.com/aspnet/unified-ui-mobile-blazor-bindings-preview-5/

@Eilon
Copy link
Member

Eilon commented Oct 30, 2020

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

@danroth27
Copy link
Member

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! 😄

@HasinduLanka
Copy link

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.

https://github.com/HasinduLanka/BlazorDroid

@simonziegler
Copy link

simonziegler commented Nov 1, 2020

@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.

@Eilon
Copy link
Member

Eilon commented Nov 2, 2020

@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 😄

@simonziegler
Copy link

@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!

@RChrisCoble
Copy link

I think there are a few things we can consider doing here:

  • Blazor PWA - Make it simple to build Blazor progressive web apps that support offline scenarios and native integration where possible. Tracked by PWA template #5479. These apps can be installed via most app stores.
  • Blazor Hybrid - Run Blazor on mobile devices that then drives a WebView. This is very similar to how our Blazor Electron prototype works today and sounds closest to what is being proposed here. I believe it's also similar to how Cordova/Ionic based apps work today and would share similar trade offs (convenient to reuse web skills and code, platform agnostic UI code, tricky to make feel truly native)

    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.

Vote for "Blazor Native" for this UC, to maximize performance on the target devices.

@javiercn javiercn added the feature-blazor-deployment Issues related to deploying Blazor label Apr 19, 2021
@danroth27
Copy link
Member

We are supporting hosting Blazor components in .NET MAUI apps, which can then be deployed to app stores. This work is being tracked by dotnet/maui#2536.

@danroth27 danroth27 added the External This is an issue in a component not contained in this repository. It is open for tracking purposes. label Oct 19, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Nov 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affected-very-few This issue impacts very few customers area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one External This is an issue in a component not contained in this repository. It is open for tracking purposes. feature-blazor-deployment Issues related to deploying Blazor severity-blocking This label is used by an internal tool
Projects
None yet
Development

No branches or pull requests