-
-
Notifications
You must be signed in to change notification settings - Fork 181
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
feat: improve support for svelte #550
Conversation
🦋 Changeset detectedLatest commit: 8817f9c The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR 💥 An error occurred when fetching the changed packages and changesets in this PR
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Geneally speaking, it's a good idea to have Svelte in there. It's SSR I'm mostly concerned with here, I understand that i can be achieved with actions but they don't work in SSR. I think Zak might have some solutions for Svelte SSR already. Please reach out to him |
We could use the actions only for event handlers and spread the remaining props like normally. |
That would be amazing @jescowuester. Looking forward to a POC for this. |
Hey @anubra266 ! I wanted to push something to your PR but wasn't able to(I don't have the rights). So instead i created this repo : https://github.com/Shyrro/test-zag-svelte I made the spread work with the accordion machine. I'm still having reactivity issues but those are mainly coming from what i did in the use machine hook and not related to SSR or anything. I'm missing reactivity somewhere and didn't dig further. As you can see when launching the repo, the props are spread correctly, the events also have no issue being used correctly. I added a counter so that it's obvious. Your code was good, and i think your code is working(i just changed some stuff for the useMachine and normalizeProps), but the main issue i had in the zag repo, is that for some reason, importing packages from the workspace doesn't seem to work in SvelteKit. In the push i wanted to make, i changed the version for the accordion machine, that way i explicitly download the npm version instead of the workspace one and i didn't have anymore issues. Maybe @segunadebayo can help us resolving these? Here i forked the zag repo and made an example that emphasizes this : https://github.com/Shyrro/zag/tree/svelte-trial This works but only because i'm using the machine from npm instead of the zag workspace |
Co-authored-by: Segun Adebayo <[email protected]>
@anubra266 @Shyrro. Let's get this branch merged ASAP. Don't want us to have a long-running branch |
@segunadebayo sure. Other changes will be in subsequent pull requests |
Trying out svelte through actions based on this: #262 (comment)
Issues after first try