Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is SignalR dependent on jQuery

So I know upcomping releases of SignalR are being made not to rely on jQuery.

https://github.com/SignalR/SignalR/issues/372 - the closed issue to move it away from jQuery.

But why was it dependant on it in the first place? (Obviously from a technical standpoint) Seeing as there seems to be nothing special about jQuery (apart from it exists, in the sense that it could make your life easier).

Was this mostly due to the practicalities of jQuery?

like image 356
Callum Linington Avatar asked Feb 26 '15 08:02

Callum Linington


2 Answers

If you can't use .Net Core version which now works without jQuery you can use this. It's SignalR wrapped in NPM module and it doesn't require jQuery. It only locally loads ~5KB necessary functions taken from it https://github.com/DVLP/signalr-no-jquery

like image 114
Pawel Avatar answered Oct 12 '22 11:10

Pawel


The SignalR JS client currently uses jQuery for the following functions:

  • Custom events (on objects, not DOM elements)
  • Ajax (works on older IE, wrapped in promises, etc.)
  • Promises (deferred)
  • Misc. utilities

When we remove the jQuery dependency, we'll need replacements for all of these. There are some modern standards supported in ES6 and the latest browsers that will give us some of these things, but others we'll need to create new wrappers for. We may still choose to detect and "light up" on jQuery if it's loaded before us, e.g. to support older IE versions.

like image 21
Damian Edwards Avatar answered Oct 12 '22 12:10

Damian Edwards