Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the lit-element package instead of @polymer/lit-element #324

Open
justinfagnani opened this issue Jan 27, 2020 · 2 comments
Open

Use the lit-element package instead of @polymer/lit-element #324

justinfagnani opened this issue Jan 27, 2020 · 2 comments

Comments

@justinfagnani
Copy link

justinfagnani commented Jan 27, 2020

Before the release of LitElement 1.0 we switched the package name from @polymer/lit-element to just lit-element. @polymer/lit-element is very, very old and unmaintained. lit-element has the current API and many bug and performance improvements.

@lemoustachiste
Copy link
Member

Hi @justinfagnani and thank you for reaching out and letting us know.

Unfortunately we are stuck on the version of lit-element that is used. Indeed at the time we wrote the component, the lit-element was working in a certain way with redux (as per docs and examples) and we followed that and more. The version next version of the package we use actually breaks everything in the component and we haven't had, and probably won't have in the foreseeable future, time to refactor (rewrite?) everything.

@justinfagnani
Copy link
Author

justinfagnani commented Jan 28, 2020

For Redux, I think the main thing you need to do is change this._requestUpdate() to this.requestUpdate() here:

this._requestRender();

The basic mechanics of the LitElement lifecycle didn't change much, just some of the API names. _render() is now render(). Uses of _propertiesChanged could be changed to update() or updated(), but I think you should just be able to get rid of the this._props pattern completely, and instead of doing things like this._props.onClose() just do this.onClose() instead. The props passed to _propertiesChanged() are all instance properties, you really shouldn't need that bag separately.

The last time @polymer/lit-element was released was a year ago. It's quite behind at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants