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

Polymer decorators don't work well with the polyfill #46

Open
danielvanmil opened this issue Jan 18, 2021 · 2 comments
Open

Polymer decorators don't work well with the polyfill #46

danielvanmil opened this issue Jan 18, 2021 · 2 comments
Assignees

Comments

@danielvanmil
Copy link

danielvanmil commented Jan 18, 2021

To reproduce:

  • Implement a Polymer 3 element with Polymer decorators and a computed property, like:
class X extends PolymerElement {
    @decorators.property({ notify: true, reflectToAttribute: true, computed: "getP1()", type: String })
    p1: string = null;

    getP1(): string {
        return 'second string';
    }

static get template(): HTMLTemplateElement {
        return html`p1: [[p1]]`;
}

The computed property is not computed with the polyfill, without it is.

Any idea?

@vegarringdal
Copy link
Owner

Never used polymer 3.
Any reason why you dont use lit-element or something newer?
Noticed this:

image

But basically Ive noticed some issues with some libs if they do to much fancy stuff.
Added some points under readme under Limitations I know about atm.
Might be the issue I have with observeredAttributes,, some libs do not like what this library here. I need add a option to skip this part.

Do you have more complete sample btw, like :

  • install npm install polymer
  • add this element to dom
  • copy this file and run.

then I might get a chance to have a quick look later this week.

@vegarringdal vegarringdal self-assigned this Jan 18, 2021
@danielvanmil
Copy link
Author

Any reason why you dont use lit-element or something newer?

We use both, we are in a transition phase.

I will create a test project!

Thanks

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