Continuing our Remote Functions series with prerender functions. These work like regular queries but execute at build time instead of runtime. Import prerender from $app/server in a .remote.ts file, declare your function, and use it in your components. When the build runs, SvelteKit executes the function and saves the result to disk as a static file.
This enables partial prerendering at the data level rather than just the page level. You can have both static and dynamic data on the same page: serve dashboard stats instantly from the CDN while keeping the comments list fresh and dynamic. More Remote Functions features coming up next!