Open kevingates opened 9 months ago
Auto Global is the same as Global WASM with some extra stuff on the first page load. I haven't had much time to investigate what that real difference is on the initial load. Once the SPA is running it's pure WebAssembly
as far as I can see. The real nono is Per Page/Component. It's an absolute minefield. There are soo many questions on StackOverflow where the root cause is going for broke. People are out of their depth.
I need to emphasise this is a personal view. I haven't seen any one else being as forthright. I'm a BIG fan of Blazor, but I think MS have mad a wrong step with the template design. We may well see changes in the next release.
@ShaunCurtis : I appreciate your candidness. Don't worry, I know this is a personal view. But it's obvious you have thought deeply about it and are invested in Blazor's success.
My current route is to have Auto, but make sure our service layer has something like this:
In this way our Server Project will have a scoped IExampleService, using ExampleService and the WASM will have a scoped IExampleService using the ExampleApiService. This way everything stays in sync in terms of methods and then it can seamlessly move from Server to WASM and the components should play happily.
I'm currently trying to build a Demo project to demonstrate how to implement such a solution. It's public so you are welcome to take a look - https://github.com/ShaunCurtis/Blazr.Auto.Demo. It's a serious work in progress at the moment! You need to be careful about the SDK and what packages you use in your libraries: some are incompatible with WASM - I hit a surprising one last night! You may need Library.Infrastructure and Library.Infrastructure.Server projects for the server specific stuff. If you have any questions on the demo post them.
@ShaunCurtis : do you happen to have somewhere (or know of a good guide) for setting up authentication in this "Interactive Audo" world? We're trying to do just Windows Authentication and the newer Microsoft Templates are thinner than when in .Net 6. Leaves a lot to be desired. For something as important as Auth, I would hope Microsoft would be a bit clearer with examples.
Not for 8. I'm working on an individual account authentication re-development at the moment. There's some older stuff of mine here that shows how to do authentication testing and policy based authorization. https://github.com/ShaunCurtis/Blazr.Demo.Authorization
@ShaunCurtis : you mention here: https://github.com/ShaunCurtis/Blazor.ExploreRendering/blob/master/Documents/Going-For-Broke.md you suggest Global and Server or WASM. You speak against Per Page and Auto.
In your opinion, does Global and Interactive Auto carry much risk? I would hope this would provide both the initial speed load and then putting it off to the client to help make this be the best of both worlds.