summaryrefslogtreecommitdiff
path: root/packages/integrations/lit/server-shim.js
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@skypack.dev> 2022-06-21 08:32:05 -0400
committerGravatar GitHub <noreply@github.com> 2022-06-21 08:32:05 -0400
commitf5afaf24984ee7d4d6e908a7eeed17f5ca18c61e (patch)
tree68cb423edc44774f6ffecd2e860c41439c653756 /packages/integrations/lit/server-shim.js
parent411af7ae4b0435d740a25fd645380e5bd3949d3a (diff)
downloadastro-f5afaf24984ee7d4d6e908a7eeed17f5ca18c61e.tar.gz
astro-f5afaf24984ee7d4d6e908a7eeed17f5ca18c61e.tar.zst
astro-f5afaf24984ee7d4d6e908a7eeed17f5ca18c61e.zip
Support re-exporting astro components containing client components (#3625)
* Support re-exporting astro components containing client components * Include metadata for markdown too * Fix ssr, probably * Inject post-build * Remove tagName custom element test * Allows using the constructor for lit elements * Fix hoisted script scanning * Pass through plugin context * Get edge functions working in the edge tests * Fix types for the edge function integration * Upgrade the compiler * Upgrade compiler version * Better release notes for lit * Update .changeset/unlucky-hairs-camp.md Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> * Properly test that the draft was not rendered * Prevent from rendering draft posts * Add a changeset about the build perf improvement. Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Diffstat (limited to 'packages/integrations/lit/server-shim.js')
-rw-r--r--packages/integrations/lit/server-shim.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/integrations/lit/server-shim.js b/packages/integrations/lit/server-shim.js
index 0c1fde383..e4d123c37 100644
--- a/packages/integrations/lit/server-shim.js
+++ b/packages/integrations/lit/server-shim.js
@@ -5,3 +5,9 @@ window.global = window;
document.getElementsByTagName = () => [];
// See https://github.com/lit/lit/issues/2393
document.currentScript = null;
+
+const ceDefine = customElements.define;
+customElements.define = function(tagName, Ctr) {
+ Ctr[Symbol.for('tagName')] = tagName;
+ return ceDefine.call(this, tagName, Ctr);
+}