Wo sucht er denn?
Wo sucht er denn?
We create coloring pages with nano banana, but yours is next level
I have built various sveltekit apps and might be interested! π
For form() with enhance, it tries to get the result from the await submit(); but it's actually in myFormAction.resultsβ¦
Overall it works and the small mistakes are not that critical, but I have like 6 sessions running in parallel and when all are doing the same mistakes very day π
Sure! In the GitHub repo? For example, Claude often tries to use .pending (not .loading) and sth like if remoteFunctionCmd().error (it's a command, not query)
I'm also still experimenting, but remote functions + svelte mcp + hints how to use it in agents.md / claude.md also have a lot of small mistakes. I will try the skills next time. It's kind sad that LLMs have a knowledge cut off and everything new is not included
Having Claude skills for remote functions, runes, and other things would be more helpful than the MCP, in my opinion. There are certain things that are always wrong and annoying to fix repeatedly (like every session) because they arenβt part of the βgeneral knowledgeβ of the LLM
My minimal example is obviously working β¦ once I find it, I will create a demo
Iβll create an example tomorrow
*Same remote function
use case is that I have a header that needs the title and I have some content somewhere else that needs other data from that same remote function
Is this a bug or feature? π
@dummdidumm.bsky.social - can I call multiple remote functions on different parts on the page? Like in +layout.svelte and then in some nested components again? I'm facing a but where I call myFn.refresh() in a component and it doesn't refresh. It does, if I remove it from the +layout.svelte
lil' treat for all you weekend builders: Svelte now has an official MCP server, courtesy of resident bot wranglers @paolo.ricciuti.me and @khromov.se π€
it gives your LLM access to docs and compiler-driven diagnostics β give it a spin and let us know how you get on!
svelte.dev/docs/mcp/ove...
You don't happen to work with freelancers? Like, say, 20-40 hours per week?
@dummdidumm.bsky.social
github.com/wiesson/svel... I made this little page to test some patterns after each svelte/kit release to see if sth is broken or works
@sveltesociety.dev @svelte.dev
I think I got it π - wasn't that hard
const initial = await getPost(params.id);
let formData = $state({
title: initial.title,
content: initial.content
});
Maybe just like this? But what happens if id changes?
let query = $derived(getPost(postId))
let formData = $state(query.current)
looks nice, but doesn't work, because $state doesn't react to the derived changes
like this? If post id changes, the query reruns and $effect picks it up and updates formData. Can I (re)assign the $state without the $effect?
@dummdidumm.bsky.social what's the preferred pattern to load data from a remote function and populate state for formData?
let postId = $derived(params.id)
let query = $derived(getPost(postId))
let formData = $state({ ... })
$effect(() => {
if(query.current) {
formData = query.current
}
}}
Or more in the answer π
Iβm also interested in this question :)
Itβs sooo good!
I have refactored like 30 routes to use the remote functions, and it feels great! Now modals can call the same functions as forms in other places without thinking about the exact path where the action might be
Sad to read though. I'm a huuuuge fan of Claude Code
I really canβt wait to use it! It solves all my problems π
Especially when working with forms. I had so many cases where the page.server.ts is located in some nested nested folder or I moved a dialog and forgot to update the action route ..
Beautiful π₯Ή
it works β¦ :)
<picard meme here>
I tried FF, Chrome and safari - its just blank