Skip to content

Is it - or will it - be possible to have multiple versions of Lit in the same application? #3646

Answered by justinfagnani
andberg asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you can multiple versions of Lit, and with Lit 2 (lit-html 2.x and lit-element 3.x) onward, we even have very good compatibility across versions - you can use a template from one version in a render method of another.

Lit is just a library, so it uses no globals. And each component is its own independent render root, so there's no central coordinator. Essentially each component brings along the version of Lit it needs and the module cache takes care of deduplication.

If you're upgrading from LitElement 2 / lit-html 1, then there can be some issues where the templates from one version will not render in the other. Components are still independent though, so if you upgrade a component …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@andberg
Comment options

Answer selected by andberg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants