Skip to content

Commit f04304e

Browse files
GatsbyJS BotKyleAMathews
GatsbyJS Bot
andauthored
feat(gatsby): Partially release develop SSR to 5% (#28844) (#28859)
* feat(gatsby): Partially release develop SSR to 5% * Fix typescript lint (cherry picked from commit 6b8cd5d) Co-authored-by: Kyle Mathews <[email protected]>
1 parent ceeb7d4 commit f04304e

File tree

2 files changed

+10
-23
lines changed

2 files changed

+10
-23
lines changed

packages/gatsby/src/services/initialize.ts

-21
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import telemetry from "gatsby-telemetry"
1010
import apiRunnerNode from "../utils/api-runner-node"
1111
import handleFlags from "../utils/handle-flags"
1212
import { getBrowsersList } from "../utils/browserslist"
13-
import { showExperimentNoticeAfterTimeout } from "../utils/show-experiment-notice"
14-
import sampleSiteForExperiment from "../utils/sample-site-for-experiment"
1513
import { Store, AnyAction } from "redux"
1614
import { preferDefault } from "../bootstrap/prefer-default"
1715
import * as WorkerPool from "../utils/worker/pool"
@@ -58,25 +56,6 @@ Please give feedback on their respective umbrella issues!
5856
telemetry.trackFeatureIsUsed(`FastDev`)
5957
}
6058

61-
if (
62-
process.env.gatsby_executing_command === `develop` &&
63-
!process.env.GATSBY_EXPERIMENTAL_DEV_SSR &&
64-
!isCI() &&
65-
sampleSiteForExperiment(`DEV_SSR`, 5)
66-
) {
67-
showExperimentNoticeAfterTimeout(
68-
`Server Side Rendering (SSR) in Development`,
69-
`gatsby.dev/dev-ssr-feedback`,
70-
`which helps surface issues with build errors more quickly. Here's how to try it:
71-
72-
module.exports = {
73-
flags : { DEV_SSR: true },
74-
plugins: [...]
75-
}`,
76-
1 // Show this immediately to the subset of sites selected.
77-
)
78-
}
79-
8059
// Show stack trace on unhandled promises.
8160
process.on(`unhandledRejection`, (reason: unknown) => {
8261
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/33636

packages/gatsby/src/utils/flags.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import _ from "lodash"
22
import semver from "semver"
33

4+
import sampleSiteForExperiment from "./sample-site-for-experiment"
5+
46
// Does this experiment run for only builds
57
type executingCommand = "build" | "develop" | "all"
68

@@ -90,9 +92,15 @@ const activeFlags: Array<IFlag> = [
9092
command: `develop`,
9193
telemetryId: `DevSsr`,
9294
experimental: false,
93-
description: `SSR pages on full reloads during develop. Helps you detect SSR bugs and fix them without needing to do full builds.`,
95+
description: `Server Side Render (SSR) pages on full reloads during develop. Helps you detect SSR bugs and fix them without needing to do full builds.`,
9496
umbrellaIssue: `https://gatsby.dev/dev-ssr-feedback`,
95-
testFitness: (): fitnessEnum => true,
97+
testFitness: (): fitnessEnum => {
98+
if (sampleSiteForExperiment(`DEV_SSR`, 5)) {
99+
return `OPT_IN`
100+
} else {
101+
return true
102+
}
103+
},
96104
},
97105
{
98106
name: `QUERY_ON_DEMAND`,

0 commit comments

Comments
 (0)