Good browsers™ implements classList which makes classes manipulation as easy as jQuery, without the need for jQuery. It's faster, lighter and future proof.

IE needs a polyfill for it, which is tiny 850b min+gziped https://github.com/eligrey/classList.js this will allow a lot of core scripts to not rely on jQuery for this (we use it a lot) an make sure contrib is able to use modern JS for this.

CommentFileSizeAuthor
#3 core-js-classList-1754166-3.patch4.42 KBnod_

Comments

nod_’s picture

Title: Ass ClassList polyfill for IE8 » Add ClassList polyfill for IE8

hum, hum.

nod_’s picture

Title: Add ClassList polyfill for IE8 » Add classList polyfill for IE

typo again, sorry.

nod_’s picture

Status: Active » Needs review
StatusFileSize
new4.42 KB

taken autocomplete.js as an example.

seutje’s picture

I am all for these kinds of optimizations, but I feel we should first get proper conditional loading because only loading this for IE would mean we are effectively dropping support for Opera Mini, old (iOS) safari and old android.

nod_’s picture

The polyfill won't work on mini or old safari, the polyfill is only for IE. It's all IE js API. looks like it does actually, nice :D

seutje’s picture

so, do we polyfill's own feature-test, or do we make it depend on Modernizr and make a Modernizr test for it?

nod_’s picture

Status: Needs review » Needs work
nod_’s picture

Issue summary: View changes
Status: Needs work » Closed (works as designed)

Already added.