Replace import {PolymerElement} from ‘//resources/polymer/v3_0/polymer/polymer_bundled.min.js’; with import {CrLitElement} from ‘//resources/lit/v3_0/lit.rollup.js’;
Automation does not handle cases where PolymerElement is imported along with other stuff in the same import.
Replace import {getTemplate} from ‘./cr_drawer.html.js’; with import {getCss} from ‘./cr_drawer.css.js’; import {getHtml} from ‘./cr_drawer.html.js’;
Replace static get template() { return getTemplate(); } with static override get styles() { return getCss(); }
override render() { return getHtml.bind(this)(); }
Replace “extends PolymerElement” with “extends CrLitElement”
Automation does not cover cases where Mixins are used.
Replace override ready() { super.ready(); ... } with override firstUpdated() { ... }
Replace static get properties() {...} with static override get properties() {...}
Replace ‘reflectToAttribute’ with ‘reflect’
Replace Polymer shorthand syntax heading: String, with heading: {type: String},
Comment out observers and add a TODO Replace observer: ‘onFooChanged_’, with // TODO: Port this observer to Lit // observer: ‘onFooChanged_’,
Move value initialization out of ‘properties’ to the declaration. Replace foo: { type: String, value: ‘foo’, }, ... value: string; with foo: { type: String, }, ... value: string = ‘foo’;
Equiavelent vim command s/on-([a-zA-Z]+)=“([a-zA-Z_]+)/@\1=”${this.\2}/g
Replace [[...]] with ${this...}