feat(sistent): refactor pagination to use dynamic GraphQL routing and remove content.js#7587
feat(sistent): refactor pagination to use dynamic GraphQL routing and remove content.js#7587rishiraj38 wants to merge 6 commits intolayer5io:masterfrom
Conversation
Signed-off-by: Rishi Raj <rishiraj438gt@gmail.com>
YASHMAHAKAL
left a comment
There was a problem hiding this comment.
Looks good @rishiraj38
|
Solid refactoring, @rishiraj38. Replacing the hardcoded One coordination item to flag: #7582 (Card component docs) added entries to Also worth confirming:
Good work eliminating that technical debt. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR refactors Sistent pagination to derive component/tab routes dynamically from Sistent MDX nodes via Gatsby useStaticQuery, removing the large manually-maintained content.js list.
Changes:
- Replace static
content.jspagination data with a GraphQLallMdxquery + derived route list. - Filter pagination to only include pages for components whose overview page is
published: true, and order tabs (overview → guidance → code). - Remove
src/components/SistentNavigation/content.jsand inline remaining stable routes inpagination.js.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| src/components/SistentNavigation/pagination.js | Adds useStaticQuery and runtime route derivation/sorting for pagination, plus a small stable-route prefix list. |
| src/components/SistentNavigation/content.js | Deletes the hardcoded pagination array previously used by Sistent pagination. |
Signed-off-by: Rishi Raj <rishiraj438gt@gmail.com>
|
@Rajesh-Nagarajan-11, I’m not sure what’s happening with my Laptop. I can’t make a site and I can’t build it either. It keeps saying JavaScript heap out of memory. I’ve tried everything: reducing thread pools , reduced gatsby cpu counts and max space size, but nothing works. |
|
Well clean cache and use NODE_OPTIONS=--max-old-space-size=4096 (or even 8192) before running the build.. @rishiraj38 , I think that should work |
Description
This PR fixes #7585 by replacing the hardcoded
content.jsarray with a dynamic GraphQLuseStaticQueryto automatically handle Sistent pagination.This ensures that any newly added component or tab (overview, guidance, code) is instantly indexed and correctly ordered in the pagination workflow without requiring developers to manually update boilerplate arrays.
Changes Made
src/components/SistentNavigation/content.jsto remove technical debt.SistentPaginationto dynamically fetch all Sistent MDX nodes.published: false), while successfully pulling grouped tabs (overview->guidance->code) belonging to published components.componentSlugto guarantee proper alphabetical sequencing.Signed commits