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

Feature/issue 49 inner html #50

Merged
merged 2 commits into from
Jun 10, 2022
Merged

Conversation

thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Jun 5, 2022

Related Issue

resolves #49

Summary of Changes

  1. Added support for Light DOM (innerHTML) vs Shadow DOM (shadowRoot.innerHTML) rendering
  2. Added test case

TODO

  1. Does this remove the need for lightMode config (breaking change)? - deprecate lightMode configuration option #52
  2. Validate template.cloneNode approach for navigation component in test for browser / standards compliance - DOM shim not accurately creating templates (HTMLTemplateElement) #51
  3. documentation (maybe better as an example?) - added to Go Live checklist - Go Live checklist #17

@thescientist13 thescientist13 added documentation Improvements or additions to documentation feature New feature or request question Further information is requested breaking labels Jun 5, 2022
@thescientist13
Copy link
Member Author

thescientist13 commented Jun 5, 2022

Yeah, looks like doing this shouldn't work as we have it now

const template = document.createElement('template');

template.innerHTML = `
  <footer>
    <p>
      <a href="https://projectevergreen.github.io">WCC &#9672 Project Evergreen</a>
    </p>
  </footer>
`;

class Footer extends HTMLElement {
  connectedCallback() {
    this.appendChild(template.content.cloneNode(true));
  }
}

export {
  Footer
};

customElements.define('wcc-footer', Footer);

Since based on a quick test in the browser console, the <template> tags should be included
Screen Shot 2022-06-05 at 2 16 00 PM
Screen Shot 2022-06-05 at 2 22 13 PM

Seems like something to fix in dom-shim.js?

@thescientist13 thescientist13 self-assigned this Jun 5, 2022
@thescientist13 thescientist13 removed the documentation Improvements or additions to documentation label Jun 5, 2022
@thescientist13 thescientist13 removed their assignment Jun 5, 2022
@netlify
Copy link

netlify bot commented Jun 10, 2022

Deploy Preview for merry-caramel-524e61 ready!

Name Link
🔨 Latest commit c02c955
🔍 Latest deploy log https://app.netlify.com/sites/merry-caramel-524e61/deploys/62a32e19c26524000b93c4f1
😎 Deploy Preview https://deploy-preview-50--merry-caramel-524e61.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@thescientist13 thescientist13 merged commit 6e2f0ee into master Jun 10, 2022
@thescientist13 thescientist13 deleted the feature/issue-49-inner-html branch June 10, 2022 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking feature New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support innerHTML in compiler for custom elements
1 participant