fix: re-implement loadPageDataSync for onRenderBody in gatsby-ssr #29734
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.
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):I also added special case when getting page-data for current page as we can avoid using
fs
in that case as we already havepage-data
- that's happy path - we don't have to disable incremental html writes in that case:Related Issues
[ch25749]