Nakodo has 19 pages behind its login. It also has 19 loading.tsx files. That is not a coincidence I noticed afterwards, it is a rule, and this is what checking it looks like:
$ for d in $( find "src/app/(app)" -name page.tsx | xargs -n1 dirname ) ; do [ -f " $d /loading.tsx" ] || echo "no loading: $d " done $
Enter fullscreen mode
Exit fullscreen mode
No output. Nineteen for 19. Together they are 885 lines, which is more code than any single page in the app, and the rest of this post is what is in them and the four decisions that shaped them.
The primitive is called Bone, and it is hatched
shadcn's Skeleton is 13 lines and ships with every install:
function Skeleton ({ className , ... props }: React . ComponentProps < " div " > ) { return < div data-slot = "skeleton" className = { cn ( " animate-pulse rounded-md bg-muted " , className ) } { ...…