From 26bf12ef3c7ab874a23ac753f841f7bb329c9361 Mon Sep 17 00:00:00 2001 From: Reece McDonald <39349270+hrmcdonald@users.noreply.github.com> Date: Fri, 24 Feb 2023 12:10:56 -0600 Subject: [PATCH] [Lit] render DSD attributes based on `shadowRootOptions` (#6351) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Lit] render DSD attributes based on `shadowRootOptions` ## Changes - Update `@astrojs/lit`’s `server.js` to properly render elements with `delegatesFocus: false` set in their `shadowRootOptions`. - Logic is based on `@lit-labs/ssr` [latest implementation as found here](https://github.com/lit/lit/blob/b0c3f82ef0f97326a205e77e7e1043b75a5cc53f/packages/labs/ssr/src/lib/render-value.ts#L738) ## Testing A test was added to ensure an element with `delegatesFocus` set to true has this attribute properly included in the rendered static markup. * chore: add changeset --- .changeset/old-fireants-allow.md | 5 +++++ packages/integrations/lit/server.js | 6 +++++- packages/integrations/lit/test/server.test.js | 11 +++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .changeset/old-fireants-allow.md diff --git a/.changeset/old-fireants-allow.md b/.changeset/old-fireants-allow.md new file mode 100644 index 000000000..4857a7a7c --- /dev/null +++ b/.changeset/old-fireants-allow.md @@ -0,0 +1,5 @@ +--- +'@astrojs/lit': patch +--- + +Render DSD attributes based on `shadowRootOptions` diff --git a/packages/integrations/lit/server.js b/packages/integrations/lit/server.js index da571466f..aa91d1ea8 100644 --- a/packages/integrations/lit/server.js +++ b/packages/integrations/lit/server.js @@ -62,7 +62,11 @@ function* render(Component, attrs, slots) { yield `>`; const shadowContents = instance.renderShadow({}); if (shadowContents !== undefined) { - yield '