Skip to content

Commit 41de1f0

Browse files
marvinjudewardpeet
andauthored
feat(gatsby): add partial hydration flag (#36436)
* add partial hydration flag * delete pkjson update * adjust flag * dry constraint check * Update packages/gatsby/src/utils/flags.ts Co-authored-by: Ward Peeters <[email protected]>
1 parent b8c2072 commit 41de1f0

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

packages/gatsby/src/utils/flags.ts

+23
Original file line numberDiff line numberDiff line change
@@ -236,4 +236,27 @@ const activeFlags: Array<IFlag> = [
236236
},
237237
]
238238

239+
if (_CFLAGS_.GATSBY_MAJOR === `5`) {
240+
activeFlags.push({
241+
name: `PARTIAL_HYDRATION`,
242+
env: `GATSBY_PARTIAL_HYDRATION`,
243+
command: `build`,
244+
telemetryId: `PartialHydration`,
245+
description: `Enable partial hydration to reduce Total Blocking Time and Time To Interactive `,
246+
umbrellaIssue: `https://gatsby.dev/partial-hydration-umbrella-issue`,
247+
experimental: true,
248+
testFitness: (): fitnessEnum => {
249+
const v18Constraint = {
250+
react: `>=18.0.0`,
251+
}
252+
const v0Constraint = {
253+
react: `0.0.0`,
254+
}
255+
256+
return satisfiesSemvers(v18Constraint) || satisfiesSemvers(v0Constraint)
257+
},
258+
requires: `Requires React v18 or above.`,
259+
})
260+
}
261+
239262
export default activeFlags

0 commit comments

Comments
 (0)