Skip to content

slot/snippet and custom elements broken/usage unclear #15882

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

Open
mspae opened this issue May 8, 2025 · 0 comments
Open

slot/snippet and custom elements broken/usage unclear #15882

mspae opened this issue May 8, 2025 · 0 comments

Comments

@mspae
Copy link

mspae commented May 8, 2025

Describe the bug

The usage of snippets (and slots) within custom elements is not clear from the documentation. The resulting order of DOM nodes is different between using a svelte component "normally" and as a custom element. I'm assuming this is unavoidable and due to the special nature of custom elements. However, the corresponding caveats for using slots/snippets within custom elements (assuming there some footguns lying around) are not documented on this page so I'm at a loss how to mitigate this issue.

I think this is probably the same issue as #12892 - the resolution of that issue ("use slots") is not clear to me. I'm probably missing something.

Reproduction

https://svelte.dev/playground/87c914a892664f7990bae0fa38290278?version=5.28.2

(Same thing using the @render syntax https://svelte.dev/playground/d9ae949baaea4276a6bd6edcdb03a451?version=5.28.2)

Logs

System Info

System:
    OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (4) x64 Intel Core Processor (Skylake, IBRS)
    Memory: 7.04 GB / 7.75 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 20.19.1 - /usr/bin/node
    npm: 10.8.2 - /usr/bin/npm

Severity

blocking all usage of svelte

@mspae mspae changed the title Svelte 5, slot/snippet and custom elements broken/usage not documented enough slot/snippet and custom elements broken/usage not documented enough May 8, 2025
@mspae mspae changed the title slot/snippet and custom elements broken/usage not documented enough slot/snippet and custom elements broken/usage unclear May 8, 2025
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