Skip to content

Blazor WebView alternate runtime platform #33413

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

Merged
merged 13 commits into from
Jun 11, 2021

Conversation

SteveSandersonMS
Copy link
Member

Since @Eilon is moving the WinForms/WPF support out into the MAUI repo, we're going to need some other way to run the Microsoft.AspNetCore.Blazor.WebView code that remains in this repo (and the corresponding blazor.webview.js) to make sure it actually works and we can add features to it.

This PR adds a new Photino hosting platform which is a bit like the WinForms/WPF hosts except (1) it's cross-platform and can run on macOS/Linux too, and (2) it's limited to purely having a single Blazor webview in a window, and can't have any other native controls alongside it.

There is no plan to ship this for public use. People who actually want that can already use Photino's built-in Blazor support and simply don't need what we have here. The purpose of what we have here is just to help us validate and debug our ongoing work on Microsoft.AspNetCore.Blazor.WebView.

@SteveSandersonMS SteveSandersonMS added area-blazor Includes: Blazor, Razor Components feature-blazor-desktop This issue is related to Blazor Desktop labels Jun 9, 2021
@SteveSandersonMS SteveSandersonMS requested a review from a team June 9, 2021 19:13
@SteveSandersonMS SteveSandersonMS requested review from dougbu, Pilchie and a team as code owners June 9, 2021 19:13

namespace Microsoft.AspNetCore.Components.WebView.Photino
{
internal class PhotinoDispatcher : Dispatcher
Copy link
Member Author

@SteveSandersonMS SteveSandersonMS Jun 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure yet, but I might be able to eliminate this entirely by using Blazor's built-in "default" dispatcher. Haven't completely figured out whether that aligns with what Photino needs, but TBH I don't mind if we end up keeping this class here.

@Eilon
Copy link
Contributor

Eilon commented Jun 9, 2021

Since the Photino stuff is just for "testing," should it go into some testing folder instead of Platform?

@Eilon
Copy link
Contributor

Eilon commented Jun 9, 2021

(And then it doesn't need to track shipping APIs, etc.?)

@SteveSandersonMS
Copy link
Member Author

I don’t know. It is a “platform” even though we’re not shipping it. It will be a sample/playground as much as it is for testing.

I marked the assemblies as nonshipping - is that sufficient?

@HaoK
Copy link
Member

HaoK commented Jun 9, 2021

It is nice to not have sample/test code mixed in with production code to make it obvious that this isn't like all the other code, maybe its better in Components/WebView/samples directory that's already there?

@Eilon
Copy link
Contributor

Eilon commented Jun 9, 2021

@SteveSandersonMS I don't have a strong sense of what is best, but given that it doesn't ship at all, and is for testing/demo only, to me it seems to fit better in a samples/tests location.

@SteveSandersonMS SteveSandersonMS force-pushed the stevesa/webview-on-photino branch from 5bd5345 to 383fef3 Compare June 10, 2021 10:37
@SteveSandersonMS
Copy link
Member Author

OK, I've moved it under Samples. It's slightly quirky because there's a platform library, a test app, and (soon) a sample app. However I really don't feel strongly about it, so if this is what seems best to most people let's go that way.

@SteveSandersonMS
Copy link
Member Author

@dotnet/aspnet-build The build is failing with:

Unable to find package Photino.NET. No packages exist with this id in source(s): dotnet-eng, dotnet-experimental, dotnet-public, dotnet-tools, dotnet31-transport, dotnet5, dotnet5-transport, dotnet6, dotnet6-transport, richnav

What's the latest story on adding a new 3rd-party NuGet package? I see we don't reference the public NuGet.org feed any more. I checked the docs/ files and couldn't find anything describing the process for this. Is there some step needed to update one of our feeds?

FYI this new package is purely a sample/test dependency and doesn't impact any released code.

@SteveSandersonMS
Copy link
Member Author

cc @dougbu @wtgodbe about #33413 (comment). Sounds like it has to be added to our feeds. Is this something you're able to do? Thanks!

@dougbu
Copy link
Contributor

dougbu commented Jun 10, 2021

@SteveSandersonMS, I don't know if anyone other than @wtgodbe and @mmitche can get Photino.NET into the dotnet-public feed.

@wtgodbe
Copy link
Member

wtgodbe commented Jun 10, 2021

Pushed

@SteveSandersonMS
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Pull request contains merge conflicts.

@Eilon
Copy link
Contributor

Eilon commented Jun 10, 2021

@SteveSandersonMS there might still be a package missing: Photino.Native

@Eilon
Copy link
Contributor

Eilon commented Jun 10, 2021

This one is the dependency of Photino.NET: https://www.nuget.org/packages/Photino.Native/

@wtgodbe
Copy link
Member

wtgodbe commented Jun 10, 2021

there might still be a package missing: Photino.Native

pushed

@wtgodbe
Copy link
Member

wtgodbe commented Jun 10, 2021

/azp run

@azure-pipelines
Copy link

Pull request contains merge conflicts.

@SteveSandersonMS SteveSandersonMS force-pushed the stevesa/webview-on-photino branch from af515bd to 2af3d10 Compare June 11, 2021 14:00
@@ -37,6 +37,16 @@
"src\\Components\\WebAssembly\\testassets\\Wasm.Authentication.Server\\Wasm.Authentication.Server.csproj",
"src\\Components\\WebAssembly\\testassets\\Wasm.Authentication.Shared\\Wasm.Authentication.Shared.csproj",
"src\\Components\\WebAssembly\\testassets\\WasmLinkerTest\\WasmLinkerTest.csproj",
"src\\Components\\WebView\\Samples\\PhotinoPlatform\\src\\Microsoft.AspNetCore.Components.WebView.Photino.csproj",
"src\\Components\\WebView\\Samples\\PhotinoPlatform\\testassets\\PhotinoTestApp\\PhotinoTestApp.csproj",
"src\\Components\\WebView\\Platforms\\WebView2\\src\\Microsoft.AspNetCore.Components.WebView.WebView2.csproj",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to rebase?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well spotted, thanks.

@SteveSandersonMS SteveSandersonMS merged commit cf2f128 into main Jun 11, 2021
@SteveSandersonMS SteveSandersonMS deleted the stevesa/webview-on-photino branch June 11, 2021 19:57
@ghost ghost added this to the 6.0-preview6 milestone Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-desktop This issue is related to Blazor Desktop
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants