{🧪} +paoloricciuti.svelte
@paolo.ricciuti.me
1.4K followers 430 following 1.8K posts
S1 | Developer | https://sveltelab.dev | Fat guy | Svelte Ambassador 🔶 | Svelte maintainer 🧡 | JavaScript Bender
Posts Media Videos Starter Packs
paolo.ricciuti.me
I mean...just look at this. Please look at this and tell to my face svelte is not THE best framework. DO IT! 🧡
dummdidumm.bsky.social
Fun little interaction challenge: one select changes the options of another, which needs to load data depending on the first.

This is how you do it with the new Svelte APIs. Comfortably fits into one screenshot.
showing this code:

<script>
	import { getStates, getCities } from './data';

	const states = await getStates();
	let selectedState = $state(states[0]);

	const cities = $derived(await getCities(selectedState));
	let selectedCity = $derived(cities[0]);
</script>

<select bind:value={selectedState}>
	{#each states as state, idx}
		<option>{state}</option>
	{/each}
</select>

<select bind:value={selectedCity} disabled={$effect.pending()}>
	{#each cities as city}
		<option>{city}</option>
	{/each}
</select>

<p>Selection: {selectedCity}, {selectedState}</p>
paolo.ricciuti.me
Maybe someone will to test out remote functions for good 👀
paolo.ricciuti.me
Also you sound like the guy who would write in assembly because C is slow
paolo.ricciuti.me
Do you have any benchmark confirming data star is faster than svelte? Svelte is very close to vanilla JS without sacrificing DX in the slightest.
paolo.ricciuti.me
But that was the whole point of the post! You can use template literals, you can write your whole website in vanilla (saving even your 10kb once 😏) but it's completely unrelated to the post.

You prefer data star and it's absolutely fine, other people prefers svelte "complexity" for better DX!
paolo.ricciuti.me
The svelte MCP is finally (after a long battle with Github Actions) live on the official MCP registry!

registry.modelcontextprotocol.io/v0/servers/d...

(I know the page is not pretty but they didn't implement a fancy website for it yet lol)
registry.modelcontextprotocol.io
paolo.ricciuti.me
The point of the post was literally "Look in svelte I can just use {} inside a string instead of template literals" and your answer is "You can just use template literals".

Like wtf?
paolo.ricciuti.me
Yeah you need to have some sort of map
paolo.ricciuti.me
Right now, no, we (and by we I mean @ell.iott.dev) are working on a brand new Svelte feature that will allow you to create a `fetcher` that basically behaves like a remote function, but you define the URL to fetch
paolo.ricciuti.me
@kevinak.se has been killing it recently! Learn remote function from the man, the goat himself @dummdidumm.bsky.social !
paolo.ricciuti.me
I think you need a vite plugin to manage them (it's probably already existing or pretty easy to write).
paolo.ricciuti.me
I don't see why it shouldn't be possible... probably not super easy but definitely possible. Have you found some problems in svelte trying to implement it?
paolo.ricciuti.me
1400 followers! Thanks, everybody, for willingly deciding to hear about Svelte 90% of my posts 😅
paolo.ricciuti.me
That should be fine...it might also be a bug in SvelteKit...if you find a way to consistently reproduce, please open an issue 🙏🏻
paolo.ricciuti.me
That's interesting...if it happens during build, it's most likely the prerendering that is doing fetch requests to the SvelteKit app. The error happens when someone is trying to read the body of a request that has already been consumed. Do you have any prerendered routes?
paolo.ricciuti.me
You should be able to: svelte.dev/docs/mcp/loc...

Unfortunately, there's a bug where remote MCP doesn't work in Codex at all, but you should be able to use the local setup (and that should be picked up by the Codex extension too.
Local setup • Docs • Svelte
Local setup • Svelte documentation
svelte.dev
paolo.ricciuti.me
Did you try with the new MCP server? It should autocorrect whenever the agent tries to go svelte 4!
paolo.ricciuti.me
Well there's not much docs to add...you can use await without a boundary, SSR will wait for that promise to resolve and SSR the output 😁
paolo.ricciuti.me
Async ssr it's already available 😎
paolo.ricciuti.me
We changed the API a bit but now is much much nicer 🧡

Try out sveltekit remote functions today 🤟🏻🤟🏻🤟🏻
sveltesociety.dev
SvelteKit's remote functions now handle FormData out of the box!
github.com/sveltejs/kit...