twc icon indicating copy to clipboard operation
twc copied to clipboard

two preserves imported interfaces (and should not)

Open tpluscode opened this issue 7 years ago • 0 comments

I have code similar to this

import {IHydraResource} from 'alcaeus/types/Resources';

@CustomElement()
export class AugeanConsole extends Polymer.Element {

    model: IHydraResource = null;
}

The interface has no meaning in JavaScript and with twc 0.4.6 it was replaced with object.

In twc 0.5.5 however the interface makes its way through to JS code and breaks at runtime (targeting Polymer 2.0).

class AugeanConsole extends Polymer.Element {
  static get is() {
    return "augean-console";
  }
  static get properties() {
    return {
      model: {
        type: IHydraResource,
        value: null
      }
    }
  }
}

tpluscode avatar Jul 31 '18 15:07 tpluscode