-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Web-components: Support lit 2 with back-compat #14898
Conversation
Nx Cloud ReportCI ran the following commands for commit 10e1fab. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch
Sent with 💌 from NxCloud. |
@gaetanmaisse @brion-fuller can explain more fully, but the rough goals of the
The rationale behind the rename is to make the lit connection more explicit. Just like you can use |
@shilman Is there any way we could merge this for the time being, until |
@anoblet we're meeting with @Westbrook @daKmoR etc on thursday to figure out a path forward on this |
… (related to export map?)
…project with `lit` as dep
This SB generator is used in 3 cases and for each `lit-html` is already there so no need to reinstall it: - User's project has `lit-html` as dep -> ok nothing to do - User's project has `lit-element` as dep -> ok as `lit-html` is a dep of `lit-element` - User's project has `lit` as dep -> ok as `lit-html` is a dep of `lit-element` Note: SB WC will not work out of the box with Yarn in PnP mode as SB is doing import from `lit-html` directly. For now the recommended work around is to add `lit-html` as dep to satisfy SB WC peer dependency. We will be able to simplify/fix that easily when `lit-*` will be deprecated in favor of `lit`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 LGTM
@shilman I updated a bit the e2e tests to have both lit 1 + 2, it also means we have a repro config for Lit 2. Before any public announcement, I would like to make more test with both Lit 1 + Lit 2 based projects (and try to migrate my company project 😉 ).
Note: SB WC + Lit 2 will not work out of the box with Yarn in PnP mode as SB is doing imports from lit-html
directly. For now, the recommended workaround is to add lit-html
as dep to satisfy SB WC peer dependency. We will be able to simplify/fix that easily when lit-*
will be deprecated in favour of lit
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great @Westbrook @gaetanmaisse 💯
Note: Depending on the package manager used and the dependency hoisting it can be necessary to add |
Issue: refs #13489
What I did
Use split versions of
lit-html
andlit-element
pointing to the pre-[email protected]
versions that support theisTemplateResult()
helper.I checked out the
@storybook/lit
build, and I'm not sure what it's over all goals are, but having it separate seems like a weird play in the context of the x-compatibility story of web components, but happy to revisit if not.How to test
@storybook/web-components
examples.@storybook/web-components
examples.If your answer is yes to any of these, please make sure to include it in your PR.