Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix InferGetStaticParamsType and InferGetStaticPropsType not working with sync getStaticPaths #6711

Merged
merged 3 commits into from
Mar 30, 2023

Conversation

Princesseuh
Copy link
Member

Changes

InferGetStaticParamsType and InferGetStaticPropsType always assumed that getStaticPaths was async, but it can be sync in some cases. This PR fixes this.

This PR additionally updates the JSDoc comments to show usage with satisfies, as trying to type getStaticPaths directly will cause InferGetStaticParamsType and InferGetStaticPropsType to not work (since they work by inferring the return value, which the type will overwrite. satisfies is great)

Testing

Tested manually

Docs

N/A

@Princesseuh Princesseuh requested a review from a team as a code owner March 30, 2023 09:17
@changeset-bot
Copy link

changeset-bot bot commented Mar 30, 2023

🦋 Changeset detected

Latest commit: 981774f

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Princesseuh Princesseuh merged commit c04ea0d into main Mar 30, 2023
@Princesseuh Princesseuh deleted the fix/infer-getstaticpaths-not-async branch March 30, 2023 09:41
@astrobot-houston astrobot-houston mentioned this pull request Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants