Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
c8d9768 to
070b8b1
Compare
Uzaaft
reviewed
Feb 24, 2026
Uzaaft
reviewed
Feb 24, 2026
Comment on lines
+27
to
+48
| // loadDocsNavTreeData loads nav.json and contextualizes open/active nodes for a slug. | ||
| export async function loadDocsNavTreeData( | ||
| docsDirectory: string, | ||
| activePageSlug: string, | ||
| ): Promise<NavTreeNode[]> { | ||
| const docsFilePath = `${docsDirectory}/nav.json`; | ||
| try { | ||
| const data = await fs.readFile(docsFilePath, "utf8"); | ||
| const jsonData: NavFile = JSON.parse(data); | ||
| return contextualizeNavFile(jsonData, activePageSlug); | ||
| } catch (err) { | ||
| if (err instanceof SyntaxError) { | ||
| throw new Error( | ||
| `Failed to parse ${docsFilePath}: | ||
|
|
||
| ${err.message}}`, | ||
| { cause: err }, | ||
| ); | ||
| } | ||
| throw err; | ||
| } | ||
| } |
There was a problem hiding this comment.
I believe this can be wrapped with React.cache and avoid I/O during build.
https://react.dev/reference/react/cache
Uzaaft
reviewed
Feb 24, 2026
| {/* Don't render the content until the window width has been | ||
| calculated, else there will be a flash from the smallest size | ||
| of the terminal to the true calculated size */} | ||
| {windowWidth > 0 && ( |
There was a problem hiding this comment.
I might be wrong but this would be bad for SEO and LCP since one see nothing until hydration.Might be important if you ever want that YC money. But I suck at SEO so might want to double check me.
Contributor
Author
There was a problem hiding this comment.
This is the same logic we already have, so this is good to note to look into but shouldn't block this.
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.
It's obviously the future of Next, we should migrate to it. This was mostly done by AI with some manual cleanups. I'm still reviewing the full thing. There are obviously messy parts to this that I'm not happy with so continuing to clean it up.