Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

devpaul
Copy link

@devpaul devpaul commented Aug 22, 2017

Added support for custom elements by delaying their attachment to the DOM until after attributes and properties have been attached.

Resolves #110

@devpaul devpaul closed this Aug 22, 2017
@devpaul devpaul reopened this Aug 22, 2017
} else {
parentNode.appendChild(domNode);
}
insertNode(parentNode, domNode, vnode, insertBefore);
} else {
for (i = 0; i <= vnodeSelector.length; ++i) {
c = vnodeSelector.charAt(i);
Copy link
Contributor

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

@johan-gorter
Copy link
Contributor

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 '-'

@johan-gorter
Copy link
Contributor

@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.

@devpaul
Copy link
Author

devpaul commented Sep 6, 2017

@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.

@RickHoving
Copy link
Contributor

@devpaul we are adressing this issue in maquette 3.0 and would like your oppinion on this subject. See #118

@RickHoving RickHoving closed this Sep 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants