Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

jqLite.find - why not use querySelectorAll? #3586

Closed
ledbettj opened this issue Aug 14, 2013 · 9 comments
Closed

jqLite.find - why not use querySelectorAll? #3586

ledbettj opened this issue Aug 14, 2013 · 9 comments

Comments

@ledbettj
Copy link

The current version of jqLite.find implemented via getElementsByTagName is somewhat restrictive to say the least. Is there a reason it doesn't use querySelectorAll which is fairly widely supported and much more useful?

Granted, it's not supported by < IE8, but there's already a section in the documentation about supporting older IE versions.

@matsko
Copy link
Contributor

matsko commented Aug 14, 2013

AngularJS doesn't test for nor support anything less than IE8 so I agree with implementing this feature.

@rroehrig
Copy link

+1
The AngularJS documentation references the jQuery documentation for the implemented jqLite functions. Therefore, I highly recommend implementing the find function accordingly. Our team wasted some time identifying the problem in our tests (we didn’t include jQuery initially).

@gkalpak
Copy link
Member

gkalpak commented Nov 10, 2014

@rroehrig: The Angular docs (which should be read before the jQuery ones) are pretty explicit about it (imo):

find() - Limited to lookups by tag name

@rroehrig
Copy link

@gkalpak
I agree but many people include the contracts when they read “API-compatibility subset of jQuery” (cf. green box). Therefore we expected the listed functions to be compatible with jQuery’s contracts (and the functions which are not listed to be not compatible).

It’s up to angular! I just wanted to share our experience.

@gkalpak
Copy link
Member

gkalpak commented Nov 10, 2014

@rroehrig:
So, basically, you say that you read the list of available functions, but only the left part and not the note right next to it ? Yes, that would definitely cause people trouble 😃

That said, the only "improvement" I could think of is making the side notes more striking to the eye.

@pkozlowski-opensource
Copy link
Member

Documentation aside the crux of this issue is this: can we use querySelectorAll instead of getElementsByTagName now that IE8 is out of the way. The answer seems to be yes, all the breaking changes (if any) aside...

@gkalpak
Copy link
Member

gkalpak commented Nov 10, 2014

@pkozlowski-opensource: I am not really sure why (to you) the answer seems to be yes, but (based on the discussion in #3598) the answers seems to be no, I think.
Apparently, there is more to qSA than meets the eye (and definitely more than IE8 compatibility concerns) :)

@pkozlowski-opensource
Copy link
Member

@gkalpak I take back what I've said - looking at the discussion in #3598 it doesn't seem to be trivial.

@lgalfaso
Copy link
Contributor

I am going to close this in favor of #3598 if you have an opinion on this, I recommend you to post your comments there

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants