PolymerElements / paper-input

A Material Design text field
https://www.webcomponents.org/element/PolymerElements/paper-input
130 stars 162 forks source link

TypeScript error with iron-form-element-behavior 2.1.2 #645

Closed qqilihq closed 6 years ago

qqilihq commented 6 years ago

This recent update in iron-form-element-behavior breaks the TypeScript compilation:

The value property was changed from …

value: string|null|undefined;

… to …

value: string|number|null|undefined;

Which produces the following error:

error TS2320: Interface 'PaperInputElement' cannot simultaneously extend types 'PaperInputBehavior' and 'IronFormElementBehavior'.
  Named property 'value' of types 'PaperInputBehavior' and 'IronFormElementBehavior' are not identical.

Fix should be as easy as updating the corresponding definition in paper-input accordingly. However, I'm not sure whether the dependency version here should be adjusted as well? Strictly speaking, this looks like a breaking change from a TS perspective to me.

notwaldorf commented 6 years ago

cc @TimvdLippe who did the change and @aomarks who speaks TS

TimvdLippe commented 6 years ago

Ah that is unfortunate, this was not intended as a breaking change. I will likely need to update all usages of IronFormElementBehavior to fix it. Will work on it asap.

On Thu, 5 Apr 2018, 01:05 Monica Dinculescu, notifications@github.com wrote:

cc @TimvdLippe https://github.com/TimvdLippe who did the change and @aomarks https://github.com/aomarks who speaks TS

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PolymerElements/paper-input/issues/645#issuecomment-378772458, or mute the thread https://github.com/notifications/unsubscribe-auth/AFrDb-XizB2kjdm_X-n9rZqsqQoImHJpks5tlVHHgaJpZM4THoAt .

floribon commented 6 years ago

This break also affected our team, thanks @qqilihq for finding the root cause and Polymer team for looking into it.

My current workaround is to force install the previous version in my bower.json:

"iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#2.1.1"

ahmadhsalim commented 6 years ago

for me I had to rollback app-layout to previous version as well "app-layout": "PolymerElements/app-layout#2.0.5"

TimvdLippe commented 6 years ago

@ahmadhsalim Hm I am not sure how that would work out, as that element has no dependency on the behavior? https://github.com/PolymerElements/app-layout/blob/master/bower.json

TvrtkoM commented 6 years ago

Out of curiosity - when is this fix going to be released? I have the same issue with paper-input@2.2.2 which is installed with npm