3 ms·
Apparently not widely know, but… > Svelte components can also be compiled to custom elements (aka web components) using the customElement: true compiler option
by ttfkam 3y ago
Apparently not widely know, but…
> Svelte components can also be compiled to custom elements (aka web components) using the customElement: true compiler option.
https://svelte.dev/docs/custom-elements-api https://svelte.dev/docs/custom-elements-api
This would negate the "vendor lock-in" arguments and allow Svelte for component development but web component for consumption and use. Best of both worlds. All the DX advantages of Svelte over web components without sacrificing interoperability.
- nathansherburn 3y agoAny examples of the web component code they spit out?
- pabc1 3y agoI believe some people generally avoid Svelte for custom elements since Rich (and other maintainers) have consistently shown criticism towards Web Components in general.