Long reads on shipping software

Essays and tutorials on the web, the languages we build it with, and the habits that keep the work sustainable. Most of them come with a drawing.

Read today's post

Latest writing

three new today

  1. Migrating to SvelteKit 3 with sv migrateDec 1 I ran sv migrate sveltekit-3 over a small SvelteKit 2 app. It rewrote 15 files and wrote me a TODO list. After one fix the build passed, svelte-check found three more, and the nav links were broken in a way no tool flagged. Why Svelte, part 16 · 7 minsv migrate carries most of the app across and hands you a list for the rest. Check what fell off the cart that isn't on the list.
  2. SvelteKit 3: what's newDec 1 SvelteKit 3 moved its config into vite.config.ts and renamed $lib, but the bigger change is when mistakes surface. Missing env vars, secrets imported into the browser and leftover config files now stop the build. A few things still slip through to a 500, and I ran into most of them. Why Svelte, part 15 · 8 minThe build and the startup check catch most of what falls out of an upgrade. svelte-check catches some of the rest, so hold both sieves before anything reaches users.
  3. Remote functions in SvelteKitDec 1 A remote function is a server function you import into a component and call like any other, with the types carried across. SvelteKit writes the endpoint and the fetch for you. It's still experimental, and the endpoint is still there, so here's what query, form and command do on the wire. Why Svelte, part 14 · 8 min`getTodos()` looks like a drawer in your own desk. It's a hatch onto the street, so the lock goes on the function, not the page that calls it.
  4. Form actions and progressive enhancementNov 30 A SvelteKit form action is a function in +page.server.ts that a plain <form method="POST"> can call, so the form works before any JavaScript loads. use:enhance then keeps the same markup and swaps the full page reload for a fetch. Here's what each half does, and what changes between them. Why Svelte, part 13 · 9 minThe mailbox takes the letter with nothing plugged in. `use:enhance` is the motor you bolt on afterwards, and unplugging it doesn't stop the post.
  5. SvelteKit fundamentals: routes and layoutsNov 30 In SvelteKit a folder is a URL and a +layout.svelte wraps everything below it. The part that bites is what happens on navigation: SvelteKit keeps the components it can, so a layout's state survives and a page can keep state from the last URL. Why Svelte, part 12 · 8 minPost b slides into the frame post a was using. The layout never moved, and the heart from post a is still pinned to the page.
  6. Scoped styles: CSS that stays putNov 30 Svelte scopes a component's CSS by adding a class to every element the compiler can see in that component's markup, and to nothing else. That rule explains the deleted selector, the child component your styles can't reach, the utility class that loses, and when :global is the right answer. Why Svelte, part 11 · 9 minThe compiler stamps every element it can see in Card.svelte. Child.svelte is a sealed box, so nothing inside it gets the stamp.
  7. Built-in transitions and animationsNov 29 A Svelte transition is a function from t to a CSS string, and Svelte turns it into Web Animation keyframes before the first frame plays. That one design choice explains why transitions survive a busy main thread, why your reduced-motion reset doesn't touch them, and why a removed element is still in the DOM a second later. Why Svelte, part 10 · 8 minSvelte turns your function into a reel of keyframes up front and hands it to the browser. The CSS reset on the wall isn't wired to that projector.
  8. Svelte best practices from the docs, testedNov 29 Svelte's docs have a best-practices page, and it doubles as a skill file for coding agents. Half of it is this series in one line per rule. I ran the other half: unkeyed lists, #key, window listeners, style props, actions. The rules that read like performance tips turn out to be about bugs that never throw. Why Svelte, part 9 · 7 minNo errors, and ada's note is in grace's drawer. The best-practices page is a list of mistakes Svelte can't catch for you.
All 76 posts, by tag

Read it in order

I'm Esteban Trillo, a software engineer who writes about the web, the languages we build it with, and the habits that keep the work sustainable.

By day I build patient access tooling that helps people get the correct medication faster. By night I write the tutorials I wish I'd found when I was stuck: the ones that explain the why, not just the what.

Each post gets a sketch of Piwi, a small black bird who does the hard part of the idea while I watch.

If something here saved you an afternoon, that's the whole point. Say hi, I read every reply.

Piwi hands a single letter to the user at a mailbox; a small note reads no noise.

New posts, no noise

One email when a post goes out, with its sketch. Nothing in between, and one link to leave.

Sign in faster next time?

Add a passkey and skip the email link. Your fingerprint, face or device PIN is enough.