Skip to content

Commit d8c948c

Browse files
GatsbyJS Botwardpeet
andauthored
feat(gatsby): remove concurrent-features flag and depend on export (#31818) (#31830)
(cherry picked from commit 34b6d47) Co-authored-by: Ward Peeters <[email protected]>
1 parent 2a4ea62 commit d8c948c

File tree

3 files changed

+6
-41
lines changed

3 files changed

+6
-41
lines changed

packages/gatsby/cache-dir/app.js

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,6 @@ module.hot.accept([
3131

3232
window.___emitter = emitter
3333

34-
if (
35-
process.env.GATSBY_EXPERIMENTAL_CONCURRENT_FEATURES &&
36-
!ReactDOM.createRoot
37-
) {
38-
throw new Error(
39-
`The GATSBY_EXPERIMENTAL_CONCURRENT_FEATURES flag is not compatible with your React version. Please install "[email protected]" and "[email protected]" or higher.`
40-
)
41-
}
42-
4334
const loader = new DevLoader(asyncRequires, matchPaths)
4435
setLoader(loader)
4536
loader.setApiRunner(apiRunner)
@@ -141,10 +132,7 @@ apiRunnerAsync(`onClientEntry`).then(() => {
141132
// render to avoid React complaining about hydration mis-matches.
142133
let defaultRenderer = ReactDOM.render
143134
if (focusEl && focusEl.children.length) {
144-
if (
145-
process.env.GATSBY_EXPERIMENTAL_CONCURRENT_FEATURES &&
146-
ReactDOM.createRoot
147-
) {
135+
if (ReactDOM.createRoot) {
148136
defaultRenderer = ReactDOM.createRoot
149137
} else {
150138
defaultRenderer = ReactDOM.hydrate
@@ -208,7 +196,10 @@ apiRunnerAsync(`onClientEntry`).then(() => {
208196
<LoadingIndicatorEventHandler />
209197
)
210198
} else {
211-
renderer(<LoadingIndicatorEventHandler />, indicatorMountElement)
199+
ReactDOM.render(
200+
<LoadingIndicatorEventHandler />,
201+
indicatorMountElement
202+
)
212203
}
213204
}
214205
}

packages/gatsby/cache-dir/production-app.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,7 @@ apiRunnerAsync(`onClientEntry`).then(() => {
193193
const renderer = apiRunner(
194194
`replaceHydrateFunction`,
195195
undefined,
196-
process.env.GATSBY_EXPERIMENTAL_CONCURRENT_FEATURES
197-
? ReactDOM.createRoot
198-
: ReactDOM.hydrate
196+
ReactDOM.createRoot ? ReactDOM.createRoot : ReactDOM.hydrate
199197
)[0]
200198

201199
domReady(() => {

packages/gatsby/src/utils/flags.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -182,30 +182,6 @@ const activeFlags: Array<IFlag> = [
182182
umbrellaIssue: `https://gatsby.dev/functions-feedback`,
183183
testFitness: (): fitnessEnum => `LOCKED_IN`,
184184
},
185-
{
186-
name: `CONCURRENT_FEATURES`,
187-
env: `GATSBY_EXPERIMENTAL_CONCURRENT_FEATURES`,
188-
command: `all`,
189-
telemetryId: `ConcurrentFeatures`,
190-
experimental: true,
191-
description: `Enable React's concurrent features`,
192-
// umbrellaIssue: `https://gatsby.dev/concurrent-features`,
193-
testFitness: (): fitnessEnum => {
194-
// Because of this, this flag will never show up
195-
const semverConstraints = {
196-
react: `^0.0.0-experimental-2bf4805e4`,
197-
"react-dom": `^0.0.0-experimental-2bf4805e4`,
198-
}
199-
200-
if (satisfiesSemvers(semverConstraints)) {
201-
return true
202-
} else {
203-
// react & react-dom is either not installed or not new enough so
204-
// just disable — it won't work anyways.
205-
return false
206-
}
207-
},
208-
},
209185
{
210186
name: `LMDB_STORE`,
211187
env: `GATSBY_EXPERIMENTAL_LMDB_STORE`,

0 commit comments

Comments
 (0)