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. Svelte vs React: one component, two waysDec 2 I wrote the same packing list in Svelte and in React, then counted what ran when I changed one thing. The React Compiler fixed typing for free. Checking off one item took three more changes to the code. Why Svelte, part 19 · 7 minSame list, two clipboards. In React, ticking one box runs every row again unless you reshape the code for the Compiler. In Svelte, you tick the box.
  2. Observability in SvelteKitDec 2 SvelteKit 3 emits OpenTelemetry spans for handle, load, form actions, endpoints and remote functions with one config flag. I traced a small app, and the docs' setup worked in dev and broke every request in production. Why Svelte, part 18 · 6 minThe trace runs through every box, handle down to load. The probe you clipped on to read it can also short the box, so test the built server.
  3. Testing Svelte componentsDec 2 In a Svelte project, a test's file name decides whether runes compile, whether it runs in Node or a browser, and whether your effects exist at all. I tested one small module from both sides of that line. Why Svelte, part 17 · 7 minSame test, two doors. The name on the file decides whether it runs in a browser or in a room where $effect doesn't exist.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
All 79 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.