-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Wait for entities to load when the a-node has not been yet initialized (fix #2802) #2873
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
Conversation
|
We should make sure there are no other |
ngokevin
left a comment
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.
We should try to find a way without hard coding. Perhaps dig more into why createdCallback not called or ensure how to wait createdCallback is called or use prototype checking
src/core/a-node.js
Outdated
| // Default to waiting for all nodes. | ||
| childFilter = childFilter || function (el) { return el.isNode; }; | ||
| childFilter = childFilter || function (el) { | ||
| var tagName = el.tagName.toLowerCase(); |
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.
The prototype is not available?
src/core/a-node.js
Outdated
| childFilter = childFilter || function (el) { | ||
| var tagName = el.tagName.toLowerCase(); | ||
| var isEntity = tagName === 'a-entity' || tagName === 'a-node' || primitives[tagName] !== undefined; | ||
| return el.isNode || isEntity; |
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.
This function should check isNode the very first. If not, only the execute the lowerCase and other checks
|
The prototype of the children elements is not set by the time |
tests/core/a-entity.test.js
Outdated
| }); | ||
| }); | ||
|
|
||
| test('wait for all the node children that are not yet nodes to load', function (done) { |
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.
These tests pass for me without the changes. Do these reproduce the issue?
|
I had run the tests with breakpoints that introduce changes in the timing. I added extra conditions to the tests so they're checking what they're supposed to test: The parent waits for the children nodes to load when the |
|
Need to remove the |
|
r+wc nice, i forgot we did that |
It checks for the tagName to be
a-node,a-entityor a registered primitive.