It’s time for jQuery to go. It’s a great library but it’s not a part of Rails.
jQuery joins Rails
It still powers features like remote forms, the
data-confirm attribute, and CSRF protection.
Life was good.
The fall of jQuery
When jQuery arrived it was amazing. It worked across browsers. Ajax was simple. Events were handled sanely. CSS selectors saved us all from the hell of DOM navigation.
That optional dependency is 32kB minified and gzipped. The only thing Rails needs it for is 556 lines of UJS. I decided to suggest removing it.
Cutting it loose from the Rails
As it turned out, Benoit Bénézech had beat me to it. He opened an issue on jquery-ujs outlining its removal. Rails projects use Google Groups rather than GitHub issues to discuss features so it was closed. Unable to find a post about it in the Rails core group I opened one.
I received a quick reply. Rails was considering this as a Google Summer of Code project. It turns out having original ideas is tricky.
So, it looks like 2016 might be the year Rails and jQuery go their separate ways. In the mean time you can try out Vanilla UJS. It’ll be smaller for now and with any luck it won’t be need for long.