Skip to content

docs: annotate getPrerenderPaths() return types - #727

Merged
cpojer merged 1 commit into
voidzero-dev:mainfrom
yangshun:docs/get-prerender-paths-annotation
Nov 6, 2026
Merged

cpojer merged 1 commit into
voidzero-dev:mainfrom
yangshun:docs/get-prerender-paths-annotation

Conversation

@yangshun

@yangshun yangshun commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

#726 brought up the issue of typesafety for getPrerenderPaths. It fixes runtime issues, but the issue can be caught even earlier with proper type annotations for getPrerenderPaths(). I think we should encourage this practice.

  • Show a PageParams return annotation for getPrerenderPaths() on dynamic pages, since Void does not infer it from the filename.
  • Note that custom SSR returns Promise<string[]>.

Test plan

  • Read the prerender, SSG, and type-safety guides and confirm the examples match.

Made with Cursor

Void does not infer the return type from the page filename, so the guides show a PageParams annotation.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cpojer cpojer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@cpojer
cpojer merged commit b5fb53b into voidzero-dev:main Nov 6, 2026
10 checks passed
@yangshun
yangshun deleted the docs/get-prerender-paths-annotation branch November 6, 2026 06:06
@magurotuna

Copy link
Copy Markdown
Member

Nice one!

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.

3 participants