-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
Svelte 5 Runes support #1300
Svelte 5 Runes support #1300
Conversation
🦋 Changeset detectedLatest commit: d1f5060 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
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 |
✅ Deploy Preview for houdini-docs-next ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for houdinigraphql ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
I'm working on a full rewrite of a Vue app in Svelte 5 + SvelteKit, so I'd be happy to report any issues that come up. |
There is one broken e2e test atm: the |
I am seeing lots of these as I make changes to my code, I am thinking it could be my dependencies:
These are my dependencies:
And here is my client.ts: export default new HoudiniClient({
url: 'http://localhost:3030/shop-api',
throwOnError: {
// can be any combination of
// query, mutation, subscription, and all
operations: ['all'],
// the function to call
error: (errors, ctx) =>
error(
500,
`(${ctx.artifact.name}): ` + errors.map((err) => err.message).join('. ') + '.'
),
}
}) For now my solution is to restart my dev server and things go along but I am curious if there is something you can spot that is wrong or if anyone is facing the same issue. |
@paulocr hmmm strange, at first glance it looks like it's an error coming from a vite dependency. Can you try updating your vite version to the latest? |
2cc70d5
to
f432d9c
Compare
So I think this PR is not in WIP anymore and is in general stable. |
Thank you all for your work! |
Hey @SeppahBaws. First of all I would like to thank you for your work! I've been using the canary ( Unfortunately, I don't have a link to reproduce it right now. Here is the part of the code where the error occurs:
|
Hey @Serator, thanks for reporting this! I'll try to look into it this weekend. |
@SeppahBaws It's definitely happening with subscriptions, I don't know about the rest yet. |
@Serator could you share a reproduction? I can't seem to recreate the error |
Hi @SeppahBaws. Sorry, I've been traveling and haven't had a chance to post. I have now updated to the latest version of Svelte 5.0.0-next.219 and the issue is gone. I haven't had time to figure out what was causing it, but now the issue is not reproducing. |
@Serator ah hmm strange, glad it's fixed tho 🙂 |
Just need to figure out why playwright suddenly doesn't want to play along anymore and then I guess we can merge this to the |
With Svelte 5 now being RC it's about time to finish this up, so that we have Svelte 5 support right when it comes out.
The main breaking changes Svelte 5 brings for us are Runes, which are incompatible with the old
export let
stuff that Houdini was generating for the query loads etc.Todo list:
Feedback welcome!
If you would like to try this in your project, bump the version in your package.json to the latest
@canary
tag on npm.Please feel free to give feedback in here on things that maybe are broken or could be done better.
For an example usage of how to use it in runes mode, check out the examples in the docs: https://deploy-preview-1300--houdinigraphql.netlify.app/guides/svelte-5
Sidenotes
I'm not entirely sure whether wrapping the store in a$derived()
rune is the best way to go about it. I think ideally we would be able to define a custom rune$graphql(...)
or$fragment(...)
but I doubt that will happen.Maybe thegraphql()
andfragment()
functions could return a rune, so that the$derived()
is hidden from the user. -> users don't need to edit anything about their queries to upgrade. need to experiment whether it would even work...To help everyone out, please make sure your PR does the following:
pnpm run tests
andcd integration && pnpm run tests
pnpm changeset