Thank you, jQuery
Jeremy recently updated HuffDuffer to a progressive web app and as part of that process stripped out jQuery. The great thought is that jQuery purpose is to eventually cease to exist.
After that, I decided to refactor the JavaScript too. There, I had a clear goal: could I remove the dependency on jQuery?
It turned out to be pretty straightforward. I was able to bring my total JavaScript file size down to 3K (gzipped). Pretty much everything I was doing in jQuery could be just as easily accomplished with DOM methods like
An excerpt from Thank you, jQueryaddEventListener
andquerySelectorAll
, and objects likeXMLHttpRequest
andclassList
.