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: re-implement loadPageDataSync for onRenderBody in gatsby-ssr #29734

Merged
merged 3 commits into from
Feb 24, 2021

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Feb 24, 2021

Description

#29396 removed implementation completely (replaced with just throwing error). With #29560 we can backtrack that removal and continue to support it (but just disable incremental html writes in future builds when it's used).

This result in warning message (when loadPageDataSync is ever used for page that is not being currently generated):

Screenshot 2021-02-24 at 13 44 25

I also added special case when getting page-data for current page as we can avoid using fs in that case as we already have page-data - that's happy path - we don't have to disable incremental html writes in that case:

Screenshot 2021-02-24 at 13 43 57

Related Issues

[ch25749]

@pieh pieh added the topic: build Related to the Gatsby build process label Feb 24, 2021
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Feb 24, 2021
Copy link
Contributor

@vladar vladar left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍 Pretty cool that we display a deprecation warning for this scenario now.

@pieh pieh removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Feb 24, 2021
@pieh pieh merged commit 3d8a7db into master Feb 24, 2021
@pieh pieh deleted the v3/re-implement-ssr-loadPageDataSync branch February 24, 2021 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: build Related to the Gatsby build process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants