chore: commit pending ZXDB explorer changes prior to index perf work
Context - Housekeeping commit to capture all current ZXDB Explorer work before index-page performance optimizations. Includes - Server-rendered entry detail page with ISR and parallelized DB queries. - Node runtime for ZXDB API routes and params validation updates for Next 15. - ZXDB repository extensions (facets, label queries, category queries). - Cross-linking and Link-based prefetch across ZXDB UI. - Cache headers on low-churn list APIs. Notes - Follow-up commit will focus specifically on speeding up index pages via SSR initial data and ISR. Signed-off-by: Junie@lucy.xalior.com
This commit is contained in:
@@ -1,32 +1,16 @@
|
||||
fix: await dynamic route params (Next 15) and correct ZXDB lookup column names
|
||||
chore: commit pending ZXDB explorer changes prior to index perf work
|
||||
|
||||
Update dynamic Server Component pages to the Next.js 15+ async `params` API,
|
||||
and fix ZXDB lookup table schema to use `text` column (not `name`) to avoid
|
||||
ER_BAD_FIELD_ERROR in entry detail endpoint.
|
||||
This resolves the runtime warning/error:
|
||||
"params should be awaited before using its properties" and prevents
|
||||
sync-dynamic-apis violations when visiting deep ZXDB permalinks.
|
||||
Context
|
||||
- Housekeeping commit to capture all current ZXDB Explorer work before index-page performance optimizations.
|
||||
|
||||
Changes
|
||||
- /zxdb/entries/[id]/page.tsx: make Page async and `await params`, pass numeric id
|
||||
- /zxdb/labels/[id]/page.tsx: make Page async and `await params`, pass numeric id
|
||||
- /zxdb/genres/[id]/page.tsx: make Page async and `await params`, pass numeric id
|
||||
- /zxdb/languages/[id]/page.tsx: make Page async and `await params`, pass string id
|
||||
- /registers/[hex]/page.tsx: make Page async and `await params`, decode hex safely
|
||||
- /api/zxdb/entries/[id]/route.ts: await `ctx.params` before validation
|
||||
- src/server/schema/zxdb.ts: map `languages.text`, `machinetypes.text`,
|
||||
and `genretypes.text` to `name` fields in Drizzle models
|
||||
|
||||
Why
|
||||
- Next.js 15 changed dynamic route APIs such that `params` is now a Promise
|
||||
in Server Components and must be awaited before property access.
|
||||
- ZXDB schema defines display columns as `text` (not `name`) for languages,
|
||||
machinetypes, and genretypes. Using `name` caused MySQL 1054 errors. The
|
||||
Drizzle models now point to the correct columns while preserving `{ id, name }`
|
||||
in our API/UI contracts.
|
||||
Includes
|
||||
- Server-rendered entry detail page with ISR and parallelized DB queries.
|
||||
- Node runtime for ZXDB API routes and params validation updates for Next 15.
|
||||
- ZXDB repository extensions (facets, label queries, category queries).
|
||||
- Cross-linking and Link-based prefetch across ZXDB UI.
|
||||
- Cache headers on low-churn list APIs.
|
||||
|
||||
Notes
|
||||
- API route handlers under /api continue to use ctx.params synchronously; this
|
||||
change only affects App Router Page components.
|
||||
- Follow-up commit will focus specifically on speeding up index pages via SSR initial data and ISR.
|
||||
|
||||
Signed-off-by: Junie@lucy.xalior.com
|
||||
Signed-off-by: Junie@lucy.xalior.com
|
||||
Reference in New Issue
Block a user