Hacker News new | ask | show | jobs
by kmfrk 4081 days ago

    A tiny, lightning fast jQuery-like library for modern browsers.
Respectfully, this entire description is an oxymoron. Every time someone mentions a jQuery-like microlibrary, they just mean a jQuery without wide browser(-quirk) support.

Browser support is a big part of what makes jQuery jQuery, and without it, you definitely get a much smaller library, but it is also very un-jQuery-like. :)

Now for some praise! It makes me really happy to see a comparison - benchmark! - with competitors, which is something everyone should be required to do, when they create software with 40,000 similar offerings. Looking at you, Markdown editors!

2 comments

JQuery themselves have two versions, one with less browser support which is apparently smaller/faster. So it's weird to say that it's not-JQuery-like.

Though JQuery still recommends the bigger library for most users (unless you're embedding in a mobile app or stuff like that).

jQuery 1.x is recommended over 2.x due to lack of IE8 support in the latter. If you don't have IE8 traffic on your site, you can safely go with 2.x (which isn't that much smaller to begin with).
I thought that was true, but checked a few months back and the advice seemed a bit more equivocal than that:

> So, here’s the TL;DR for version 3.0 of the jQuery API:

> * If you need support for the widest variety of browsers including IE8, Opera 12, Safari 5, and the like, use the jQuery-Compat 3.0.0 package. We recommend this version for most web sites, since it provides the best compatibility for all website visitors.

> * If your web site is built only for evergreen leading-edge browsers, or is an HTML-based app contained in a webview (for example PhoneGap or Cordova) where you know which browser engines are in use, go for the jQuery 3.0.0 package.

from http://blog.jquery.com/2014/10/29/jquery-3-0-the-next-genera...

I personally currently need to support IE9 which I wouldn't class as an "evergreen leading-edge browser". I was hoping for a more in depth compatibility chart that named specific versions.

I'd love to have a streamlined but otherwise version of JQuery which I can serve to known modern web browsers. And serve the 'full' version to non-modern browsers.
Sounds like Zepto is pretty close to what you're looking for: http://zeptojs.com/. Otherwise, jQuery 2.x is just jQuery without support for IE 6, 7 and 8. I'm not sure what kind of performance improvements it offers, but it shaves off a few kb.
In a horrendously framgented mobile internet, one of the few blessings we do have is that the vast majority of mobile web browsers are WebKit variants so this kind of makes a lot of sense if, say, you're only targeting iOS and Android default browsers.

I'm curious if it will take jQuery plugins though. Will try later.

iOS and default Android. If you want to ignore Firefox and Opera then that’s your choice I guess.
The default Android browser is no longer supported, and the embedded Chrome is blink-based and less and less webkit-ish.

(And even the different Webkit ports can't be thrown into the same bag.

Compare e.g. Safari on OSX, Safari on Windows, Midori on Windows and Midori on Linux. Two webkit browsers, crass rendering and behavioural differences between them and on each platform.)

Different Android vendors have versioned Chrome too and added their own quirks: http://www.quirksmode.org/blog/archives/2015/02/chrome_conti...
It would be better to say that mobile benefits from modern browsers, not just WebKit ones. I've gone without jQuery on a bunch of mobile only projects and run into zero issues.
GP did say "vast majority"

If you want to devote dev time to specialize for the relative handful of folks who run Firefox on their mobile device, that's your call.