AspNetCore.Docs icon indicating copy to clipboard operation
AspNetCore.Docs copied to clipboard

Blazor Hybrid/web shared assets via RCL

Open guardrex opened this issue 3 years ago β€’ 2 comments

Fixes #26186 Addresses #26848

Internal Review Topic

NOTE TO SELF

React to https://github.com/dotnet/AspNetCore.Docs/issues/26848 with a commit here and confirm/update the regular Blazor Class libraries topic.

Notes

  • Although the .NET podcasts sample splits out the audio player implementation for its "web" Blazor app, I felt the general principle is that an RCL can provide a single shared interface and implementations for both native and web when the interface is the same. Dan, your example didn't demo that aspect. I'm πŸ‘‚ if you want to handle it differently (i.e., move the interface and implementation for the "web" to the "web" project).
  • I avoid the word "agnostic" because idk how well that will translate. I went with "independent" instead.
  • This focuses the specific examples on .NET MAUI Blazor but includes NOTEs for WinForms and WPF and uses "Blazor Hybrid" language where the remark generally applies to Hybrid apps.
  • I tested with a .NET MAUI Blazor and Blazor Server app. However, I didn't test with WinForms/WPF, so I recommend either eyeball'in πŸ‘€ my remarks very carefully or signaling me to go ahead and take some additional time to test the scenarios here in WinForms and WPF projects.
  • This focuses on Blazor Server in the examples for "web" but indicates to readers that the concepts also apply to Blazor WebAssembly. Again, I didn't test Blazor WASM, so check me carefully on those remarks ... or else I can test all of the scenarios with WASM to see if I went wrong anywhere.
  • This focuses on a project ref/example of a RCL class lib project but tells readers that all of the concepts apply equally to publishing the RCL as a NuGet package. If you have any additional guidance on that scenario, I'm πŸ‘‚ for it and will add it to the topic. Alternatively, we can strike all of the NuGet package lingo.
  • Do you want a dotnet/blazor-samples repo sample of this scenario in spite of its forward maintenance costsπŸ’°? If so, is my test app that mirrors the guidance in the PR (.NET MAUI Blazor + Blazor Server) what you'd like to showcase?

guardrex avatar Jul 06 '22 12:07 guardrex

@danroth27 ... As of this (Tuesday) morning, I've made updates to address your feedback except for the last point, which will take a little more time. I'll either have that done this afternoon or on Wednesday. It's probably best if you wait until I get the last bit done because I'd also like to edit the whole topic again. I'll ping back when ready ... probably Wednesday morning.

guardrex avatar Jul 19 '22 12:07 guardrex

@danroth27 ... Perhaps best if you DO look at the very last commit, which only contains the 2nd abstraction example ...

  • First, is this in general what you're looking for? It's just the stream-of-consciousness first draft at this point, but I think you can steer me a different way if this isn't composing well right now.
  • Second ... if WASM and Hybrid share an implementation, it doesn't fit neatly into the default/OOB "Platforms" folder vis-a-vis the .NET MAUI Blazor project template when SxS with the Blazor Server implementation in the proposed "Web" folder. See what I mean? Blazor WASM is web, too. However, if it were pulled out of the Platforms folder, what folder name would be used to hold it? I think you'll need to figure out what the folder names (namespaces) should be for these implementations.

.... and no need to sweat any little nits (spelling, phrasing, etc.). I'll clean that stuff up tomorrow morning. I really did just type this straight in and ping u. There's no polish on this yet.

As for the rest ... the commit prior to the last ... probably best to not look at that yet. I need to πŸ’€πŸ›ŒπŸ˜΄ on it one night and apply a round of updates to clean up and improve it.

guardrex avatar Jul 19 '22 16:07 guardrex