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

chore(gatsby): Add loadPageDataSync property to onRenderBody TS type #36492

Merged
merged 2 commits into from
Sep 12, 2022
Merged

chore(gatsby): Add loadPageDataSync property to onRenderBody TS type #36492

merged 2 commits into from
Sep 12, 2022

Conversation

openscript
Copy link
Contributor

@openscript openscript commented Aug 30, 2022

Description

According to #35841 (reply in thread) there is a loadPageDataSync function, which returns the page context to the corresponding pathname. So far this was not reflected in the type definitions, what is changed with this PR.

Documentation

Related Issues

Related to #36354

According to #35841 (reply in thread) there is a `loadPageDataSync` function, which returns the page context to the corresponding `pathname`. So far this was not reflected in the type definitions, what is changed with this PR.
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Aug 30, 2022
@imjoshin imjoshin added topic: TypeScript Issues and PRs related to TS in general, public typings or gatsby-plugin-typescript and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Aug 30, 2022
@LekoArts LekoArts changed the title feat(gatsby): expose loadPageDataSync chore(gatsby): Add loadPageDataSync property to onRenderBody TS type Sep 12, 2022
Remove generic context as it can be different for each pathname.
@LekoArts LekoArts added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Sep 12, 2022
@gatsbybot gatsbybot merged commit 696427e into gatsbyjs:master Sep 12, 2022
@openscript
Copy link
Contributor Author

@LekoArts Is loadPageDataSync really exported to onRenderBody?

When I console logged the first parameter I got:

{
  setHeadComponents: [Function: setHeadComponents],
  setHtmlAttributes: [Function: setHtmlAttributes],
  setBodyAttributes: [Function: setBodyAttributes],
  setPreBodyComponents: [Function: setPreBodyComponents],
  setPostBodyComponents: [Function: setPostBodyComponents],
  setBodyProps: [Function: setBodyProps],
  pathname: '/'
}

.. and my integration testing shows: WebpackError: ReferenceError: loadPageDataSync is not defined (from plugin: gatsby-plugin-i18n-l10n)

Am I understanding something wrong here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes topic: TypeScript Issues and PRs related to TS in general, public typings or gatsby-plugin-typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants