4 ms·
The addition of the ability to just use querySelectorAll as the selector engine and not ship Sizzle is a pretty big deal, and not something I remember being inc
by apendleton 14y ago
The addition of the ability to just use querySelectorAll as the selector engine and not ship Sizzle is a pretty big deal, and not something I remember being included in earlier discussions about jQuery 2. qSA still includes a pretty broad set of selectors, and the ability to get the build down to 10k minified and gzipped puts it squarely in Zepto's territory, size-wise, eliminating the need for that particular wheel reinvention.
- dmethvin 14y agoIf you use really simple class and id selectors, the qSA-based selector engine may be fine. However, I think a lot of devs would be surprised about how much Sizzle is doing for them.
- apendleton 14y agoqSA does a lot more than class and id selectors; those have been trivial since long before qSA came along. You can also do selection on element attributes, parent-child selections (include strict child selection with ">"), and a few other higher-order selector combinations. Still, I don't mean to slight Sizzle, and certainly won't stop using it. It's just nice to see jQuery compete with Zepto, since apparently there's a demand for a build that small, and jQuery is better-tested and less brittle.
- dmethvin 14y agoI didn't mean to say that's _all_ you can do, but people often expect more than qSA can deliver, especially if they've been using jQuery/Sizzle for a while. Sizzle also works around bugs in qSA implementations when they exist. qSA's design shortcomings have been well documented, John Resig did a blog long ago about them [1]. The list of what you lose if you remove Sizzle is in the native selector file [2]. [1] http://ejohn.org/blog/thoughts-on-queryselectorall/ http://ejohn.org/blog/thoughts-on-queryselectorall/ [2] https://github.com/jquery/jquery/blob/master/src/selector-native.js#L4 https://github.com/jquery/jquery/blob/master/src/selector-na...
- KaoruAoiShiho 14y agoIs there a list of features of what sizzle does over qSA
- dmethvin 14y agoPosted elsewhere, but https://github.com/jquery/jquery/blob/master/src/selector-native.js#L4 https://github.com/jquery/jquery/blob/master/src/selector-na...
- deleted 14y ago[deleted]