Skip to content

Conversation

@dmarcos
Copy link
Member

@dmarcos dmarcos commented Jul 15, 2017

It checks for the tagName to be a-node , a-entity or a registered primitive.

@dmarcos
Copy link
Member Author

dmarcos commented Jul 15, 2017

We should make sure there are no other a-nodes the parent should be waiting for? a-animation, a-asseet-item... Not sure if a-assets need some rethinking to make sure we block rendering on them

Copy link
Member

@ngokevin ngokevin left a 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

// Default to waiting for all nodes.
childFilter = childFilter || function (el) { return el.isNode; };
childFilter = childFilter || function (el) {
var tagName = el.tagName.toLowerCase();
Copy link
Member

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?

childFilter = childFilter || function (el) {
var tagName = el.tagName.toLowerCase();
var isEntity = tagName === 'a-entity' || tagName === 'a-node' || primitives[tagName] !== undefined;
return el.isNode || isEntity;
Copy link
Member

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

@dmarcos
Copy link
Member Author

dmarcos commented Jul 17, 2017

The prototype of the children elements is not set by the time createdCallback and attachCallback are called on the parent. I'm using the existing method isNode now that checks for the registered tags (https://github.com/aframevr/aframe/blob/master/src/core/a-register-element.js#L32). I think this should be sufficient.

});
});

test('wait for all the node children that are not yet nodes to load', function (done) {
Copy link
Member

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?

@dmarcos
Copy link
Member Author

dmarcos commented Jul 17, 2017

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 isNode flag is not set yet (because createdCallback has not been yet invoked)

@ngokevin
Copy link
Member

Need to remove the .only.

@ngokevin
Copy link
Member

r+wc nice, i forgot we did that isNode function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants