lit-element
lit-element copied to clipboard
Forward Compatibility With Lit 2 misleading
The readme states that you can import decorators in lit-element v2.5.1 the same way as in lit v.2.0.0:
Forward Compatibility With Lit 2
Lit 2 (LitElement 3.0) has a few breaking changes and deprecations that have been back-ported to LitElement 2.5 in order to ease upgrading. To prepare for Lit 2, update these APIs:
LitElement 2.4 LitElement 2.5/Lit 2 Decorator imports: import {customElement} from 'lit-element';
import {customElement} from 'lit-element/decorators.js';
... ...
However importing decorators with lit-element v2.5.1 only works using:
import {customElement} from 'lit-element';
or
import {customElement} from 'lit-element/src/decorators.js';
Oops, good catch. I wonder if it's worth adding lit-element/decorators.js
to a 2.5.2 release at this point.
This was fixed in https://github.com/lit/lit-element/pull/1171, but that change failed to add decorators.js
to package.json
's files
, so it was not published in 2.5.1.