Skip to content

Commit 9e3ceec

Browse files
authored
fix(gatsby): rename env var for lazy dev bundling to make consistent with other experiments (#28150)
1 parent a612f26 commit 9e3ceec

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

packages/gatsby/cache-dir/__tests__/dev-loader-lazy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ describe(`Dev loader`, () => {
2929
global.__BASE_PATH__ = ``
3030
global.__PATH_PREFIX__ = ``
3131
process.env = Object.assign(process.env, {
32-
GATSBY_EXPERIMENT_LAZY_DEVJS: true,
32+
GATSBY_EXPERIMENTAL_LAZY_DEVJS: true,
3333
})
3434
})
3535

3636
afterEach(() => {
3737
global.__BASE_PATH__ = originalBasePath
3838
global.__PATH_PREFIX__ = originalPathPrefix
3939
process.env = Object.assign(process.env, {
40-
GATSBY_EXPERIMENT_LAZY_DEVJS: false,
40+
GATSBY_EXPERIMENTAL_LAZY_DEVJS: false,
4141
})
4242
})
4343

packages/gatsby/cache-dir/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import matchPaths from "$virtual/match-paths.json"
1414
window.___emitter = emitter
1515

1616
let pageComponentRequires
17-
if (process.env.GATSBY_EXPERIMENT_LAZY_DEVJS) {
17+
if (process.env.GATSBY_EXPERIMENTAL_LAZY_DEVJS) {
1818
pageComponentRequires = require(`$virtual/lazy-client-sync-requires`)
1919
} else {
2020
pageComponentRequires = require(`$virtual/sync-requires`)

packages/gatsby/cache-dir/dev-loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function mergePageEntry(cachedPage, newPageData) {
2424
class DevLoader extends BaseLoader {
2525
constructor(syncRequires, matchPaths) {
2626
let loadComponent
27-
if (process.env.GATSBY_EXPERIMENT_LAZY_DEVJS) {
27+
if (process.env.GATSBY_EXPERIMENTAL_LAZY_DEVJS) {
2828
const ensureComponentInBundle = require(`./ensure-page-component-in-bundle`)
2929
loadComponent = chunkName => ensureComponentInBundle.default(chunkName)
3030
} else {

packages/gatsby/cache-dir/gatsby-browser-entry.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const StaticQueryContext = React.createContext({})
2020
function StaticQueryDataRenderer({ staticQueryData, data, query, render }) {
2121
let combinedStaticQueryData = staticQueryData
2222

23-
if (process.env.GATSBY_EXPERIMENT_LAZY_DEVJS) {
23+
if (process.env.GATSBY_EXPERIMENTAL_LAZY_DEVJS) {
2424
// when we remove the flag, we don't need to combine them
2525
// w/ changes @pieh made.
2626
combinedStaticQueryData = {
@@ -83,7 +83,7 @@ useStaticQuery(graphql\`${query}\`);
8383
}
8484

8585
let queryNotFound = false
86-
if (process.env.GATSBY_EXPERIMENT_LAZY_DEVJS) {
86+
if (process.env.GATSBY_EXPERIMENTAL_LAZY_DEVJS) {
8787
// Merge data loaded via socket.io & xhr
8888
// when we remove the flag, we don't need to combine them
8989
// w/ changes @pieh made.

packages/gatsby/cache-dir/loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export class BaseLoader {
144144
// In development, check if the page is in the bundle yet.
145145
if (
146146
process.env.NODE_ENV === `development` &&
147-
process.env.GATSBY_EXPERIMENT_LAZY_DEVJS
147+
process.env.GATSBY_EXPERIMENTAL_LAZY_DEVJS
148148
) {
149149
const ensureComponentInBundle = require(`./ensure-page-component-in-bundle`)
150150
.default

packages/gatsby/src/bootstrap/requires-writer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export const writeAll = async (state: IGatsbyState): Promise<boolean> => {
187187

188188
let cleanedClientVisitedPageComponents: Array<IGatsbyPageComponent> = components
189189
let notVisitedPageComponents: Array<IGatsbyPageComponent> = components
190-
if (process.env.GATSBY_EXPERIMENT_LAZY_DEVJS) {
190+
if (process.env.GATSBY_EXPERIMENTAL_LAZY_DEVJS) {
191191
const clientVisitedPageComponents = [...state.clientVisitedPages.values()]
192192
// Remove any page components that no longer exist.
193193
cleanedClientVisitedPageComponents = components.filter(component =>
@@ -249,7 +249,7 @@ const preferDefault = m => (m && m.default) || m
249249
// file so we need a seperate one for each webpack instance.
250250
writeModule(`$virtual/ssr-sync-requires`, syncRequires)
251251

252-
if (process.env.GATSBY_EXPERIMENT_LAZY_DEVJS) {
252+
if (process.env.GATSBY_EXPERIMENTAL_LAZY_DEVJS) {
253253
// Create file with sync requires of visited page components files.
254254
let lazyClientSyncRequires = `${hotImport}
255255
// prefer default export if available
@@ -331,7 +331,7 @@ const preferDefault = m => (m && m.default) || m
331331
return true
332332
}
333333

334-
if (process.env.GATSBY_EXPERIMENT_LAZY_DEVJS) {
334+
if (process.env.GATSBY_EXPERIMENTAL_LAZY_DEVJS) {
335335
/**
336336
* Start listening to CREATE_CLIENT_VISITED_PAGE events so we can rewrite
337337
* files as required

packages/gatsby/src/utils/start-server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export async function startServer(
127127
let cancelDevJSNotice: CancelExperimentNoticeCallbackOrUndefined
128128
if (
129129
process.env.gatsby_executing_command === `develop` &&
130-
!process.env.GATSBY_EXPERIMENT_DEVJS_LAZY &&
130+
!process.env.GATSBY_EXPERIMENTAL_LAZY_DEVJS &&
131131
!isCI()
132132
) {
133133
cancelDevJSNotice = showExperimentNoticeAfterTimeout(
@@ -139,7 +139,7 @@ Your friendly Gatsby maintainers detected your site takes longer than ideal to b
139139
140140
If you're interested in trialing out one of these future improvements *today* which should make your local development experience faster, go ahead and run your site with LAZY_DEVJS enabled.
141141
142-
GATSBY_EXPERIMENT_DEVJS_LAZY=true gatsby develop
142+
GATSBY_EXPERIMENTAL_LAZY_DEVJS=true gatsby develop
143143
144144
Please do let us know how it goes (good, bad, or otherwise) at https://gatsby.dev/lazy-devjs-umbrella
145145
`),
@@ -157,7 +157,7 @@ Please do let us know how it goes (good, bad, or otherwise) at https://gatsby.de
157157

158158
const compiler = webpack(devConfig)
159159

160-
if (process.env.GATSBY_EXPERIMENT_LAZY_DEVJS) {
160+
if (process.env.GATSBY_EXPERIMENTAL_LAZY_DEVJS) {
161161
const bodyParser = require(`body-parser`)
162162
const { boundActionCreators } = require(`../redux/actions`)
163163
const { createClientVisitedPage } = boundActionCreators

0 commit comments

Comments
 (0)