-
Notifications
You must be signed in to change notification settings - Fork 784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(qsa, flatten-tree): abstract Node and Element apis in virtual tree #1562
Conversation
With |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I think this one needs another set of eyes. Maybe @WilcoFiers or @JKODU can also review?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question, and we need the getters back. Sorry, that idea of using getters was mine, I'm not sure it was a good one, but we're stuck with it.
I wanted the abstraction layer on the virtual node to be consistent and predictable so you wouldn't have to look at the virtual node implementation to figure out what the thing was called you wanted. I went with prefixing all api names with
element
and then capitalizing the first letter. Someone suggested mimicking jQuery api names, but they don't have any api names for low-level properties likenodeType
, andnodeName
, which would mean an inconsistency in naming convention.Qsa tests used a mock virtual tree, which made it really difficult to test changes to qsa that depend on the virtual tree implementation. So I changed it to use a real virtual tree and then added a test to ensure qsa does not look at the
actualNode
property (ensuring a DOM-less run).Linked issue: #1552
Reviewer checks
Required fields, to be filled out by PR reviewer(s)