pngwn / svelte-adapter

Use Svelte components with Vue and React
300 stars 11 forks source link

Slot support? #13

Open kuechlerm opened 3 years ago

kuechlerm commented 3 years ago

Hi there, thank you for the adapter - helped a lot so far. Do you see any chance to add slot-support?

jackiems82 commented 3 years ago

We are also using and loving this adapter. A support for slots would be very beneficial as we are currently not able to move our complete application to svelte. @pngwn Do you know if this is possible with an adaption to this adapter or would there be a major rewrite needed? I guess you have no plan to support this in the near future given what you wrote in the bottom of the Readme?

pngwn commented 3 years ago

I'd love to add this, but it isn't really possible until Svelte allows slots to be set programmatically. There are some workarounds but they are either unreliable or rely on private APIs that are likely to change.

This is the relevant issue. If / when this feature is added to Svelte I'll happily add this feature. I'll raise this issue internally to see what the other maintainers think.

In the meantime I'll take a look at the best workaround and see how stable it would be if I made use of it.

jackiems82 commented 3 years ago

That sounds great. I will try to see and monitor the Task and leave feedback there as well.

Valexr commented 2 years ago

Any progress on this feature?

bfanger commented 2 years ago

I've implemented slots in my alternative interop solution: svelte-preprocess-react

Curious if my implementation uses an unreliable workaround.

pngwn commented 2 years ago

@bfanger It does yes. That isn't an official API and is not versioned. It could break at any moment without warning and there is nothing you or your users could do about it. Those APIs actually have changed quite a bit over time without anything other than patch bumps, I expect them to change again in the future.

I'm not willing to add support for features if the only way to add that support could (and probably will) lead to breakages within minor semver ranges.

That said, an official slot API is something we are willing to add to svelte, I just haven't gotten around to writing a proposal for it yet. I should do that.