Senior software engineer & Sanity expert. Founder of 1367 Studio, an official Sanity partner. I build fast Next.js + Sanity sites and SaaS. DMs open for project
Audio software taught me more about frontend performance than any web course.
In audio, you get a hard budget. Miss it once and everyone hears it.
→ 128 samples at 48kHz = 2.67ms to fill the buffer
→ Too late? A click. No retry, no spinner.
→ So you never allocate, lock or fetch on the audio thread
The web has the same rule. We just pretend it doesn't:
→ 16.7ms per frame at 60fps
→ Every long task on the main thread is your "click"
Treat the main thread like the audio thread.
What's the worst main-thread offender you've found?
Clients don't buy a headless CMS.
They buy "I can fix a typo without calling my dev."
Most Sanity builds get this backwards:
→ Fast frontend, scary Studio
��� 40 fields, no groups, no descriptions
→ Document lists full of "Untitled"
My fix on every project:
1. Group fields by editor task
2. One-line description on anything unclear
3. Real previews (title + image)
4. Hide what only devs touch
What's the first thing you fix in a client's Studio?
Stop hand-writing TypeScript types for your Sanity queries.
They drift the moment someone touches the schema.
Sanity TypeGen does it for you:
→ Wrap each GROQ query in defineQuery()
→ Run sanity schema extract, then sanity typegen generate
→ client.fetch() now returns the exact shape of your projection
→ Change the schema, regenerate, and TS shows you every page that broke
Bonus: typegen: { enabled: true } in sanity.cli.ts regenerates types on sanity dev and build.
Still casting "as Post" everywhere, or already on TypeGen?
The most expensive Sanity mistake I see isn't technical. It's a schema copied from the Figma file.
homeHero, homeSection2, aboutBlock3…
→ Looks fine on launch day
→ Then marketing wants that testimonial on 4 pages
→ Then a newsletter, an app, an AI agent reading your content
→ Every reuse becomes a migration
Model what content IS: product, testimonial, author, FAQ.
Pages just reference it.
Do you name your schema types by page or by meaning?
Your Sanity images get optimized twice. Next.js does the work your CDN already does.
With the default next/image setup:
→ Next fetches the full-size original from Sanity
→ Re-encodes it on your server (or on Vercel's meter)
→ Sanity's image CDN could do it with 3 URL params
The fix is ~10 lines:
1. images: { loader: 'custom', loaderFile } in next.config
2. The loader sets w, q and auto=format on the image URL
3. next/image still builds the srcset
Heads up: it applies to every <Image>, not just Sanity ones.
Sanity CDN or Vercel Image Optimization: which do you use?
"revalidate: 60" is the most common caching mistake I see in Sanity + Next.js projects.
→ Editors publish, wait a minute, and think the site is broken
→ Your server refetches content that hasn't changed in weeks
What we ship instead:
1. Cache fetches and tag them by document type
2. A Sanity webhook hits a route handler on publish
3. It calls revalidateTag for that type only
Or skip the plumbing: next-sanity's defineLive handles it for you.
How do you handle cache invalidation with your CMS?
I'm Leo
Senior software engineer and Sanity expert
If you want to talk about a project, drop me a message
https://t.co/oK9UfOJ34S
Upgrading an old Next.js app? Your [slug] pages break on one line.
params is now a Promise.
→ Next 14: params.slug just works
→ Next 15: you have to await it (sync access only gives a warning)
→ Next 16: sync access is gone completely
→ Same for searchParams, cookies() and headers()
npx @next/codemod@latest next-async-request-api .
rewrites most of it for you.
What else bit you during the upgrade?
Upgrading an old Next.js app? Your [slug] pages break on one line.
params is now a Promise.
→ Next 14: params.slug just works
→ Next 15: you have to await it (sync access only gives a warning)
→ Next 16: sync access is gone completely
→ Same for searchParams, cookies() and headers()
npx @next/codemod@latest next-async-request-api .
rewrites most of it for you.
What else bit you during the upgrade?
"revalidate: 60" is the most common caching mistake I see in Sanity + Next.js projects.
→ Editors publish, wait a minute, and think the site is broken
→ Your server refetches content that hasn't changed in weeks
What we ship instead:
1. Cache fetches and tag them by document type
2. A Sanity webhook hits a route handler on publish
3. It calls revalidateTag for that type only
Or skip the plumbing: next-sanity's defineLive handles it for you.
How do you handle cache invalidation with your CMS?
I'm Leo
Senior software engineer and Sanity expert
If you want to talk about a project, drop me a message
https://t.co/oK9UfOJ34S
Discord is dropping Electron. An early Rust build of the new client was spotted at ~290MB of RAM.
Before you rewrite your app in Rust, read the fine print:
→ Discord has run Rust since 2018 (infra, voice, parts of the client)
→ Desktop UI moves to GPUI, not Tauri: no webview at all
→ Mobile keeps native UI, sharing Rust code with desktop
→ No release date yet
The lesson isn't "Electron bad".
Web tech got them to scale. Scale told them what to rewrite.
At what point would you leave your web stack?
I'm Leo
Senior software engineer and Sanity expert
If you want to talk about a project, drop me a message
https://t.co/oK9UfOIvfk
The most expensive bug in an agency project isn't in the code. It's in the content model.
Projects that blow the budget usually start the same way: pages get designed before content does.
What we do now at 1367 Studio:
→ Content modeling workshop before the quote
→ Model what the business publishes, not what the mockup shows
→ Editors try the Studio before a single page is styled
→ Design follows the schema, not the other way around
Pages change every redesign. A good content model survives three.
Content first or design first on your projects?
I'm Leo
Senior software engineer and Sanity expert
If you want to talk about a project, drop me a message
https://t.co/oK9UfOIvfk
Mistral's new pitch for AI agents isn't "smarter". It's "run them on your own servers".
This week the Paris lab expanded Mistral Studio:
→ Agents defined in code with a new Python SDK
→ Run them self-hosted or Mistral-managed
→ Workflows mixing rules, agents and human approvals
→ Internal apps with auth built in
(mostly public preview)
My take: with French clients, "where does the data live?" kills more AI projects than model quality.
Would you pick Mistral over OpenAI for client work?
I'm Leo
Senior software engineer and Sanity expert
If you want to talk about a project, drop me a message
https://t.co/oK9UfOIvfk
Stop hand-writing TypeScript types for your Sanity queries.
They drift from your schema the day someone adds a field.
Let Sanity generate them:
→ Wrap every GROQ query in defineQuery()
→ Run npx sanity schema extract
→ Then npx sanity typegen generate
→ Your fetch results come back typed, straight from sanity.types.ts
Rename a field in the schema, regenerate, and tsc flags every Next.js component that breaks. Before production does.
Are you on TypeGen yet, or still writing interfaces by hand?
I'm Leo
Senior software engineer and Sanity expert
If you want to talk about a project, drop me a message
https://t.co/oK9UfOIvfk