lit / lit-element

LEGACY REPO. This repository is for maintenance of the legacy LitElement library. The LitElement base class is now part of the Lit library, which is developed in the lit monorepo.
https://lit-element.polymer-project.org
BSD 3-Clause "New" or "Revised" License
4.49k stars 319 forks source link

Forward Compatibility With Lit 2 misleading #1213

Closed FelixSchuSi closed 1 year ago

FelixSchuSi commented 2 years ago

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';

justinfagnani commented 2 years ago

Oops, good catch. I wonder if it's worth adding lit-element/decorators.js to a 2.5.2 release at this point.

kevinpschaaf commented 1 year ago

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.