Files
kolaytercih/.agents/skills/vercel-react-best-practices/rules/server-parallel-nested-fetching.md
bilalgursen ea85a053c5
All checks were successful
Deploy / deploy (push) Successful in 7m30s
feat: add new skills to skills-lock.json and update use-pixel-heat component
- Added new skills: find-skills, frontend-ui-engineering, and vercel-react-best-practices to skills-lock.json.
- Updated use-pixel-heat.ts to import both animate and AnimationPlaybackControls from motion for improved animation handling.
2026-08-08 16:08:54 +03:00

992 B

title, impact, impactDescription, tags
title impact impactDescription tags
Parallel Nested Data Fetching CRITICAL eliminates server-side waterfalls server, rsc, parallel-fetching, promise-chaining

Parallel Nested Data Fetching

When fetching nested data in parallel, chain dependent fetches within each item's promise so a slow item doesn't block the rest.

Incorrect (a single slow item blocks all nested fetches):

const chats = await Promise.all(
  chatIds.map(id => getChat(id))
)

const chatAuthors = await Promise.all(
  chats.map(chat => getUser(chat.author))
)

If one getChat(id) out of 100 is extremely slow, the authors of the other 99 chats can't start loading even though their data is ready.

Correct (each item chains its own nested fetch):

const chatAuthors = await Promise.all(
  chatIds.map(id => getChat(id).then(chat => getUser(chat.author)))
)

Each item independently chains getChatgetUser, so a slow chat doesn't block author fetches for the others.