csnewman / BlazorSignalR

SignalR Core C# client Blazor compatibility
MIT License
64 stars 21 forks source link

Blazor 0.9.0 support #7

Closed CatoLeanTruetschel closed 5 years ago

CatoLeanTruetschel commented 5 years ago

Version 0.4 of BlazorSignalR isn't running with Blazor 0.9.0 as the static JSRuntime.Current property was removed. (See https://devblogs.microsoft.com/aspnet/blazor-0-9-0-experimental-release-now-available/)

csnewman commented 5 years ago

Feel free to submit a pull request. If the JSRuntime code is being replaced, probably worth ensuring Server Side Blazor works (as in, the requests are relayed from the server to the browser and then to the target SignalR host).

CatoLeanTruetschel commented 5 years ago

@csnewman Just in time :D

If the JSRuntime code is being replaced, probably worth ensuring Server Side Blazor works

I didn't test this, but this should work now. I added a shim for the js runtime. If it is not in-process, we block. Maybe this can be changed in the future. All invoking methods have to be async then. But I think this should be done in a separate PR.

as in, the requests are relayed from the server to the browser and then to the target SignalR host

I also see the long-term use case that this is running in a WebComponent and we don't have an in-memory js runtime.