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

Option to retain wrapping HTML Element #5

Open
bedeoverend opened this issue Jun 29, 2017 · 0 comments
Open

Option to retain wrapping HTML Element #5

bedeoverend opened this issue Jun 29, 2017 · 0 comments

Comments

@bedeoverend
Copy link

It'd be great if there could be a flag while rendering these components which would cause the rendered preact output to be placed inside the element, rather than replace the element.

e.g.

<my-component foo='bar' />

would become:

<my-component>
  <p>the value of foo is "bar"</p>
</my-component>

this would mean the HTML author could treat the entire HTML as 'real' and target the wrapper DOM element with CSS / JS etc. without having to think about it potentially disappearing. It also means its just slightly less 'magical' IMO.

Another benefit (potentially out of scope) would mean that if someone wanted to then use real Custom Elements client side, they could import it on the client and the HTML would get automatically upgraded. This however I'm a bit unsure about, as you'd likely want an easy way of duplicating the Preact functionality in the Custom Element definition, which I'm unsure how to go about.

Thoughts?

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

No branches or pull requests

1 participant