forked from gatsbyjs/gatsby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(gatsby): fix partial hydration constraints (gatsbyjs#36468)
* fix(gatsby): fix partial hydration constraints * Update flags.ts * Update flags.ts * lint
- Loading branch information
Showing
1 changed file
with
14 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -184,14 +184,7 @@ const activeFlags: Array<IFlag> = [ | |
experimental: true, | ||
umbrellaIssue: `https://gatsby.dev/lmdb-feedback`, | ||
description: `Store nodes in a persistent embedded database (vs in-memory). Lowers peak memory usage. Requires Node v14.10 or above.`, | ||
testFitness: (): fitnessEnum => { | ||
if (_CFLAGS_.GATSBY_MAJOR === `4`) { | ||
return `LOCKED_IN` | ||
} | ||
|
||
const [major, minor] = process.versions.node.split(`.`) | ||
return (Number(major) === 14 && Number(minor) >= 10) || Number(major) > 14 | ||
}, | ||
testFitness: (): fitnessEnum => `LOCKED_IN`, | ||
requires: `Requires Node v14.10 or above.`, | ||
}, | ||
{ | ||
|
@@ -203,14 +196,7 @@ const activeFlags: Array<IFlag> = [ | |
umbrellaIssue: `https://gatsby.dev/pqr-feedback`, | ||
description: `Parallelize running page queries in order to better saturate all available cores. Improves time it takes to run queries during gatsby build. Requires Node v14.10 or above.`, | ||
includedFlags: [`LMDB_STORE`], | ||
testFitness: (): fitnessEnum => { | ||
if (_CFLAGS_.GATSBY_MAJOR === `4`) { | ||
return `LOCKED_IN` | ||
} | ||
|
||
const [major, minor] = process.versions.node.split(`.`) | ||
return (Number(major) === 14 && Number(minor) >= 10) || Number(major) > 14 | ||
}, | ||
testFitness: (): fitnessEnum => `LOCKED_IN`, | ||
requires: `Requires Node v14.10 or above.`, | ||
}, | ||
{ | ||
|
@@ -234,10 +220,7 @@ const activeFlags: Array<IFlag> = [ | |
testFitness: (): fitnessEnum => false, | ||
requires: `As of [email protected] this feature is available as a config option inside gatsby-config. Learn more at https://gatsby.dev/graphql-typegen`, | ||
}, | ||
] | ||
|
||
if (_CFLAGS_.GATSBY_MAJOR === `5`) { | ||
activeFlags.push({ | ||
{ | ||
name: `PARTIAL_HYDRATION`, | ||
env: `GATSBY_PARTIAL_HYDRATION`, | ||
command: `build`, | ||
|
@@ -250,13 +233,19 @@ if (_CFLAGS_.GATSBY_MAJOR === `5`) { | |
react: `>=18.0.0`, | ||
} | ||
const v0Constraint = { | ||
react: `0.0.0`, | ||
react: `^0.0.0`, | ||
} | ||
|
||
return satisfiesSemvers(v18Constraint) || satisfiesSemvers(v0Constraint) | ||
return ( | ||
_CFLAGS_.GATSBY_MAJOR === `5` && | ||
(satisfiesSemvers(v18Constraint) || satisfiesSemvers(v0Constraint)) | ||
) | ||
}, | ||
requires: `Requires React v18 or above.`, | ||
}) | ||
} | ||
requires: | ||
Number(_CFLAGS_.GATSBY_MAJOR) < 5 | ||
? `Partial hydration is only available in Gatsby V5. Please upgrade Gatsby.` | ||
: `Partial hydration requires React 18+ to work.`, | ||
}, | ||
] | ||
|
||
export default activeFlags |