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

Slot Support #52

Open
dev-guy opened this issue Jun 1, 2023 · 3 comments
Open

Slot Support #52

dev-guy opened this issue Jun 1, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@dev-guy
Copy link

dev-guy commented Jun 1, 2023

Slots are not supported by LiveSvelte because of issues in Svelte itself. I don't have the issue number but once it's resolved, this usage can be officially supported.

A working named slot example is in the following files. Timeline.svelte optionally accepts a slot named 'toast.' Other use cases might not work.

Note: The Svelte way to specify slot content is something like < span slot='slot_name'> . This doesn't work in Heex templates. Use the Phoenix <: slot_name> way instead.

Another downside is that Elixir warns when compiling:

warning: undefined slot "toast" for component LiveSvelte.svelte/1
  lib/kantan_web/controllers/page_html/timeline.html.heex:6
  1. https://github.com/dev-guy/phoenix-ash-svelte-flowbite/blob/main/lib/kantan_web/controllers/page_html/timeline.html.heex

  2. https://github.com/dev-guy/phoenix-ash-svelte-flowbite/blob/main/assets/svelte/Timeline.svelte

@woutdp
Copy link
Owner

woutdp commented Jun 1, 2023

This is the ticket that should help with this: sveltejs/svelte#2588

@woutdp woutdp added the enhancement New feature or request label Jun 10, 2023
@dev-guy dev-guy closed this as not planned Won't fix, can't repro, duplicate, stale Jun 16, 2024
@liorix
Copy link

liorix commented Sep 23, 2024

It looks like svelte just fixed the relevant issue for slots to work?

sveltejs/svelte#2588

@woutdp
Copy link
Owner

woutdp commented Sep 23, 2024

Yes looks like it, but still needs to check how it will work in practice. Also relies on Svelte 5 which I want to wait until it's officially released.

@woutdp woutdp reopened this Sep 23, 2024
@woutdp woutdp mentioned this issue Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants