Skip to content

feat(nextjs): attribute Next.js server-side data to its page (7.2, C9)#63

Merged
officialCodeWork merged 1 commit into
developmentfrom
build/phase-7/step-7.2-nextjs-server-data
Jul 17, 2026
Merged

feat(nextjs): attribute Next.js server-side data to its page (7.2, C9)#63
officialCodeWork merged 1 commit into
developmentfrom
build/phase-7/step-7.2-nextjs-server-data

Conversation

@officialCodeWork

Copy link
Copy Markdown
Owner

Phase 7.2 — Next.js server data (failure mode C9)

Server-side data fetching feeds a page even when the fetch isn't in the component body. This attributes it to the page so the page's lineage shows the data it renders.

Changes

  • RSC async server components already worked — the async component is recognized and its inline await fetch(...) is caught by the body walk. Locked with a test.
  • Pages-router data functions (getServerSideProps / getStaticProps / getStaticPaths) are top-level exported functions, not components/hooks, so their fetches were never scanned. The main loop now collects those functions per file and runs data-source extraction on their bodies attributed to the file's default-export page component (fetches-from).

Fixture & tests

  • c9-nextjs-server-data: an async RSC page, a getServerSideProps page, and a getStaticProps page → each attributes its server-side endpoint; the data functions produce no component/hook nodes.
  • 4 unit tests.

Verification

  • pnpm eval341 pass · determinism 1.000 · all metrics 1.000
  • parser-react 168 tests; full suite, typecheck, lint clean.

Server actions deferred ("use server" mutations bound to <form action> — a mutation/event surface, fuzzier than the data-in path). Tracker updated: all frontend-side Phase 7 steps (7.1–7.3) now landed; backend parsers (7.4–7.6) remain, best held for 0.5.0 tester feedback.

🤖 Generated with Claude Code

Server-side data fetching feeds a page even when the fetch isn't in the
component body.

- RSC async server components already worked (inline await fetch is caught by
  the body walk) — locked with a test.
- Pages-router getServerSideProps/getStaticProps/getStaticPaths are top-level
  exported functions, not components/hooks, so their fetches were never scanned.
  The main loop now collects those functions per file and runs data-source
  extraction on their bodies attributed to the file's default-export page
  component (fetches-from).
- New fixture c9-nextjs-server-data (async RSC + getServerSideProps +
  getStaticProps); 4 unit tests.

eval 341/0/0/0, determinism 1.000, all metrics 1.000; parser-react 168 tests,
typecheck + lint clean. Server actions deferred.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@officialCodeWork
officialCodeWork merged commit 98a9d04 into development Jul 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants