Syntax - Tasty Web Development Treats · Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

955: SvelteKit has solved data loading

November 17, 2025·36 min·3 clips
Scott Tolinsky rewrote the entire Syntax website with Svelte remote functions, ditching MySQL for Postgres and an ORM for Drizzle.
Scott and Wes explore SvelteKit's remote functions and RPC implementation, which Scott claims is the definitive solution for data loading across all platforms. The discussion covers how remote functions solve traditional server-client data loading challenges that previously required load functions at route boundaries. Scott has been extensively rebuilding the Syntax website, migrating from MySQL to Postgres, switching to Drizzle ORM, and rewriting all data loading using remote functions. Remote functions use .remote.ts or .remote.js file naming convention to clearly indicate server-side execution, preventing security issues from accidentally importing server code to client. The system integrates with SvelteKit's async components, allowing developers to use await anywhere in component code without manual loading state management. Query functions enable direct database calls from server with client-side function imports, eliminating manual API route creation. Standard Schema integration allows any validation library (Zod, Valibot, Archetype) to validate inputs across the entire stack. The query.batch feature prevents waterfall problems by batching multiple queries from the same microtask into single database calls and network requests. Form functions represent the most powerful feature, providing progressively enhanced HTML forms that work without JavaScript while offering automatic validation and error handling. Developers spread form function fields directly onto HTML inputs, receiving client-side validation derived from server-side Standard Schema definitions. The system provides programmatic access to form state, error messages, and validation without requiring controlled inputs or manual state management. Scott demonstrates practical implementation by building a service worker with IndexDB caching, achieving 10-millisecond data loads through stale-while-revalidate patterns. The discussion compares SvelteKit's approach to Next.js component-level caching and other RPC libraries including tRPC, BetterCall, and Hono's implementation. Wes notes the proliferation of RPC implementations across frameworks and the importance of Standard Schema adoption. The conversation maintains enthusiastic and technical tone throughout, with Scott expressing strong preference for this approach over React alternatives. Both hosts demonstrate deep technical knowledge while remaining accessible to developers learning these patterns. The episode serves developers using SvelteKit, those evaluating framework choices, and anyone interested in modern data loading patterns that eliminate boilerplate while maintaining type safety from server to client.
Listen to the show on