feat: make internal Svelte Custom Element treeshakable

pull/16075/head
Justinas Delinda 4 months ago
parent 2342c8719a
commit 802afc6b7b

@ -0,0 +1,5 @@
---
'svelte': patch
---
Make internal Svelte Custom Element treeshakable

@ -10,11 +10,12 @@ import { define_property, get_descriptor, object_keys } from '../../../shared/ut
* @property {'String'|'Boolean'|'Number'|'Array'|'Object'} [type] * @property {'String'|'Boolean'|'Number'|'Array'|'Object'} [type]
*/ */
/** @type {any} */ function get_svelte_element_class() {
let SvelteElement; if (typeof HTMLElement !== 'function') {
return;
}
if (typeof HTMLElement === 'function') { return class extends HTMLElement {
SvelteElement = class extends HTMLElement {
/** The Svelte component constructor */ /** The Svelte component constructor */
$$ctor; $$ctor;
/** Slots */ /** Slots */
@ -219,6 +220,9 @@ if (typeof HTMLElement === 'function') {
}; };
} }
/** @type {any} */
const SvelteElement = /* @__PURE__ */ get_svelte_element_class();
/** /**
* @param {string} prop * @param {string} prop
* @param {any} value * @param {any} value

Loading…
Cancel
Save