-
Notifications
You must be signed in to change notification settings - Fork 63
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
Custom Element support #113
Conversation
} else { | ||
parentNode.appendChild(domNode); | ||
} | ||
insertNode(parentNode, domNode, vnode, insertBefore); | ||
} else { | ||
for (i = 0; i <= vnodeSelector.length; ++i) { | ||
c = vnodeSelector.charAt(i); |
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.
Rather than using a regex, testing if c === '-' would be more performant
I think that using a regex would be too much of a performance penalty. The selector is already parsed character by character, this would be a better place to test for '-' |
@devpaul we are currently considering if we couldn't better delay attaching all nodes in a new major/breaking release of maquette. This would force non-custom-component plugins to register a callback to delay initialisation until the projector is finished building the DOM. This would also mean you can prevent unneeded reflows from happening. |
@johan-gorter that would be great! My two biggest pain points in working with custom elements is failed initialization due to missing attributes and unnecessary reflows. I imagine most custom elements are designed and tested to work as a HTML component, but not necessarily to work in a vdom. Having the ability to help my framework work around these corner cases would mean a great deal. Please let me know if I can help or provide feedback. |
@devpaul we are adressing this issue in maquette 3.0 and would like your oppinion on this subject. See #118 |
Added support for custom elements by delaying their attachment to the DOM until after attributes and properties have been attached.
Resolves #110