News for hackers. Stuff that matters.
Re:Single Page Applications using Rust by grok22 on Tuesday August 11, 2020 @04:49PM (#24125810)
I am interested in understanding this further -- is there a write-up or explanation with example anywhere regarding how you achieve this in Blazor.
Re:Single Page Applications using Rust by bob1029 on Tuesday August 11, 2020 @05:24PM (#24126157)
As far as I am aware, there is no public document on the internet which describes this approach in a consolidated way. Unfortunately, I cannot share examples from the codebase I am currently operating on. That said, I can offer some MS documentation links in hopes that this paints a slightly better picture for how I achieve this outcome.

This describes how you would request a scoped stateful service from an arbitrary Razor Component:

https://docs.microsoft.com/en-us/aspnet/core/blazor/fundamen...

This describes how you would inject these stateful services into DI in a way that scopes them as desired:

https://docs.microsoft.com/en-us/aspnet/core/blazor/fundamen...

Note that we are using Server-Side Blazor, so this approach works for us. I do not think it works with WASM (at least out of the box), but we do not care for this form of Blazor hosting right now, so its not a concern for us.

Re:Single Page Applications using Rust by Scarbutt on Tuesday August 11, 2020 @08:06PM (#24127349)
Note that we are using Server-Side Blazor, so this approach works for us. I do not think it works with WASM (at least out of the box), but we do not care for this form of Blazor hosting right now, so its not a concern for us.

Hmm interesting, how does that work? What enables the interactivity in the browser?

Re:Single Page Applications using Rust by kovacs_ on Wednesday August 12, 2020 @11:28AM (#24133023)
Blazor Server downloads a small js script (SignalR) to the client on connection. All user events are sent back to the server through SignalR, then DOM changes are sent back to the client based off of user input.

I use it at work for internal intranet web apps so it's pretty handy for our use case.