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

HydrateElement base class prototyping #29

Open
13 tasks
thescientist13 opened this issue May 19, 2022 · 0 comments
Open
13 tasks

HydrateElement base class prototyping #29

thescientist13 opened this issue May 19, 2022 · 0 comments
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented May 19, 2022

Type of Change

  • Other

Summary

Initially started in ProjectEvergreen/greenwood#548, but wcc may provide a nice sandbox for something testing something like this out.

Latest prototype looks something like this

// https://web.dev/declarative-shadow-dom/#hydration
class HydrateElement extends HTMLElement {
  // attach the shadow
  connectedCallback() {
    if (!this.shadowRoot) {
      this.attachShadow({ mode: 'open' });
      this.shadowRoot.appendChild(template.content.cloneNode(true));
    }
  }
}

/*
<style>
  x-foo:not(:defined) > * {
    display: none;
  }
</style>
*/

export { HydrateElement };

Details

Some other ideas / feature that have come up while working on wcc that are worth tracking as part of this

@thescientist13 thescientist13 added feature New feature or request question Further information is requested labels May 19, 2022
@thescientist13 thescientist13 added this to the 1.0 milestone May 19, 2022
@thescientist13 thescientist13 changed the title HydrateElement prototyping HydrateElement base class prototyping May 19, 2022
@thescientist13 thescientist13 added expirement and removed question Further information is requested feature New feature or request labels May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant