mehmetakbulut / signalr.strong Goto Github PK
View Code? Open in Web Editor NEWStrongly-typed calls from client to server and handlers for calls from server to client
License: MIT License
Strongly-typed calls from client to server and handlers for calls from server to client
License: MIT License
When using SignalR.Strong.Dynamic for our client and calling a hub method:
public Task TakeAString(string myString);
We get a System.InvalidOperationException
with the message This operation is only valid on generic types.
Which stack traces back to here:
https://github.com/mehmetakbulut/SignalR.Strong/blob/master/SignalR.Strong.Dynamic/HubInterceptor.cs#L53
From the docs it looks like we should check IsGenericType before calling GetGenericTypeDefinition.
https://docs.microsoft.com/en-us/dotnet/api/system.type.getgenerictypedefinition?view=net-5.0
Switching to SignalR.Strong.SourceGenerator
works.
Can PR this if you'd like, thanks for the project!
hi
Great library btw, Thank you!
I tried to use it as SignalR client in a Blazor example (used ExpressiveHub variant) and it looks like works properly.
So, am I guess right that it will not able to run Dynamic (it seems has a lot of platform-specific libraries in NuGet) or SourceGen (probably Roslyn may not work or be too heavy for webassembly) hubs on WebAssembly platform?
Thanks
The code generated by the SourceGenerator creates warnings as it doesn't have XML documentation on it.
If you have "warnings are errors" enabled, then this breaks your build.
I think we need to put a header on the whole file like https://stackoverflow.com/a/2701832
Or maybe just put // <auto-generated />
before the SignalR.Strong namespace (Like on the SignalR.Strong.SourceGenerated
namespace below)
https://github.com/mehmetakbulut/SignalR.Strong/blob/master/SignalR.Strong.SourceGenerator/HubGenerator.cs#L33
I've never debugged a source generator before so I'm not too sure.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.