Syntax - Tasty Web Development Treats

955: SvelteKit has solved data loading

90 snips
Nov 17, 2025
Scott and Wes dive into SvelteKit's new remote functions, which tackle long-standing challenges in data loading. They discuss the clever use of queries, forms, and batching that simplify Svelte's data management. The duo also compares Svelte’s async capabilities with React, highlighting its advantages. They explore fascinating topics like standard schema for seamless TypeScript validation and progressive enhancements for HTML forms. The episode wraps up with Scott's cold brew coffee tips and Wes's love for a new Bosch dishwasher.
Ask episode
AI Snips
Chapters
Transcript
Episode notes
INSIGHT

Await Anywhere In Components

  • Async Svelte plus remote functions enable awaiting data at the component level, improving server/client rendering ergonomics.
  • This removes the need for useEffect-style patterns common in client React for simple fetches.
ADVICE

Use Standard Schema For Validation

  • Use Standard Schema validators (Zod, Valibot, etc.) as the first parameter to remote queries to get unified validation and types.
  • This yields seamless TypeScript types and consistent client/server validation without extra type imports.
INSIGHT

Batch Multiple Queries Automatically

  • query.batch groups queries issued in the same microtask into one server call so many per-item calls become a single batched request.
  • Batching reduces network trips and can consolidate multiple inputs into one DB query.
Get the Snipd Podcast app to discover more snips from this episode
Get the app