Buslowicz / twc

TypeScript based, boilerplate-less, Polymer toolbox friendly Polymer Modules
32 stars 1 forks source link

Create PolymerTS compatible annotations #60

Closed Buslowicz closed 7 years ago

Buslowicz commented 7 years ago

Create set of annotations to map PolymerTS decorators. Properties not annoted as @property should not be registered within properties object.

tpluscode commented 7 years ago

Would this be the default or opt-in?

Buslowicz commented 7 years ago

It will be imported just like now, but instead of twc/annotations/polymer it will be something like twc/annotations/polymerts.

tpluscode commented 7 years ago

Properties not annoted as @property should not be registered within properties object.

I'm concerned about this sentence. What would be the output of:

import { property } from 'twc/annotations/polymerts';
import { notify } from 'twc/annotations/polymer';

export class MyElement {

  @property({ notify: true });
  polymerTsProp: Object;

  @notify
  oldSchoolProp: Number;
}

Would the oldSchoolProp appear in the output or not?

Buslowicz commented 7 years ago

All the decorators will be fetched from either polymer or polymerts annotations set. Fetching polymerts will automatically disable property auto registration so it works pretty much like PolymerTS. It will not, however, change how current twc annotations work.