Referees
Card and foul averages per official — and the clearest example in the app of which filters re-run the server and which do not.
/referees · src/composed/referees
Card and foul averages per official, with the fixtures they are appointed to.
Read on the server
The two requests used to be SWR hooks here. They are now made by the Server Component that renders this one, which has the same filters available to it — they are in the URL — and sits inside the network the API is on.
The rows arrive as props. What stays on the client is the address bar and the table.
Shallow, and not shallow
This board is the clearest example of a distinction every server-read board needs:
| Filter | Write | Why |
|---|---|---|
| The ones that change what the server returns | shallow: false | Writing them re-runs the Server Component |
| "Today only", the page number, column visibility | shallow | The browser applies them to rows it already has |
Getting it wrong in one direction costs a round trip for a filter the browser could have applied. Getting it wrong in the other shows stale rows and no indication that anything is stale — which is the expensive one.