-
Notifications
You must be signed in to change notification settings - Fork 2k
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
TypeScript compilation error of attributeChangedCallback for Polymer.Element #5087
Comments
Hm it is defined in the polymer/types/lib/mixins/properties-changed.d.ts Lines 216 to 224 in 82cd3da
Polymer.Element via
I am not sure why this chain does not end up in your project. We probably have to update our own types to figure out where it is missing out on this property. |
Yeah, I could find the constructor chain in my local directory also. And other callbacks such as |
Actually, all methods defined in |
I see what's going on. The mixin declarations we generate are defined as a function that returns a constructor for 1) the passed base class 2) that mixin's interface and 3) additional mixins that get automatically applied as picked up by analyzer using the The problem is that those mixins from 3) that are applied transitively are not automatically lifted up. So unless the In the
Which means Options:
|
I definitely think we should not do option 1, and should do either option 2 or 3. I suspect that option 3 is the better one, because it seems like it might be better able to handle stuff like |
3 sounds good to me. The analyzer returns sufficient information - it could certainly flatten as a convenience, but it's not necessary. |
…vely. Previously, only the immediately applied mixins were accounted for, but not ones that were applied transitively. Fixes Polymer/polymer#5087
…vely. (#91) Previously, only the immediately applied mixins were accounted for, but not ones that were applied transitively. Fixes Polymer/polymer#5087
Description
I created my Polymer element as following with TypeScript:
And I added a callback method to be notified the attribute changes:
But
tsc
compiler raised an error as following:If my understanding about the Polymer elements' lifecycle is correct, a callback method in
super
instance must be called to handle lifecycle hooks properly. Buttsc
raises an error for it.https://www.polymer-project.org/2.0/docs/devguide/custom-elements
Live Demo
https://github.com/rhysd/typescript-polymer-bug
Steps to Reproduce
$ git clone https://github.com/rhysd/typescript-polymer-bug.git
$ cd typescript-polymer-bug
$ npm start
Expected Results
Compilation is successfully done
Actual Results
Compilation error:
Browsers Affected
Versions
The text was updated successfully, but these errors were encountered: