sveltejs / svelte

Cybernetically enhanced web apps
https://svelte.dev
MIT License
78.36k stars 4.1k forks source link

Svelte 5: Clearer docs on snippet and slots interoperability or lack thereof #13063

Open brunnerh opened 2 weeks ago

brunnerh commented 2 weeks ago

Describe the problem

The preview docs currently state this regarding slots:

They continue to work, however, and you can mix and match snippets and slots in your components.

This is at least a bit misleading, unless the following should not happen:

REPL

Describe the proposed solution

Importance

nice to have

rChaoz commented 2 weeks ago

To me, this looks like you can't "mix and match" at all - there doesn't seem to be even a single combination where mixing and matching snippets and slots works, except for children maybe. Is this supposed to be the case? It feels like all of the cases in the REPL above should work, I say this should be a bug not a documentation issue.

Deprecate along with ? (Maybe that is already supposed to be implicitly the case. If so, that could be more explicit.)

I think they shouldn't be deprecated, at least until passing snippets to props is supported, otherwise it's impossible to use Svelte 4 components from Svelte 5 code without deprecation warnings.

brunnerh commented 2 weeks ago

I'm not suggesting to add a deprecation warning on fragments, you also don't get one on slots (which would be bad since they still need to be used if they are not fully interoperable with snippets).