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): split up head & page component loading #36545

Merged
merged 2 commits into from
Sep 7, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
use partial hydration env in loader
  • Loading branch information
marvinjude authored and wardpeet committed Sep 6, 2022
commit d9f4619483d4332462096089e96179b0a9716c73
4 changes: 4 additions & 0 deletions packages/gatsby/cache-dir/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,10 @@ const createComponentUrls = componentChunkName =>
export class ProdLoader extends BaseLoader {
constructor(asyncRequires, matchPaths, pageData) {
const loadComponent = (chunkName, exportType = `components`) => {
if (!global.hasPartialHydration) {
Copy link
Contributor

@pieh pieh Sep 6, 2022

Choose a reason for hiding this comment

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

is global.hasPartialHydration being set somewhere? I don't see it anywhere in existing code in master (yet)

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 will be available with partialHydration #36485

exportType = `components`
}

if (!asyncRequires[exportType][chunkName]) {
throw new Error(
`We couldn't find the correct component chunk with the name "${chunkName}"`
Expand Down