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

support innerHTML in compiler for custom elements #49

Closed
thescientist13 opened this issue Jun 5, 2022 · 0 comments · Fixed by #50
Closed

support innerHTML in compiler for custom elements #49

thescientist13 opened this issue Jun 5, 2022 · 0 comments · Fixed by #50
Assignees
Labels
documentation Improvements or additions to documentation feature New feature or request v0.3.0

Comments

@thescientist13
Copy link
Member

thescientist13 commented Jun 5, 2022

Type of Change

  • New Feature Request

Summary

Although I did introduce a lightMode configuration option for escaping the Shadow DOM <template shadowroot="open">, like for more "static" scenarios (e.g. documentation site), I've been thinking more about this implementation detail.

Specifically, I just realized now a better way to support this from userland would be to just let users pick which one works best for them? So if you want to just ship static content, use innerHTML, if it is a more interactive scenario, and say you plan to use hydration, then use Shadow DOM.

Details

This is important because browsers don't render a <template> tag, so anything inside them, like text content, will not be rendered without either using a browser that supports Declarative Shadow DOM, or by adding the polyfill.

This could also help play nicely with global CSS libraries like Tailwinds.

Will need to consider:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation feature New feature or request v0.3.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant