Pretty much done with development and testing on this update to Sveltekit remote forms.
Passing the ball to @dummdidumm.bsky.social to decide whether this is the right approach, or if he wants to go with his alternate approach of decoupling the client-side goodies.
Posts by Matt DeKok
Looks like form remote functions
Rich is cooking. #svelte
#MTG I almost spit out my drink
Why zod over StandardSchema?
Who is Mark? Does Matt have a brother?
I'd say the main benefits for me are:
- Distinct code requirements/dependencies
- Clearly defined expected errors
- Logging
I don't really use the Effect schema, because Valibot is my preferred validator.
Then the `run` and `runSafe` functions are used in remote functions and load functions.
github.com/sillvva/ddal...
github.com/sillvva/ddal...
Here are the main places where I've setup my SvelteKit integration:
I setup most of the Effect code in `$lib/server/effect`
github.com/sillvva/ddal...
And added the managed runtime to `locals` so that it can be accessed by my custom `run` functions in `runtime.ts`
github.com/sillvva/ddal...
For the docs, check out "Why Effect?", "The Effect Type", "Expected Errors", and "Managing Services" as a starting point to understanding the Effect flow.
I might also make a blog post about how I integrated it with SvelteKit.
I didn't really use any resources other than the docs. One of the nice parts about Effect is that even though it can be the whole solution much of the time, you can also incrementally adopt it, which is what I did in my project until it eventually took over the entire back end.
Just disable that rule in your eslint.config.js. It has a lot of issues:
github.com/sveltejs/esl...
{
rules: {
"svelte/no-navigation-without-resolve": "off"
}
},
I rebuilt my hobby web app 3.5 times with Nuxt, Next.js, Sveltekit. I got part way in with Solid Start before I gave up like "Nah, I'll stick with Sveltekit."
I think the start time is off by an hour
Super excited to announce the experimental release of asynchronous SSR in Svelte! github.com/sveltejs/sve...
`await` expressions in your Svelte components can now be rendered on the server, meaning you don't need to render them inside boundaries with a `pending` snippet. Next up, streaming SSR!
Not quite working with remote functions yet?
Love Teval! My favorite.
I created a run method to integrate Effect + SvelteKit
a) takes an effect, effect fn, or a generator fn
b) handles tagged errors, defects, and SvelteKit's `error` and `redirect`
c) uses a custom logger to post logs to the console and the db
d) returns directly to a loader, action, or remote function
Thanks for looking into it!
Testing some more, I seem to be able to enable remote functions so long as I don't enable async, so the issue is only there.
Remote functions are awesome!
I think the ultimate troll move would be that they make it mostly identical but add Indestructible
... 2 mana rocks that come into play untapped and with upside
...Damn!
Known issue, which I found after: github.com/sveltejs/sve...
Basically properties of `data` become undefined before navigating away from a page, and the effects try to rerun before that happens so it causes a "reading property of undefined error" on the previous page.
There's a repro in the issue.
screenshot of the release PR for SvelteKit remote functions
we just released SvelteKit remote functions. feel like 'minor change' undersells it a little tbh
✅ await in components svelte.dev/docs/svelte/...
✅ remote functions svelte.dev/docs/kit/rem...
🔜 async SSR
truly can't wait to ship the rest of this stuff
One caveat, which I raised in Discord, is that loaders break when either experimental flag is enabled.
I think I might have just had the best idea for a crossover ever. Whose Line is it Anyway featuring Guardians of the Galaxy
It doesn't help. Nixpacks only cares about the major version and will still use 22.11.0 on Coolify unless you use an updated nixpkgs archive.