Polymer / pwa-helpers

Small helper methods or mixins to help you build web apps.
BSD 3-Clause "New" or "Revised" License
439 stars 48 forks source link

Typings may not be correct when using decorators #57

Closed anoblet closed 5 years ago

anoblet commented 5 years ago

Description Some decorators, In my case 'customElement' from lit-element throw an error when using mixins.

Live Demo https://stackblitz.com/edit/lit-element-hello-world-zepmzz?file=page-one.ts

Steps to Reproduce Add customElement decorator to a class Use the connect mixin Expected Results No error

Actual Results We receive the error:

Type 'typeof MyElement' is not assignable to type 'Constructor'. Type 'MyElement' is missing the following properties from type 'HTMLElement': accessKey, accessKeyLabel, autocapitalize, dir, and 235 more.```

Browsers Affected

Versions

anoblet commented 5 years ago

@justinfagnani

frankiefu commented 5 years ago

The types in connect mixin seems fine. I ran the typescript template of PWA Starter Kit and my-app.ts seems to compile correctly without error.

anoblet commented 5 years ago

Try adding the customElement decorator to a class.

frankiefu commented 5 years ago

Yeah I did this:

@customElement('my-app')
export class MyApp extends connect(store)(LitElement) {
  @property({type: String})
  appTitle = '';

and it complied successfully without error.

anoblet commented 5 years ago

You may be correct, I cannot reproduce the error on Stackblitz. I do get the error locally though with this file: https://gist.github.com/anoblet/8011f72dc8e131c56fb642b04bd68783

frankiefu commented 5 years ago

@anoblet Are you still having issue? If you are can you please provide a simple reproducible test on Stackblitz/Glitch/jsbin so we can take a look?

anoblet commented 5 years ago

Sorry for the delay. I've stopped relying on mixins for the most part. Last time I checked, when I tried to create a repo everything worked so something must have been off on my side.