I want to be able to make changes to the method signatures, names, etc on existing SignalR hubs. Is there a defined strategy for versioning SignalR hubs, so that old JS code can continue to work, without having to create a fresh newly named hub for the new calls?
SignalR Hubs are a way to logically group connections as documented. Take an example of a chat application. A group of users could be part of the same hub which allows for sending messages between users in the group. The hubName here can be any string which is used to scope messages being sent between clients.
The SignalR Hubs API enables you to make remote procedure calls (RPCs) from a server to connected clients and from clients to the server. In server code, you define methods that can be called by clients, and you call methods that run on the client.
Hub is a Server side material and needs to be hosted. For . NET, we have 2 clients that is (jQuery client and have ASP.NET client). So from here we will check how we can work with signalR. Open vs and Create a new Web Project in Console Application.
I'd say the short answer is no. Signalr does not have any versioning strategy like that.
The question is a little light on details, but signalr has for instance the option to use an attribute on a class to define the hubname. You could also create a new hub class by deriving from the original Hub in order to help you reuse existing code. Whatever you do new clientside js will need to be written.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With