cljs-ajax icon indicating copy to clipboard operation
cljs-ajax copied to clipboard

Deprecate XhrIo

Open JulianBirch opened this issue 7 years ago • 2 comments

The XmlHttpRequest implementation has been solid for quite some time and the XhrIo code adds very little when you're running in modern browsers. It's time to switch. This will remove all Google Closure code from the main code path for cljs-ajax.

JulianBirch avatar Jan 02 '18 10:01 JulianBirch

For future reference, if this happens, note that it looks pretty easy to make progress handlers work. GCL just checks for an onprogress property in the xhr object and sets it if its there.

https://github.com/google/closure-library/blob/master/closure/goog/net/xhrio.js#L535

I had been meaning to try out a patch but until I do I wanted to make sure this didn't get lost.

jmlsf avatar May 04 '18 01:05 jmlsf

FWIW, I just spent some time tracking down an issue in my program which turned out to be an incompatibility between XhrIo and AdBlock, when loading a page via figwheel. I solved the problem by passing :api (js/XMLHttpRequest.) to every cljs-ajax call. So you can count me in favor of this change, too!

kengruven avatar Jul 16 '18 14:07 kengruven