Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/warm-jokes-perform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

Make internal Svelte Custom Element treeshakable
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import { define_property, get_descriptor, object_keys } from '../../../shared/ut
* @property {'String'|'Boolean'|'Number'|'Array'|'Object'} [type]
*/

/** @type {any} */
let SvelteElement;
function get_svelte_element_class() {
if (typeof HTMLElement !== 'function') {
return;
}

if (typeof HTMLElement === 'function') {
SvelteElement = class extends HTMLElement {
return class extends HTMLElement {
/** The Svelte component constructor */
$$ctor;
/** Slots */
Expand Down Expand Up @@ -219,6 +220,9 @@ if (typeof HTMLElement === 'function') {
};
}

/** @type {any} */
const SvelteElement = /* @__PURE__ */ get_svelte_element_class();

/**
* @param {string} prop
* @param {any} value
Expand Down