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

feat(gatsby): Partial hydration router integration #36616

Merged
merged 16 commits into from
Sep 30, 2022

Conversation

tyhopp
Copy link
Contributor

@tyhopp tyhopp commented Sep 15, 2022

Description

Use router during partial hydration rendering:

  • Make location available as props in page components
  • Make useLocation hook available in children
  • Support pathPrefix feature

Documentation

N/A

Related Issues

[sc-55227]

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Sep 15, 2022
@tyhopp tyhopp marked this pull request as draft September 15, 2022 08:52
@tyhopp tyhopp added topic: core Relates to Gatsby's core (e.g. page loading, reporter, state machine) and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Sep 15, 2022
@LekoArts LekoArts added this to the Gatsby 5 milestone Sep 15, 2022
@tyhopp tyhopp marked this pull request as ready for review September 20, 2022 04:03
Base automatically changed from feat/partial-hydration-error-handling to feat/partial-hydration-webpack September 20, 2022 08:35
Base automatically changed from feat/partial-hydration-webpack to master September 21, 2022 11:39
@tyhopp tyhopp force-pushed the feat/partial-hydration-router-integration branch from 6ad0de8 to 74ec47b Compare September 26, 2022 02:21
@tyhopp tyhopp marked this pull request as draft September 26, 2022 03:28
@tyhopp tyhopp force-pushed the feat/partial-hydration-router-integration branch from 5b4aaf8 to 5b5880f Compare September 29, 2022 05:35
import {
navigate as reachNavigate,
globalHistory,
} from "@gatsbyjs/reach-router"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exported from reach router index in v1 and v2

@@ -9,7 +9,7 @@ import { grabMatchParams } from "./find-path"
import syncRequires from "$virtual/ssr-sync-requires"

import { RouteAnnouncerProps } from "./route-announcer-props"
import { ServerLocation, Router, isRedirect } from "@reach/router"
import { ServerLocation, Router, isRedirect } from "@gatsbyjs/reach-router"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This uses our alias @reach/router > @gatsbyjs/reach-router, clarify import now since we'll remove the alias in Gatsby 5

@tyhopp tyhopp marked this pull request as ready for review September 29, 2022 09:31
@tyhopp tyhopp merged commit 2aa8325 into master Sep 30, 2022
@tyhopp tyhopp deleted the feat/partial-hydration-router-integration branch September 30, 2022 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: core Relates to Gatsby's core (e.g. page loading, reporter, state machine)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants