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

document an example of using Declarative Shadow DOM by setting shadowRoot.innerHTML #181

Closed
thescientist13 opened this issue Dec 5, 2024 · 0 comments · Fixed by #185
Closed
Assignees
Labels
0.16.0 documentation Improvements or additions to documentation
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented Dec 5, 2024

Type of Change

Documentation

Summary

As part of the discussions / patterns being discussed #177 , one thing that seemed valuable now was making it so that users can do this without having to manually insert a <template> tag

// before
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
   <template shadowrootmode="open">
     <header>
       <h1>Welcome to my site!</h1>
     </header>
   </template>
`;
// after
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
   <header>
     <h1>Welcome to my site!</h1>
   </header>
`;

Details

So somewhere we should

  1. compliment our examples that use this.shadowRoot.appendChild(template.content.cloneNode(true)); with shadowRoot.innerHTML
  2. I think this example was meant to demonstrate innerHTML (no shadow root) - https://merry-caramel-524e61.netlify.app/examples/#server-rendering-ssr
@thescientist13 thescientist13 added documentation Improvements or additions to documentation 0.16.0 labels Dec 5, 2024
@thescientist13 thescientist13 added this to the 1.0 milestone Dec 5, 2024
@thescientist13 thescientist13 self-assigned this Dec 5, 2024
@thescientist13 thescientist13 moved this from 🔖 Ready to 🏗 In progress in [WCC] General Activities Jan 20, 2025
@thescientist13 thescientist13 moved this from 🏗 In progress to 👀 In review in [WCC] General Activities Jan 20, 2025
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in [WCC] General Activities Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.16.0 documentation Improvements or additions to documentation
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant