Elliott Johnson
@ell.iott.dev
96 followers 10 following 63 posts
Svelte Core Team @ Vercel
Posts Media Videos Starter Packs
ell.iott.dev
I think you'd just use this: svelte.dev/docs/kit/pag...

You might also have to provide custom entries to get SvelteKit to actually call the endpoint with all of your blog slugs during prerendering, as it wouldn't find them during crawling:

svelte.dev/docs/kit/pag...
Page options • Docs • Svelte
Page options • Svelte documentation
svelte.dev
ell.iott.dev
I'd be surprised if you couldn't prerender your OG images, which would bypass the cold start issue... have you tried this?
ell.iott.dev
It’s not “done done” — I’m currently working on “hydratables/resources” that allow you to inline the results of data fetched on the server into your HTML so that it can hydrate synchronously. Remote Functions already do this, though, so if you’re using SvelteKit, async SSR “just works”.
ell.iott.dev
fwiw I wrote the interface so feel free to ping with questions if you run into them — I’m not super active on social media but I’ll see them eventually! 😂
ell.iott.dev
This is the same strategy Vercel’s AI SDK has for the framework-agnostic Chat interface. Go check out the Svelte implementation in that repo if you want more reference.
ell.iott.dev
Interesting; I get the same result from Wappalyzer but I can't figure out what's actually using Svelte on the page...
ell.iott.dev
Astro just merged a PR with support!
ell.iott.dev
Yeah this just means Astro isn’t using async SSR. They’d basically just need to switch to `await render` when they detect you have `experimental.async` on.
ell.iott.dev
Yes it supports both! If you use it synchronously it’s synchronous — if you await it or call `.then` it’s asynchronous.
ell.iott.dev
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!
Async SSR · sveltejs svelte · Discussion #16784
The Svelte team has been hard at work on asynchronous rendering, with client-side support and remote functions as our first two efforts. It’s time for the third: SSR. Background There are three cor...
github.com
Reposted by Elliott Johnson
ell.iott.dev
FWIW Sonnet regularly does impressive things for me. Still the best general-purpose coding model I’ve used.
ell.iott.dev
I can't wait for someone to send me a screenshot of traces from a REAL web app. Real deep stack stuff. 😂
ell.iott.dev
OpenTelemetry tracing is live in SvelteKit! Huge s/o to @stracke.tech for all the help along the way. SvelteKit can now emit OTEL spans for all of its serverside constructs. It also provides an instrumentation file to easily set up trace exports. svelte.dev/blog/sveltek...
Introducing integrated observability in SvelteKit
SvelteKit apps can now emit OpenTelemetry traces and reliably set up observability instrumentation using instrumentation.server.ts
svelte.dev
ell.iott.dev
I'm actually really curious if you can provide some specific numbers here. We expect to see some amount of increased bundle size for very small apps (last time I benched it was ~9kb max), but a significant and growing _decrease_ in bundle size the larger your app becomes.
ell.iott.dev
...any function that calls `fetch` (`globalThis.fetch`/`window.fetch`, all the same thing) will call your function instead. So you do whatever middleware stuff you want to do and just make sure to call `original_fetch` at the end to pass through the normal fetch behavior.
ell.iott.dev
You can export an `init` function from the hooks file on both the client and the server. This function is guaranteed to finish running before your application code runs. So, in that hook, you can replace `globalThis.fetch` with whatever function you want to run. Everywhere else in your app...
ell.iott.dev
The secret no one wants you to know is that you can just patch `globalThis.fetch` in your `init` hook and it'll work just fine 😉

const original_fetch = fetch;
globalThis.fetch = (...args) => {
// your stuff
return original_fetch(...args)
}
ell.iott.dev
Generating TypeScript files during dev/build on the fly means you have to do some _interesting_ things 😂 Thankfully the ts-ignore issue is just an upstream problem we’ll be able to fix
ell.iott.dev
tbh it was pretty sloppy before AI too -- I think maybe 1/100 recruiter messages has ever been remotely related to what I actually do / am interested in based on a barely-conscious reading of my LinkedIn 😂
ell.iott.dev
Have you tried `$inspect` or `$inspect.trace`? They should supply highly-useful stacks
ell.iott.dev
It's a fantastic place to work!
ell.iott.dev
Three years ago I deployed a SvelteKit app to Vercel and was so blown away by the experience (and the following week's productivity) that I started working for Vercel two months later 😂
ell.iott.dev
There's plenty to help with the debugging -- if you're struggling with a reactive variable, you can use `$inspect` or `$inspect.trace` to get detailed information about where it was created and all of the places it's being updated.