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

Migration guide || equivalents of inserted/...? #206

Open
Janiczek opened this issue Jul 29, 2019 · 1 comment
Open

Migration guide || equivalents of inserted/...? #206

Janiczek opened this issue Jul 29, 2019 · 1 comment

Comments

@Janiczek
Copy link

Janiczek commented Jul 29, 2019

Hello!
We're being nudged by Chrome warnings to stop using 1.5.11 and go for something newer:

[Deprecation] document.registerElement is deprecated and will be removed in M73, around March 2019. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 for more details.

When trying to migrate our v1 components to v2, we hit a roadblock: how to represent the inserted and removed lifecycle hooks? They don't seem to have support in v2.
(Whatever answer will this have, it would be nice to write it in the actual docs.)

@janjelinek
Copy link

For future Us:
X-tag v2 is using native callbacks for WebComponents

it means you can simply do something like

xtag.create('x-frank', class extends XTagElement {
  connectedCallback() { 
    //replacemend for inserted hook
  }
  disconnectedCallback() {
    //replacement for removed hook
  }
});

It's not much clear from X-tag V2 docs.

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

2 participants