6 ms·
A lot of good changes in here. The modularity will improve usability -- particularly for sites who want the core jQuery features without all the extras. My ho
by calvin 14y ago
A lot of good changes in here. The modularity will improve usability -- particularly for sites who want the core jQuery features without all the extras. My hope is this will make it easier to use jQuery on mobile -- and more comparable to Zepto in terms of size.
I remember reading somewhere that 1.8 would drop support for quirks mode in IE. Anybody know if this ended up happening? I didn't see any mention in this post.
- MatthewPhillips 14y agoI can't imagine why you'd need jQuery on mobile in the first place? What exactly are these core features that the standard DOM apis don't give you?
- pacomerh 14y ago"I can't imagine why you'd need jQuery on mobile in the first place?" How about having the jQuery functionality on mobile device?, Recommended reading http://en.wikipedia.org/wiki/JQuery http://en.wikipedia.org/wiki/JQuery
- agildehaus 14y agoI suppose you write all your code in assembly too? There's no room for going higher-level than the APIs exposed by the browser?
- mkmcdonald 14y agoThe DOM API is clear enough that silly abstractions like "selector engines" are unnecessary. The C vs. Assembly argument is such a silly non-point; apples and artichokes.
- nilliams 14y agoSelector engines are clearly not silly abstractions otherwise all major browsers would not have implemented querySelectorAll.
- mkmcdonald 14y ago…which is a façade for the existing CSS engine. Developers clamoured for it (right or wrong), and it was implemented.
- MatthewPhillips 14y agoBut since they did, why use jQuery on mobile when 100% of mobile browsers support querySelectorAll?
- taligent 14y agoHilarious that you think that one of the core features of the most successful JS library in history is a "silly abstraction". And JQuery is much more than just a selector engine.
- MatthewPhillips 14y agoI'm just curious what the higher-level APIs are that people need from jQuery that aren't available on mobile. I recall jQuery being popular for selector queries (available on all mobile browsers natively with querySelector and querySelectorAll) and for even listeners (offers no real advantage over addEventListener as far as I can tell).
- mark_story 14y agoWell one nice affordance jQuery offers, is you can do manipulations en-mass without having to write out a loop, or use Array.forEach(). This helps simplify event binding and manipulation code. Also there are selectors in jQuery that are not available in querySelectorAll. And lastly querySelectorAll has some pretty buggy implementations. jQuery smoothes these out.
- gildas 14y agoBinding event handlers in a loop is an anti-pattern greatly promoted by jQuery during several years. You should use event delegation.
- mark_story 14y agoSure but $('.clicky').on('click', doSomething); means no loops at all, and will bind events to all matching elements. I don't think there is a native API way to do this. Edit: typos
- MatthewPhillips 14y agodocument.getElementsByClassName('clicky').forEach(function(el) { el.addEventListener('click', doSomething); });
- d4n3 14y agoI'm not sure that works. getElementsByClassName (and Id and querySelector) returns a NodeList, not an Array, so there's no foreach, you have to convert it to an array first.
- mkmcdonald 14y agoA massive script such as jQuery does not belong on a mobile device, minified or not. Surely mobile developers would know that minimal script is best.
- glhaynes 14y agoI browse to tons of pages on my phone every day that presumably use JQuery and work fine. We're not in the WAP days anymore.
- mkmcdonald 14y agoI guess my humble iPod Touch that sputters out on bloated sites like GitHub just isn't up to snuff. Try loading a page without script bloat and you'll see a noticeable difference.
- deleted 14y ago[deleted]
- dmethvin 14y agojQuery never really "supported" quirks mode, the unit tests were not ever run in quirks for example. A few of the offset and dimensional tests tried to account for quirks, but we gave up on that totally in 1.8 in favor of fully supporting the CSS box-model property. Many Quirks pages could still use jQuery 1.8 successfully if they avoid asking for dimensional measurements, but I'm not sure why developers would still use quirks since it throws IE into prehistoric mode and has serious performance impacts.
- calvin 14y agoI don't think any knowledgeable front-end engineer would build a page in quirks mode, but a surprising number of existing sites have large swaths of pages without a doctype.