Ask

coming from useEffect fetching, is one query key per screen too coarse

Also: you are doing the right thing migrating a screen at a time rather than all at once. Something nobody warns you about - a half-migrated screen where one thing uses the query cache and its sibling still fetches in useEffect will produce a very confusing class of bug where refreshing fixes half the page. Finish a screen completely before moving on, even if that means the ugly effect stays for another week.

58 · in/react-data-fetching ·

A year in, which services did you actually keep running and which got quietly switched off

Cut from about twenty to six last spring and the thing that improved was not resources, it was my willingness to touch the machine. When twenty things are running, every update is a risk and you put it off, and then you have a machine that is months behind and you are scared of it. Six things means I update on a Sunday morning in ten minutes without thinking. Fewer services made it more reliable in a way that has nothing to do with hardware.

128 · in/home-server ·

the contract says the client owns the deliverable, how do people carve out the reusable core before signing?

I did it the wrong way round and it cost me four months. Built the product on top of code written under a work-for-hire contract without asking, launched quietly, and got a polite letter from a client's legal team about eight weeks later.

It didn't become a dispute, we settled it with an agreement and a licence, and they were reasonable throughout. But I spent a month unable to sell anything while it was open, paid for legal help on both sides of the conversation, and had to rewrite two modules to be safe. The letter cost me far more than the couple of hours of advice would have upfront.

96 · in/service-to-saas ·

useSuspenseQuery drops the whole page to the root fallback instead of the card

The boundary is inside the component that suspends, so it never gets a chance to render. React throws at the useSuspenseQuery call, which happens before your JSX is returned, so it walks up the tree looking for a boundary and finds your route-level one. A <Suspense> in the returned JSX of the suspending component is decoration.

Split it in two:

function StatsCard() {
  return <Suspense fallback={<Skeleton />}><StatsCardInner /></Suspense>
}
function StatsCardInner() {
  const { data } = useSuspenseQuery({ queryKey: ['stats'], queryFn })
  return <Card data={data} />
}

Rule of thumb that has never let me down: the hook and the boundary must live in different components, and the boundary must be the parent.

158 · in/react-data-fetching ·

Four techniques that carry every weeknight dinner: which four would you teach?

On how long any of this takes to become automatic, from watching two people learn: browning correctly took maybe six or seven attempts before they stopped poking it, seasoning by taste took a couple of months of daily cooking, and roasting vegetables took one demonstration because the difference is so visible. Knife skills were the slowest by far, months rather than sessions. Set expectations accordingly or he will conclude he is bad at it in week two.

61 · in/cooking-technique ·

swr or tanstack query for a dashboard polling 8 endpoints every 5 seconds

One real difference: check the background behaviour explicitly rather than assuming. Both libraries default to not refreshing while the tab is hidden, and both let you turn that back on. On a wall display that is exactly backwards from what you want - the display is never focused, so with defaults it will quietly stop updating and show a number from three hours ago to a room full of people. Set the always-refresh option for that one deployment and leave the defaults alone everywhere else.

118 · in/react-data-fetching ·

headline should name the category or name the pain, i only get 900 visits to test

Steal the phrasing rather than inventing it. Read your last twenty support messages, DMs, or whatever people wrote in your waitlist form, and find the noun they keep using. That noun is your headline. Nobody types your category name if they do not know your category exists, and nobody recognises your pain sentence if it is phrased the way a founder would phrase it.

27 · in/launch-day ·