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): enable all dev improvements with one env var #28166

Merged
merged 3 commits into from
Nov 19, 2020
Merged
Changes from 2 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
30 changes: 26 additions & 4 deletions packages/gatsby/src/services/initialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,28 @@ interface IPluginResolution {
options: IPluginInfoOptions
}

// If the env variable GATSBY_EXPERIMENTAL_FAST_DEV is set, enable
// all DEV experimental changes (but only during development & not on CI).
if (
process.env.gatsby_executing_command === `develop` &&
process.env.GATSBY_EXPERIMENTAL_FAST_DEV &&
!isCI()
) {
process.env.GATSBY_EXPERIMENTAL_LAZY_DEVJS = `true`
process.env.GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND = `true`
process.env.GATSBY_EXPERIMENTAL_DEV_SSR = `true`

reporter.info(`
Three fast dev experiments are enabled, Lazy Bundling, Query on Demand, and Development SSR.

Please give feedback on their respective umbrella issues!

- https://gatsby.dev/lazy-devjs-umbrella
- https://gatsby.dev/query-on-demand-feedback
- https://gatsby.dev/dev-ssr-feedback
`)
}

if (
process.env.gatsby_executing_command === `develop` &&
!process.env.GATSBY_EXPERIMENTAL_DEV_SSR &&
Expand Down Expand Up @@ -200,13 +222,13 @@ export async function initialize({
`Experimental Query on Demand feature is not available in CI environment. Continuing with regular mode.`
)
} else {
reporter.info(`Using experimental Query on Demand feature`)
// We already show a notice for this flag.
if (!process.env.GATSBY_EXPERIMENTAL_FAST_DEV) {
reporter.info(`Using experimental Query on Demand feature`)
}
telemetry.trackFeatureIsUsed(`QueryOnDemand`)
}
}
if (process.env.GATSBY_EXPERIMENTAL_LAZY_DEVJS) {
telemetry.trackFeatureIsUsed(`ExperimentalDevSSR`)
}
pieh marked this conversation as resolved.
Show resolved Hide resolved

// run stale jobs
store.dispatch(removeStaleJobs(store.getState()))
Expand Down