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

EmitChangesDirective should use __classProperties #50

Closed
hotforfeature opened this issue Jul 28, 2017 · 0 comments
Closed

EmitChangesDirective should use __classProperties #50

hotforfeature opened this issue Jul 28, 2017 · 0 comments
Assignees
Labels

Comments

@hotforfeature
Copy link
Owner

EmitChangesDirective uses some weirdness to get all properties and behavior properties for an element. Some digging revealed that Polymer actually creates a flattened __classProperties object that contains all the properties going up the chain.

I think the current method is working for hybrid elements, but will fail in this scenario with mixins:

MyMixin = Polymer.dedupingMixin(base => {
  return class MyMixin extends base {
    static get properties() {
      return {
        totallyLegal: {
          type: Boolean,
          value: true,
          reflectToAttribute: true
        };
      };
    }
  }
});

class MyElement extends MyMixin(Polymer.Element) {
  static get properties() {
    return {
      ownProp: {
        type: Boolean,
        value: true,
        reflectToAttribute: true
      }
    };
  }
  
  connectedCallback() {
    console.log(this.ownProp); // true
    console.log(this.totallyLegal); // true
  }
}

I don't think Origami will pick up on the totallyLegal, which is totally wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant