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): add partial hydration flag #36436

Merged
merged 5 commits into from
Aug 25, 2022
Merged
Changes from all commits
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
23 changes: 23 additions & 0 deletions packages/gatsby/src/utils/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,27 @@ const activeFlags: Array<IFlag> = [
},
]

if (_CFLAGS_.GATSBY_MAJOR === `5`) {
activeFlags.push({
name: `PARTIAL_HYDRATION`,
env: `GATSBY_PARTIAL_HYDRATION`,
command: `build`,
telemetryId: `PartialHydration`,
description: `Enable partial hydration to reduce Total Blocking Time and Time To Interactive `,
umbrellaIssue: `https://gatsby.dev/partial-hydration-umbrella-issue`,
experimental: true,
testFitness: (): fitnessEnum => {
const v18Constraint = {
react: `>=18.0.0`,
}
const v0Constraint = {
react: `0.0.0`,
}

return satisfiesSemvers(v18Constraint) || satisfiesSemvers(v0Constraint)
},
requires: `Requires React v18 or above.`,
})
}

export default activeFlags