From 2120978a2a31235509f54bd18e6c195d9566a8d1 Mon Sep 17 00:00:00 2001 From: Daragh Lowe Date: Fri, 1 Mar 2024 16:26:29 +0000 Subject: [PATCH 1/2] feat: update next config for isr beta enablement process --- next.config.mjs | 28 +++++++--------------------- package-lock.json | 13 +++++++++++++ package.json | 1 + 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/next.config.mjs b/next.config.mjs index 515d190..ddeb6b6 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,20 +1,7 @@ import { withFaust, getWpHostname } from '@faustwp/core'; import withMarkdoc from '@markdoc/next.js' import withSearch from './markdoc/search.mjs' -import { createRequire } from "module"; - -const require = createRequire(import.meta.url); - -const getAtlasCacheHandler = async ( config = {} ) => { - if (process.env.ATLAS_CACHE_HANDLER_ENABLED === undefined) { - return { ...config }; - } - - return { ...config, ...{ - incrementalCacheHandlerPath: require.resolve('./.atlas/atlas-cache-handler.js'), - isrMemoryCacheSize: 0, - } }; -} +import { withAtlasConfig } from "@wpengine/atlas-next" const getHeaders = async () => { return [ @@ -35,7 +22,6 @@ const nextConfig = { pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'mdx'], experimental: { scrollRestoration: true, - ...(await getAtlasCacheHandler()), }, trailingSlash: true, images: { @@ -45,10 +31,10 @@ const nextConfig = { }; -export default withFaust( - withSearch( +export default withAtlasConfig(withFaust( + withSearch( withMarkdoc({ - schemaPath: './src/markdoc' - })( nextConfig ) - ) -); + schemaPath: './src/markdoc' + })( nextConfig ) + ) +)); diff --git a/package-lock.json b/package-lock.json index 1f03e48..8a50c98 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,6 +30,7 @@ "@radix-ui/react-tabs": "^1.0.4", "@sindresorhus/slugify": "^2.1.1", "@tailwindcss/typography": "^0.5.8", + "@wpengine/atlas-next": "^1.0.0", "acorn": "^8.8.1", "algoliasearch": "^4.14.2", "allotment": "^1.19.3", @@ -5635,6 +5636,18 @@ "node": ">=12" } }, + "node_modules/@wpengine/atlas-next": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@wpengine/atlas-next/-/atlas-next-1.0.0.tgz", + "integrity": "sha512-eqrwYCGiaKIuMziIGnEe2hdEJeaFwZrmgOgXGk68qYsAmEaofN/BKU1tZyyKClgcKNeDl+n4SFAAYR/EfjP9TQ==", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "next": ">=12.2.0 ", + "node-fetch": ">=2.6.1 <3" + } + }, "node_modules/@wry/context": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.7.4.tgz", diff --git a/package.json b/package.json index 20b2e67..ad892b8 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "@radix-ui/react-tabs": "^1.0.4", "@sindresorhus/slugify": "^2.1.1", "@tailwindcss/typography": "^0.5.8", + "@wpengine/atlas-next": "^1.0.0", "acorn": "^8.8.1", "algoliasearch": "^4.14.2", "allotment": "^1.19.3", From 42d4167ca17ce54c1dc134321a247c4c9be58051 Mon Sep 17 00:00:00 2001 From: Daragh Lowe Date: Fri, 1 Mar 2024 16:38:17 +0000 Subject: [PATCH 2/2] fix: formatting of the withConfig --- next.config.mjs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/next.config.mjs b/next.config.mjs index ddeb6b6..2182d78 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -31,10 +31,11 @@ const nextConfig = { }; -export default withAtlasConfig(withFaust( - withSearch( - withMarkdoc({ - schemaPath: './src/markdoc' - })( nextConfig ) - ) +export default withAtlasConfig( + withFaust( + withSearch( + withMarkdoc({ + schemaPath: './src/markdoc' + })( nextConfig ) + ) ));