Centralize dynamic-rendering opt-out in fetchAPI instead of per-page - #204
Merged
Conversation
Every page reading admin-editable data needed export const dynamic = "force-dynamic" or it would silently serve build-time-stale data, and that line was duplicated across 16 files with nothing enforcing it — new pages kept forgetting it (#191, #192, #196). Set cache: "no-store" as the default in fetchAPI itself so any page calling an API getter is dynamic automatically, then drop the now-redundant per-page exports. Fixes #201
calebyhan
marked this pull request as ready for review
August 21, 2026 01:11
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fetchAPInever setcache: "no-store", so Next statically froze data at build time unless a page remembered to addexport const dynamic = "force-dynamic";— that line had been duplicated across 16 files with nothing enforcing it, and kept getting reintroduced page-by-page (Staff & Leadership frontends not updating #191, Fix finance hearing banner copy on homepage #192, Fix stale staff, leadership, and funding hearing pages #196).cache: "no-store"as the default infetchAPIitself (still overridable per-call viaoptions), so any page calling an API getter is dynamic automatically.export const dynamic = "force-dynamic";from all 16 pages, since none of them rely on cookies/headers for dynamic behavior — they all get it fromfetchAPInow.Fixes #201
Test plan
tsc --noEmitpasses