Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web Components Embedding Mode #11430

Open
ixxie opened this issue Dec 21, 2023 · 0 comments
Open

Web Components Embedding Mode #11430

ixxie opened this issue Dec 21, 2023 · 0 comments

Comments

@ixxie
Copy link

ixxie commented Dec 21, 2023

Describe the problem

The unfortunate reality is that sometimes I need to do work in non-SvelteKit environments, e.g. WordPress. Ideally, I would like to get the benefits of Svelte and SvelteKit, but be able to deploy to such distasteful environments without mucking about with them too much.

Describe the proposed solution

What if SvelteKit's adapter API had a web component based embedding mode?

There are several ways this could work, but here is one idea:

  • The SvelteKit app still gets deployed with usual adapters (e.g. Vercel, Netlify, Node, etc)
  • However, the app is modified to act as a backend for deploying web components elsewhere
  • +page.svelte routes get compiled to web components
  • The web components may be served through an automatically generated endpoint, or packaged using svelte-package
  • +page.js/ts load mechanisms still work, but are compiled to endpoints why serve the corresponding web components with data.
  • An automatically generated docs page is served, providing snippets for CORS config, and - eventually perhaps - web component usage snippets.

There would obviously be some limitations, e.g. SSR is excluded in this mode; I am not familiar enough with the nuances of SvelteKit to know what they would be.

Alternatives considered

Setting this up manually, probably with a monorepo including one package for the web components, and another for the backend.

Importance

would make my life easier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant