diff --git a/packages/gatsby/cache-dir/__tests__/dev-loader-lazy.js b/packages/gatsby/cache-dir/__tests__/dev-loader-lazy.js index dedcaa202dd0c..ff9df0b8d755c 100644 --- a/packages/gatsby/cache-dir/__tests__/dev-loader-lazy.js +++ b/packages/gatsby/cache-dir/__tests__/dev-loader-lazy.js @@ -29,7 +29,7 @@ describe(`Dev loader`, () => { global.__BASE_PATH__ = `` global.__PATH_PREFIX__ = `` process.env = Object.assign(process.env, { - GATSBY_EXPERIMENT_LAZY_DEVJS: true, + GATSBY_EXPERIMENTAL_LAZY_DEVJS: true, }) }) @@ -37,7 +37,7 @@ describe(`Dev loader`, () => { global.__BASE_PATH__ = originalBasePath global.__PATH_PREFIX__ = originalPathPrefix process.env = Object.assign(process.env, { - GATSBY_EXPERIMENT_LAZY_DEVJS: false, + GATSBY_EXPERIMENTAL_LAZY_DEVJS: false, }) }) diff --git a/packages/gatsby/cache-dir/app.js b/packages/gatsby/cache-dir/app.js index 9711e0d331920..9dc0e474ac081 100644 --- a/packages/gatsby/cache-dir/app.js +++ b/packages/gatsby/cache-dir/app.js @@ -14,7 +14,7 @@ import matchPaths from "$virtual/match-paths.json" window.___emitter = emitter let pageComponentRequires -if (process.env.GATSBY_EXPERIMENT_LAZY_DEVJS) { +if (process.env.GATSBY_EXPERIMENTAL_LAZY_DEVJS) { pageComponentRequires = require(`$virtual/lazy-client-sync-requires`) } else { pageComponentRequires = require(`$virtual/sync-requires`) diff --git a/packages/gatsby/cache-dir/dev-loader.js b/packages/gatsby/cache-dir/dev-loader.js index 42bc6d3754955..e40b1eb902118 100644 --- a/packages/gatsby/cache-dir/dev-loader.js +++ b/packages/gatsby/cache-dir/dev-loader.js @@ -24,7 +24,7 @@ function mergePageEntry(cachedPage, newPageData) { class DevLoader extends BaseLoader { constructor(syncRequires, matchPaths) { let loadComponent - if (process.env.GATSBY_EXPERIMENT_LAZY_DEVJS) { + if (process.env.GATSBY_EXPERIMENTAL_LAZY_DEVJS) { const ensureComponentInBundle = require(`./ensure-page-component-in-bundle`) loadComponent = chunkName => ensureComponentInBundle.default(chunkName) } else { diff --git a/packages/gatsby/cache-dir/gatsby-browser-entry.js b/packages/gatsby/cache-dir/gatsby-browser-entry.js index 7a48aab4c87fd..6110c46f8f1c5 100644 --- a/packages/gatsby/cache-dir/gatsby-browser-entry.js +++ b/packages/gatsby/cache-dir/gatsby-browser-entry.js @@ -20,7 +20,7 @@ const StaticQueryContext = React.createContext({}) function StaticQueryDataRenderer({ staticQueryData, data, query, render }) { let combinedStaticQueryData = staticQueryData - if (process.env.GATSBY_EXPERIMENT_LAZY_DEVJS) { + if (process.env.GATSBY_EXPERIMENTAL_LAZY_DEVJS) { // when we remove the flag, we don't need to combine them // w/ changes @pieh made. combinedStaticQueryData = { @@ -83,7 +83,7 @@ useStaticQuery(graphql\`${query}\`); } let queryNotFound = false - if (process.env.GATSBY_EXPERIMENT_LAZY_DEVJS) { + if (process.env.GATSBY_EXPERIMENTAL_LAZY_DEVJS) { // Merge data loaded via socket.io & xhr // when we remove the flag, we don't need to combine them // w/ changes @pieh made. diff --git a/packages/gatsby/cache-dir/loader.js b/packages/gatsby/cache-dir/loader.js index 2a37a88da6ded..bf2c925114603 100644 --- a/packages/gatsby/cache-dir/loader.js +++ b/packages/gatsby/cache-dir/loader.js @@ -144,7 +144,7 @@ export class BaseLoader { // In development, check if the page is in the bundle yet. if ( process.env.NODE_ENV === `development` && - process.env.GATSBY_EXPERIMENT_LAZY_DEVJS + process.env.GATSBY_EXPERIMENTAL_LAZY_DEVJS ) { const ensureComponentInBundle = require(`./ensure-page-component-in-bundle`) .default diff --git a/packages/gatsby/src/bootstrap/requires-writer.ts b/packages/gatsby/src/bootstrap/requires-writer.ts index fe7c67241a9c9..d607937f861df 100644 --- a/packages/gatsby/src/bootstrap/requires-writer.ts +++ b/packages/gatsby/src/bootstrap/requires-writer.ts @@ -187,7 +187,7 @@ export const writeAll = async (state: IGatsbyState): Promise => { let cleanedClientVisitedPageComponents: Array = components let notVisitedPageComponents: Array = components - if (process.env.GATSBY_EXPERIMENT_LAZY_DEVJS) { + if (process.env.GATSBY_EXPERIMENTAL_LAZY_DEVJS) { const clientVisitedPageComponents = [...state.clientVisitedPages.values()] // Remove any page components that no longer exist. cleanedClientVisitedPageComponents = components.filter(component => @@ -249,7 +249,7 @@ const preferDefault = m => (m && m.default) || m // file so we need a seperate one for each webpack instance. writeModule(`$virtual/ssr-sync-requires`, syncRequires) - if (process.env.GATSBY_EXPERIMENT_LAZY_DEVJS) { + if (process.env.GATSBY_EXPERIMENTAL_LAZY_DEVJS) { // Create file with sync requires of visited page components files. let lazyClientSyncRequires = `${hotImport} // prefer default export if available @@ -331,7 +331,7 @@ const preferDefault = m => (m && m.default) || m return true } -if (process.env.GATSBY_EXPERIMENT_LAZY_DEVJS) { +if (process.env.GATSBY_EXPERIMENTAL_LAZY_DEVJS) { /** * Start listening to CREATE_CLIENT_VISITED_PAGE events so we can rewrite * files as required diff --git a/packages/gatsby/src/utils/start-server.ts b/packages/gatsby/src/utils/start-server.ts index c71155388606c..b478c2de1cb01 100644 --- a/packages/gatsby/src/utils/start-server.ts +++ b/packages/gatsby/src/utils/start-server.ts @@ -127,7 +127,7 @@ export async function startServer( let cancelDevJSNotice: CancelExperimentNoticeCallbackOrUndefined if ( process.env.gatsby_executing_command === `develop` && - !process.env.GATSBY_EXPERIMENT_DEVJS_LAZY && + !process.env.GATSBY_EXPERIMENTAL_LAZY_DEVJS && !isCI() ) { cancelDevJSNotice = showExperimentNoticeAfterTimeout( @@ -139,7 +139,7 @@ Your friendly Gatsby maintainers detected your site takes longer than ideal to b 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. -GATSBY_EXPERIMENT_DEVJS_LAZY=true gatsby develop +GATSBY_EXPERIMENTAL_LAZY_DEVJS=true gatsby develop Please do let us know how it goes (good, bad, or otherwise) at https://gatsby.dev/lazy-devjs-umbrella `), @@ -157,7 +157,7 @@ Please do let us know how it goes (good, bad, or otherwise) at https://gatsby.de const compiler = webpack(devConfig) - if (process.env.GATSBY_EXPERIMENT_LAZY_DEVJS) { + if (process.env.GATSBY_EXPERIMENTAL_LAZY_DEVJS) { const bodyParser = require(`body-parser`) const { boundActionCreators } = require(`../redux/actions`) const { createClientVisitedPage } = boundActionCreators