You may have heard that Rails 5.1 will no longer depend on JQuery. Here's the PR.
Now, you might be asking yourself: "Why would a Ruby framework have a dependency on JQuery in the first place?" The answer lies in in Rails' unobtrusive JavaScript system. That's the bit that makes it possible to do things like:
link_to "delete", delete_path, remote: true, method: destroy
In order to remove this dependency, the UJS system has been ported to vanilla JS. It's also been given a new gem name. Instead of requiring the jquery-ujs gem, we'll be requiring the rails-ujs gem.
Legacy Browser Support
The one major drawback to eliminating JQuery is that UJS will no longer support older browsers as well as it used to. One of the reasons for JQuery's size and complexity is that it does support legacy browsers.
This potential issue was hinted at in the original Github issue, but nobody specifically mentioned which browsers would be unsupported. That's why I thought it would be interesting to run some tests.
I ran the test suites for jquery-ujs 1.2 and the latest rails-ujs (Jan 5, 2017) on IE 8-11. Chrome (55.0.2883.95) was used as a control. Microsoft provides free VMs for testing, if you're playing along at home.
Browser | jquery-ujs test failures | rails-ujs test failures |
---|---|---|
Chrome | 0 of 110 | 0 of 110 |
IE11 | 3 of 110 | Tests won't run |
IE10 | 4 of 110 | 119 of 122 |
IE9 | 4 of 110 | 119 of 122 |
IE8 | 14 of 110 | 118 of 122 |
Conclusions
Neither of the test suites worked perfectly in IE, but the jquery-ujs suite fared much better. The new Rails UJS system seems to be completely unsupported on IE10 and down. I was unable to get a good reading on IE11 as a the test suite refused to run.
Supposedly it will be possible to load the older jquery-ujs gem on top of the new rails-ujs to bring back legacy browser support. I haven't had a chance to see if it works yet.