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): Partially release develop SSR to 5% (#28844) #28859

Merged
merged 1 commit into from
Jan 5, 2021
Merged
Show file tree
Hide file tree
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
21 changes: 0 additions & 21 deletions packages/gatsby/src/services/initialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import telemetry from "gatsby-telemetry"
import apiRunnerNode from "../utils/api-runner-node"
import handleFlags from "../utils/handle-flags"
import { getBrowsersList } from "../utils/browserslist"
import { showExperimentNoticeAfterTimeout } from "../utils/show-experiment-notice"
import sampleSiteForExperiment from "../utils/sample-site-for-experiment"
import { Store, AnyAction } from "redux"
import { preferDefault } from "../bootstrap/prefer-default"
import * as WorkerPool from "../utils/worker/pool"
Expand Down Expand Up @@ -58,25 +56,6 @@ Please give feedback on their respective umbrella issues!
telemetry.trackFeatureIsUsed(`FastDev`)
}

if (
process.env.gatsby_executing_command === `develop` &&
!process.env.GATSBY_EXPERIMENTAL_DEV_SSR &&
!isCI() &&
sampleSiteForExperiment(`DEV_SSR`, 5)
) {
showExperimentNoticeAfterTimeout(
`Server Side Rendering (SSR) in Development`,
`gatsby.dev/dev-ssr-feedback`,
`which helps surface issues with build errors more quickly. Here's how to try it:

module.exports = {
flags : { DEV_SSR: true },
plugins: [...]
}`,
1 // Show this immediately to the subset of sites selected.
)
}

// Show stack trace on unhandled promises.
process.on(`unhandledRejection`, (reason: unknown) => {
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/33636
Expand Down
12 changes: 10 additions & 2 deletions packages/gatsby/src/utils/flags.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import _ from "lodash"
import semver from "semver"

import sampleSiteForExperiment from "./sample-site-for-experiment"

// Does this experiment run for only builds
type executingCommand = "build" | "develop" | "all"

Expand Down Expand Up @@ -90,9 +92,15 @@ const activeFlags: Array<IFlag> = [
command: `develop`,
telemetryId: `DevSsr`,
experimental: false,
description: `SSR pages on full reloads during develop. Helps you detect SSR bugs and fix them without needing to do full builds.`,
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.`,
umbrellaIssue: `https://gatsby.dev/dev-ssr-feedback`,
testFitness: (): fitnessEnum => true,
testFitness: (): fitnessEnum => {
if (sampleSiteForExperiment(`DEV_SSR`, 5)) {
return `OPT_IN`
} else {
return true
}
},
},
{
name: `QUERY_ON_DEMAND`,
Expand Down