diff --git a/.changeset/good-wolves-remain.md b/.changeset/good-wolves-remain.md new file mode 100644 index 000000000..05274b213 --- /dev/null +++ b/.changeset/good-wolves-remain.md @@ -0,0 +1,6 @@ +--- +'@astrojs/lit': minor +'astro': patch +--- + +Implement client:only functionality in Lit and add lit to the client:only warning diff --git a/packages/astro/e2e/fixtures/lit-component/src/components/ClientOnlyComponent.js b/packages/astro/e2e/fixtures/lit-component/src/components/ClientOnlyComponent.js new file mode 100644 index 000000000..0fd16b50a --- /dev/null +++ b/packages/astro/e2e/fixtures/lit-component/src/components/ClientOnlyComponent.js @@ -0,0 +1,9 @@ +import { LitElement, html } from 'lit'; + +export default class ClientOnlyComponent extends LitElement { + render() { + return html` Shadow dom default content should not be visible`; + } +} + +customElements.define('client-only-component', ClientOnlyComponent); diff --git a/packages/astro/e2e/fixtures/lit-component/src/pages/index.astro b/packages/astro/e2e/fixtures/lit-component/src/pages/index.astro index f15e832dc..43eb17a4e 100644 --- a/packages/astro/e2e/fixtures/lit-component/src/pages/index.astro +++ b/packages/astro/e2e/fixtures/lit-component/src/pages/index.astro @@ -1,6 +1,7 @@ --- import MyCounter from '../components/Counter.js'; import NonDeferredCounter from '../components/NonDeferredCounter.js'; +import ClientOnlyComponent from '../components/ClientOnlyComponent.js'; const someProps = { count: 10, @@ -26,5 +27,12 @@ const someProps = { Hello, client:visible! + + + Framework + client:only + component + Should not be visible +