diff --git a/docs/02-app/02-api-reference/02-file-conventions/01-metadata/sitemap.mdx b/docs/02-app/02-api-reference/02-file-conventions/01-metadata/sitemap.mdx index 20cccf47e98e3..2e8469433d0ac 100644 --- a/docs/02-app/02-api-reference/02-file-conventions/01-metadata/sitemap.mdx +++ b/docs/02-app/02-api-reference/02-file-conventions/01-metadata/sitemap.mdx @@ -262,9 +262,7 @@ export default async function sitemap({ id }) { } ``` -In production, your generated sitemaps will be available at `/.../sitemap/[id].xml`. For example, `/product/sitemap/1.xml`. - -In development, you can view the generated sitemap on `/.../sitemap.xml/[id]`. For example, `/product/sitemap.xml/1`. This difference is temporary and will follow the production format. +Your generated sitemaps will be available at `/.../sitemap/[id]`. For example, `/product/sitemap/1`. See the [`generateSitemaps` API reference](/docs/app/api-reference/functions/generate-sitemaps) for more information. diff --git a/lerna.json b/lerna.json index e2bfbf20d9e3e..66db61c5e6219 100644 --- a/lerna.json +++ b/lerna.json @@ -16,5 +16,5 @@ "registry": "https://registry.npmjs.org/" } }, - "version": "14.3.0-canary.51" + "version": "14.3.0-canary.52" } diff --git a/packages/create-next-app/package.json b/packages/create-next-app/package.json index 2917c7f905db5..02bf66ed88bf0 100644 --- a/packages/create-next-app/package.json +++ b/packages/create-next-app/package.json @@ -1,6 +1,6 @@ { "name": "create-next-app", - "version": "14.3.0-canary.51", + "version": "14.3.0-canary.52", "keywords": [ "react", "next", diff --git a/packages/eslint-config-next/package.json b/packages/eslint-config-next/package.json index 4bb379eeea706..d98440d19bc02 100644 --- a/packages/eslint-config-next/package.json +++ b/packages/eslint-config-next/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-next", - "version": "14.3.0-canary.51", + "version": "14.3.0-canary.52", "description": "ESLint configuration used by Next.js.", "main": "index.js", "license": "MIT", @@ -10,7 +10,7 @@ }, "homepage": "https://nextjs.org/docs/app/building-your-application/configuring/eslint#eslint-config", "dependencies": { - "@next/eslint-plugin-next": "14.3.0-canary.51", + "@next/eslint-plugin-next": "14.3.0-canary.52", "@rushstack/eslint-patch": "^1.3.3", "@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || 7.0.0 - 7.2.0", "eslint-import-resolver-node": "^0.3.6", diff --git a/packages/eslint-plugin-next/package.json b/packages/eslint-plugin-next/package.json index 7bcbd70bb8a0d..ee45d92429d51 100644 --- a/packages/eslint-plugin-next/package.json +++ b/packages/eslint-plugin-next/package.json @@ -1,6 +1,6 @@ { "name": "@next/eslint-plugin-next", - "version": "14.3.0-canary.51", + "version": "14.3.0-canary.52", "description": "ESLint plugin for Next.js.", "main": "dist/index.js", "license": "MIT", diff --git a/packages/font/package.json b/packages/font/package.json index 1d7526a73c2d0..9812039d3d220 100644 --- a/packages/font/package.json +++ b/packages/font/package.json @@ -1,6 +1,6 @@ { "name": "@next/font", - "version": "14.3.0-canary.51", + "version": "14.3.0-canary.52", "repository": { "url": "vercel/next.js", "directory": "packages/font" diff --git a/packages/next-bundle-analyzer/package.json b/packages/next-bundle-analyzer/package.json index cb1e1a932df72..2fd08740950f3 100644 --- a/packages/next-bundle-analyzer/package.json +++ b/packages/next-bundle-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "@next/bundle-analyzer", - "version": "14.3.0-canary.51", + "version": "14.3.0-canary.52", "main": "index.js", "types": "index.d.ts", "license": "MIT", diff --git a/packages/next-codemod/package.json b/packages/next-codemod/package.json index 5ba76d71eac2c..723c693bb3368 100644 --- a/packages/next-codemod/package.json +++ b/packages/next-codemod/package.json @@ -1,6 +1,6 @@ { "name": "@next/codemod", - "version": "14.3.0-canary.51", + "version": "14.3.0-canary.52", "license": "MIT", "repository": { "type": "git", diff --git a/packages/next-env/package.json b/packages/next-env/package.json index 352e71cc097dd..429f40b62f131 100644 --- a/packages/next-env/package.json +++ b/packages/next-env/package.json @@ -1,6 +1,6 @@ { "name": "@next/env", - "version": "14.3.0-canary.51", + "version": "14.3.0-canary.52", "keywords": [ "react", "next", diff --git a/packages/next-mdx/package.json b/packages/next-mdx/package.json index a1b5a97298731..d3b86d5b9625e 100644 --- a/packages/next-mdx/package.json +++ b/packages/next-mdx/package.json @@ -1,6 +1,6 @@ { "name": "@next/mdx", - "version": "14.3.0-canary.51", + "version": "14.3.0-canary.52", "main": "index.js", "license": "MIT", "repository": { diff --git a/packages/next-plugin-storybook/package.json b/packages/next-plugin-storybook/package.json index 335bb7e4befaa..7afd88727c8a3 100644 --- a/packages/next-plugin-storybook/package.json +++ b/packages/next-plugin-storybook/package.json @@ -1,6 +1,6 @@ { "name": "@next/plugin-storybook", - "version": "14.3.0-canary.51", + "version": "14.3.0-canary.52", "repository": { "url": "vercel/next.js", "directory": "packages/next-plugin-storybook" diff --git a/packages/next-polyfill-module/package.json b/packages/next-polyfill-module/package.json index 673e0a9047f12..bcf08cc5c1eed 100644 --- a/packages/next-polyfill-module/package.json +++ b/packages/next-polyfill-module/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-module", - "version": "14.3.0-canary.51", + "version": "14.3.0-canary.52", "description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)", "main": "dist/polyfill-module.js", "license": "MIT", diff --git a/packages/next-polyfill-nomodule/package.json b/packages/next-polyfill-nomodule/package.json index ce469be2eeb00..6ac2cc7045ded 100644 --- a/packages/next-polyfill-nomodule/package.json +++ b/packages/next-polyfill-nomodule/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-nomodule", - "version": "14.3.0-canary.51", + "version": "14.3.0-canary.52", "description": "A polyfill for non-dead, nomodule browsers.", "main": "dist/polyfill-nomodule.js", "license": "MIT", diff --git a/packages/next-swc/crates/next-core/src/next_app/metadata/mod.rs b/packages/next-swc/crates/next-core/src/next_app/metadata/mod.rs index 79e25d601d1e9..c8bce94a78834 100644 --- a/packages/next-swc/crates/next-core/src/next_app/metadata/mod.rs +++ b/packages/next-swc/crates/next-core/src/next_app/metadata/mod.rs @@ -306,9 +306,8 @@ pub fn normalize_metadata_route(mut page: AppPage) -> Result { route += ".txt" } else if route == "/manifest" { route += ".webmanifest" - } else if route.ends_with("/sitemap") { - route += ".xml" - } else { + // Do not append the suffix for the sitemap route + } else if !route.ends_with("/sitemap") { // Remove the file extension, e.g. /route-path/robots.txt -> /route-path let pathname_prefix = split_directory(&route).0.unwrap_or_default(); suffix = get_metadata_route_suffix(pathname_prefix); diff --git a/packages/next-swc/crates/next-core/src/next_app/metadata/route.rs b/packages/next-swc/crates/next-core/src/next_app/metadata/route.rs index 80f925bcbcbf8..251ccf5e99bc5 100644 --- a/packages/next-swc/crates/next-core/src/next_app/metadata/route.rs +++ b/packages/next-swc/crates/next-core/src/next_app/metadata/route.rs @@ -227,7 +227,7 @@ async fn dynamic_site_map_route_source( const params = [] for (const item of sitemaps) { - params.push({ __metadata_id__: item.id.toString() + '.xml' }) + params.push({ __metadata_id__: item.id.toString() }) } return params } diff --git a/packages/next-swc/package.json b/packages/next-swc/package.json index 8624b64c5fbae..784c26a3c6144 100644 --- a/packages/next-swc/package.json +++ b/packages/next-swc/package.json @@ -1,6 +1,6 @@ { "name": "@next/swc", - "version": "14.3.0-canary.51", + "version": "14.3.0-canary.52", "private": true, "scripts": { "clean": "node ../../scripts/rm.mjs native", diff --git a/packages/next/package.json b/packages/next/package.json index f49fbf1796229..b447c5add4e81 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,6 +1,6 @@ { "name": "next", - "version": "14.3.0-canary.51", + "version": "14.3.0-canary.52", "description": "The React Framework", "main": "./dist/server/next.js", "license": "MIT", @@ -93,7 +93,7 @@ ] }, "dependencies": { - "@next/env": "14.3.0-canary.51", + "@next/env": "14.3.0-canary.52", "@swc/helpers": "0.5.11", "busboy": "1.6.0", "caniuse-lite": "^1.0.30001579", @@ -153,10 +153,10 @@ "@jest/types": "29.5.0", "@mswjs/interceptors": "0.23.0", "@napi-rs/triples": "1.2.0", - "@next/polyfill-module": "14.3.0-canary.51", - "@next/polyfill-nomodule": "14.3.0-canary.51", - "@next/react-refresh-utils": "14.3.0-canary.51", - "@next/swc": "14.3.0-canary.51", + "@next/polyfill-module": "14.3.0-canary.52", + "@next/polyfill-nomodule": "14.3.0-canary.52", + "@next/react-refresh-utils": "14.3.0-canary.52", + "@next/swc": "14.3.0-canary.52", "@opentelemetry/api": "1.6.0", "@playwright/test": "1.41.2", "@taskr/clear": "1.1.0", diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index 23cf9bd4dc207..21ed84f7ebb5b 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -998,13 +998,13 @@ export default async function build( } if ( - pageKey.includes('sitemap.xml/[[...__metadata_id__]]') && + pageKey.includes('sitemap/[[...__metadata_id__]]') && isDynamic ) { delete mappedAppPages[pageKey] mappedAppPages[ pageKey.replace( - 'sitemap.xml/[[...__metadata_id__]]', + 'sitemap/[[...__metadata_id__]]', 'sitemap/[__metadata_id__]' ) ] = pagePath diff --git a/packages/next/src/build/webpack/loaders/next-metadata-route-loader.ts b/packages/next/src/build/webpack/loaders/next-metadata-route-loader.ts index 801660e22e7b7..5adb640f7ce33 100644 --- a/packages/next/src/build/webpack/loaders/next-metadata-route-loader.ts +++ b/packages/next/src/build/webpack/loaders/next-metadata-route-loader.ts @@ -176,7 +176,7 @@ export async function generateStaticParams() { const params = [] for (const item of sitemaps) { - params.push({ __metadata_id__: item.id.toString() + '.xml' }) + params.push({ __metadata_id__: item.id.toString() }) } return params } @@ -225,9 +225,6 @@ export async function GET(_, ctx) { } } let itemID = item.id.toString() - if(process.env.NODE_ENV === 'production') { - itemID += '.xml' - } return itemID === targetId })?.id if (id == null) { diff --git a/packages/next/src/lib/metadata/get-metadata-route.ts b/packages/next/src/lib/metadata/get-metadata-route.ts index 6ab89e1c4b640..8bccf25b42647 100644 --- a/packages/next/src/lib/metadata/get-metadata-route.ts +++ b/packages/next/src/lib/metadata/get-metadata-route.ts @@ -65,9 +65,9 @@ export function normalizeMetadataRoute(page: string) { route += '.txt' } else if (page === '/manifest') { route += '.webmanifest' - } else if (page.endsWith('/sitemap')) { - route += '.xml' - } else { + } + // For sitemap, we don't automatically add the route suffix since it can have sub-routes + else if (!page.endsWith('/sitemap')) { // Remove the file extension, e.g. /route-path/robots.txt -> /route-path const pathnamePrefix = page.slice(0, -(path.basename(page).length + 1)) suffix = getMetadataRouteSuffix(pathnamePrefix) diff --git a/packages/react-refresh-utils/package.json b/packages/react-refresh-utils/package.json index 6e1a3ce7cf818..74f4d24761467 100644 --- a/packages/react-refresh-utils/package.json +++ b/packages/react-refresh-utils/package.json @@ -1,6 +1,6 @@ { "name": "@next/react-refresh-utils", - "version": "14.3.0-canary.51", + "version": "14.3.0-canary.52", "description": "An experimental package providing utilities for React Refresh.", "repository": { "url": "vercel/next.js", diff --git a/packages/third-parties/package.json b/packages/third-parties/package.json index a9ba6209f6a26..33714c1ad6840 100644 --- a/packages/third-parties/package.json +++ b/packages/third-parties/package.json @@ -1,6 +1,6 @@ { "name": "@next/third-parties", - "version": "14.3.0-canary.51", + "version": "14.3.0-canary.52", "repository": { "url": "vercel/next.js", "directory": "packages/third-parties" @@ -26,7 +26,7 @@ "third-party-capital": "1.0.20" }, "devDependencies": { - "next": "14.3.0-canary.51", + "next": "14.3.0-canary.52", "outdent": "0.8.0", "prettier": "2.5.1" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9b34d4de73947..f7a06dd49d061 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -748,7 +748,7 @@ importers: packages/eslint-config-next: dependencies: '@next/eslint-plugin-next': - specifier: 14.3.0-canary.51 + specifier: 14.3.0-canary.52 version: link:../eslint-plugin-next '@rushstack/eslint-patch': specifier: ^1.3.3 @@ -810,7 +810,7 @@ importers: packages/next: dependencies: '@next/env': - specifier: 14.3.0-canary.51 + specifier: 14.3.0-canary.52 version: link:../next-env '@swc/helpers': specifier: 0.5.11 @@ -935,16 +935,16 @@ importers: specifier: 1.2.0 version: 1.2.0 '@next/polyfill-module': - specifier: 14.3.0-canary.51 + specifier: 14.3.0-canary.52 version: link:../next-polyfill-module '@next/polyfill-nomodule': - specifier: 14.3.0-canary.51 + specifier: 14.3.0-canary.52 version: link:../next-polyfill-nomodule '@next/react-refresh-utils': - specifier: 14.3.0-canary.51 + specifier: 14.3.0-canary.52 version: link:../react-refresh-utils '@next/swc': - specifier: 14.3.0-canary.51 + specifier: 14.3.0-canary.52 version: link:../next-swc '@opentelemetry/api': specifier: 1.6.0 @@ -1559,7 +1559,7 @@ importers: version: 1.0.20 devDependencies: next: - specifier: 14.3.0-canary.51 + specifier: 14.3.0-canary.52 version: link:../next outdent: specifier: 0.8.0 diff --git a/test/.stats-app/pages/dynamic.js b/test/.stats-app/pages/dynamic.js index d1f0d575091e6..30fce5f3c2d99 100644 --- a/test/.stats-app/pages/dynamic.js +++ b/test/.stats-app/pages/dynamic.js @@ -1,6 +1,8 @@ import dynamic from 'next/dynamic' -const DynamicHello = dynamic(() => import('../components/hello')) +const DynamicHello = dynamic(() => + import('../components/hello').then((mod) => mod.Hello) +) const Page = () => ( <> diff --git a/test/e2e/app-dir/dynamic-in-generate-params/index.test.ts b/test/e2e/app-dir/dynamic-in-generate-params/index.test.ts index 03e20f6cd21b1..d43ffdf9fad4b 100644 --- a/test/e2e/app-dir/dynamic-in-generate-params/index.test.ts +++ b/test/e2e/app-dir/dynamic-in-generate-params/index.test.ts @@ -1,39 +1,40 @@ import { type NextInstance, nextTestSetup } from 'e2e-utils' +import type { Response } from 'node-fetch' async function getLastModifiedTime(next: NextInstance, pathname: string) { const content = await (await next.fetch(pathname)).text() return content.match(/([^<]+)<\/lastmod>/)[1] } +function assertSitemapResponse(res: Response) { + expect(res.status).toBe(200) + expect(res.headers.get('content-type')).toContain('application/xml') +} + describe('app-dir - dynamic in generate params', () => { - const { next, isNextDev } = nextTestSetup({ + const { next } = nextTestSetup({ files: __dirname, + skipDeployment: true, }) it('should render sitemap with generateSitemaps in force-dynamic config dynamically', async () => { - const firstTime = await getLastModifiedTime( - next, - isNextDev ? 'sitemap.xml/0' : '/sitemap/0.xml' - ) - const secondTime = await getLastModifiedTime( - next, - isNextDev ? 'sitemap.xml/0' : '/sitemap/0.xml' - ) + const firstTime = await getLastModifiedTime(next, 'sitemap/0') + const secondTime = await getLastModifiedTime(next, 'sitemap/0') expect(firstTime).not.toEqual(secondTime) }) it('should be able to call while generating multiple dynamic sitemaps', async () => { - expect( - (await next.fetch(isNextDev ? 'sitemap.xml/0' : '/sitemap/0.xml')).status - ).toBe(200) - expect( - (await next.fetch(isNextDev ? 'sitemap.xml/1' : '/sitemap/1.xml')).status - ).toBe(200) + const res0 = await next.fetch('sitemap/0') + const res1 = await next.fetch('sitemap/1') + assertSitemapResponse(res0) + assertSitemapResponse(res1) }) it('should be able to call fetch while generating multiple dynamic pages', async () => { - expect((await next.fetch('/dynamic/0')).status).toBe(200) - expect((await next.fetch('/dynamic/1')).status).toBe(200) + const pageRes0 = await next.fetch('dynamic/0') + const pageRes1 = await next.fetch('dynamic/1') + expect(pageRes0.status).toBe(200) + expect(pageRes1.status).toBe(200) }) }) diff --git a/test/e2e/app-dir/metadata-dynamic-routes/index.test.ts b/test/e2e/app-dir/metadata-dynamic-routes/index.test.ts index 475b678d0656b..6d7ae2ffdcd69 100644 --- a/test/e2e/app-dir/metadata-dynamic-routes/index.test.ts +++ b/test/e2e/app-dir/metadata-dynamic-routes/index.test.ts @@ -18,7 +18,7 @@ describe('app dir - metadata dynamic routes', () => { }, }) - describe('text routes', () => { + describe('robots.txt', () => { it('should handle robots.[ext] dynamic routes', async () => { const res = await next.fetch('/robots.txt') const text = await res.text() @@ -40,39 +40,53 @@ describe('app dir - metadata dynamic routes', () => { " `) }) + }) + describe('sitemap', () => { it('should handle sitemap.[ext] dynamic routes', async () => { - const res = await next.fetch('/sitemap.xml') + const res = await next.fetch('/sitemap') const text = await res.text() expect(res.headers.get('content-type')).toBe('application/xml') expect(res.headers.get('cache-control')).toBe(CACHE_HEADERS.REVALIDATE) expect(text).toMatchInlineSnapshot(` - " - - - https://example.com - 2021-01-01 - weekly - 0.5 - - - https://example.com/about - 2021-01-01 - - - " - `) + " + + + https://example.com + 2021-01-01 + weekly + 0.5 + + + https://example.com/about + 2021-01-01 + + + " + `) + }) + + it('should support generate multi sitemaps with generateSitemaps', async () => { + const ids = ['child0', 'child1', 'child2', 'child3'] + function fetchSitemap(id) { + return next.fetch(`/gsp/sitemap/${id}`).then((res) => res.text()) + } + + for (const id of ids) { + const text = await fetchSitemap(id) + expect(text).toContain(`https://example.com/dynamic/${id}`) + } }) - it('should not throw if client components are imported but not used', async () => { - const { status } = await next.fetch('/client-ref-dependency/sitemap.xml') + it('should not throw if client components are imported but not used in sitemap', async () => { + const { status } = await next.fetch('/client-ref-dependency/sitemap') expect(status).toBe(200) }) it('should support alternate.languages in sitemap', async () => { - const xml = await (await next.fetch('/lang/sitemap.xml')).text() + const xml = await (await next.fetch('/lang/sitemap')).text() expect(xml).toContain('xmlns:xhtml="http://www.w3.org/1999/xhtml') expect(xml).toContain( @@ -82,6 +96,35 @@ describe('app dir - metadata dynamic routes', () => { `` ) }) + if (isNextStart) { + it('should optimize routes without multiple generation API as static routes', async () => { + const appPathsManifest = JSON.parse( + await next.readFile('.next/server/app-paths-manifest.json') + ) + + expect(appPathsManifest).toMatchObject({ + // static routes + '/twitter-image/route': 'app/twitter-image/route.js', + '/sitemap/route': 'app/sitemap/route.js', + + // dynamic + '/gsp/sitemap/[__metadata_id__]/route': + 'app/gsp/sitemap/[__metadata_id__]/route.js', + '/(group)/dynamic/[size]/apple-icon-ahg52g/[[...__metadata_id__]]/route': + 'app/(group)/dynamic/[size]/apple-icon-ahg52g/[[...__metadata_id__]]/route.js', + }) + }) + + it('should generate static paths of dynamic sitemap in production', async () => { + const sitemapPaths = ['child0', 'child1', 'child2', 'child3'].map( + (id) => `.next/server/app/gsp/sitemap/${id}.meta` + ) + const promises = sitemapPaths.map(async (filePath) => { + expect(await next.hasFile(filePath)).toBe(true) + }) + await Promise.all(promises) + }) + } }) describe('social image routes', () => { @@ -203,22 +246,6 @@ describe('app dir - metadata dynamic routes', () => { ]) }) - it('should support generate multi sitemaps with generateSitemaps', async () => { - const ids = ['child0', 'child1', 'child2', 'child3'] - function fetchSitemap(id) { - return next - .fetch( - isNextDev ? `/gsp/sitemap.xml/${id}` : `/gsp/sitemap/${id}.xml` - ) - .then((res) => res.text()) - } - - for (const id of ids) { - const text = await fetchSitemap(id) - expect(text).toContain(`https://example.com/dynamic/${id}`) - } - }) - it('should fill params into dynamic routes url of metadata images', async () => { const $ = await next.render$('/dynamic/big') const ogImageUrl = $('meta[property="og:image"]').attr('content') @@ -289,7 +316,7 @@ describe('app dir - metadata dynamic routes', () => { if (isNextStart) { describe('route segment config', () => { it('should generate dynamic route if dynamic config is force-dynamic', async () => { - const dynamicRoute = '/route-config/sitemap.xml' + const dynamicRoute = '/route-config/sitemap' expect( await next.hasFile(`.next/server/app${dynamicRoute}/route.js`) @@ -480,7 +507,7 @@ describe('app dir - metadata dynamic routes', () => { const outputBeforeFetch = next.cliOutput + '' await next.patchFile(sitemapFilePath, contentMissingIdProperty) - await next.fetch('/metadata-base/unset/sitemap.xml/0') + await next.fetch('/metadata-base/unset/sitemap/0') const outputAfterFetch = next.cliOutput + '' const output = outputAfterFetch.replace(outputBeforeFetch, '') @@ -494,7 +521,7 @@ describe('app dir - metadata dynamic routes', () => { }, /success/) } finally { await next.deleteFile(sitemapFilePath) - await next.fetch('/metadata-base/unset/sitemap.xml/0') + await next.fetch('/metadata-base/unset/sitemap/0') } }) @@ -537,34 +564,6 @@ describe('app dir - metadata dynamic routes', () => { expect(edgeRoute).toMatch(/\/\(group\)\/twitter-image-\w{6}\/route/) }) - it('should optimize routes without multiple generation API as static routes', async () => { - const appPathsManifest = JSON.parse( - await next.readFile('.next/server/app-paths-manifest.json') - ) - - expect(appPathsManifest).toMatchObject({ - // static routes - '/twitter-image/route': 'app/twitter-image/route.js', - '/sitemap.xml/route': 'app/sitemap.xml/route.js', - - // dynamic - '/gsp/sitemap/[__metadata_id__]/route': - 'app/gsp/sitemap/[__metadata_id__]/route.js', - '/(group)/dynamic/[size]/apple-icon-ahg52g/[[...__metadata_id__]]/route': - 'app/(group)/dynamic/[size]/apple-icon-ahg52g/[[...__metadata_id__]]/route.js', - }) - }) - - it('should generate static paths of dynamic sitemap in production', async () => { - const sitemapPaths = ['child0', 'child1', 'child2', 'child3'].map( - (id) => `.next/server/app/gsp/sitemap/${id}.xml.meta` - ) - const promises = sitemapPaths.map(async (filePath) => { - expect(await next.hasFile(filePath)).toBe(true) - }) - await Promise.all(promises) - }) - it('should include default og font files in file trace', async () => { const fileTrace = JSON.parse( await next.readFile( diff --git a/test/turbopack-build-tests-manifest.json b/test/turbopack-build-tests-manifest.json index 5381a6fff0384..90608e8e84416 100644 --- a/test/turbopack-build-tests-manifest.json +++ b/test/turbopack-build-tests-manifest.json @@ -1871,14 +1871,12 @@ "failed": [ "app dir - metadata dynamic routes icon image routes should render apple icon with dynamic routes", "app dir - metadata dynamic routes icon image routes should render icon with dynamic routes", - "app dir - metadata dynamic routes route segment config should generate dynamic route if dynamic config is force-dynamic", - "app dir - metadata dynamic routes should generate static paths of dynamic sitemap in production", + "app dir - metadata dynamic routes should error if the default export of dynamic image is missing", + "app dir - metadata dynamic routes should error when id is missing in generateImageMetadata", + "app dir - metadata dynamic routes should error when id is missing in generateSitemaps", "app dir - metadata dynamic routes should generate unique path for image routes under group routes", - "app dir - metadata dynamic routes should include default og font files in file trace", "app dir - metadata dynamic routes should inject dynamic metadata properly to head", - "app dir - metadata dynamic routes should optimize routes without multiple generation API as static routes", "app dir - metadata dynamic routes should pick configured metadataBase instead of deployment url for canonical url", - "app dir - metadata dynamic routes should support edge runtime of image routes", "app dir - metadata dynamic routes should use localhost for local prod and fallback to deployment url when metadataBase is falsy", "app dir - metadata dynamic routes social image routes should fill params into dynamic routes url of metadata images", "app dir - metadata dynamic routes social image routes should fill params into routes groups url of static images", @@ -1886,13 +1884,19 @@ "app dir - metadata dynamic routes social image routes should handle manifest.[ext] dynamic routes", "app dir - metadata dynamic routes social image routes should render og image with opengraph-image dynamic routes", "app dir - metadata dynamic routes social image routes should render og image with twitter-image dynamic routes", - "app dir - metadata dynamic routes social image routes should support generate multi images with generateImageMetadata", - "app dir - metadata dynamic routes social image routes should support generate multi sitemaps with generateSitemaps", "app dir - metadata dynamic routes social image routes should support params as argument in dynamic routes", - "app dir - metadata dynamic routes text routes should handle robots.[ext] dynamic routes", - "app dir - metadata dynamic routes text routes should handle sitemap.[ext] dynamic routes", - "app dir - metadata dynamic routes text routes should not throw if client components are imported but not used", - "app dir - metadata dynamic routes text routes should support alternate.languages in sitemap" + "app dir - metadata dynamic routes social image routes should support generate multi images with generateImageMetadata", + "app dir - metadata dynamic routes robots.txt should handle robots.[ext] dynamic routes", + "app dir - metadata dynamic routes should support edge runtime of image routes", + "app dir - metadata dynamic routes should include default og font files in file trace", + "app dir - metadata dynamic routes route segment config should generate dynamic route if dynamic config is force-dynamic", + "app dir - metadata dynamic routes sitemap should not throw if client components are imported but not used in sitemap", + "app dir - metadata dynamic routes sitemap should handle sitemap.[ext] dynamic routes", + "app dir - metadata dynamic routes sitemap social image routes should support generate multi sitemaps with generateSitemaps", + "app dir - metadata dynamic routes sitemap should support alternate.languages in sitemap", + "app dir - metadata dynamic routes sitemap should support generate multi sitemaps with generateSitemaps", + "app dir - metadata dynamic routes sitemap should optimize routes without multiple generation API as static routes", + "app dir - metadata dynamic routes sitemap should generate static paths of dynamic sitemap in production" ], "pending": [], "flakey": [], diff --git a/test/turbopack-dev-tests-manifest.json b/test/turbopack-dev-tests-manifest.json index d2dc8840759c3..e401de659af8b 100644 --- a/test/turbopack-dev-tests-manifest.json +++ b/test/turbopack-dev-tests-manifest.json @@ -4089,13 +4089,13 @@ "app dir - metadata dynamic routes social image routes should handle manifest.[ext] dynamic routes", "app dir - metadata dynamic routes social image routes should render og image with opengraph-image dynamic routes", "app dir - metadata dynamic routes social image routes should render og image with twitter-image dynamic routes", - "app dir - metadata dynamic routes social image routes should support generate multi images with generateImageMetadata", - "app dir - metadata dynamic routes social image routes should support generate multi sitemaps with generateSitemaps", "app dir - metadata dynamic routes social image routes should support params as argument in dynamic routes", - "app dir - metadata dynamic routes text routes should handle robots.[ext] dynamic routes", - "app dir - metadata dynamic routes text routes should handle sitemap.[ext] dynamic routes", - "app dir - metadata dynamic routes text routes should not throw if client components are imported but not used", - "app dir - metadata dynamic routes text routes should support alternate.languages in sitemap" + "app dir - metadata dynamic routes social image routes should support generate multi images with generateImageMetadata", + "app dir - metadata dynamic routes sitemap should not throw if client components are imported but not used in sitemap", + "app dir - metadata dynamic routes sitemap should handle sitemap.[ext] dynamic routes", + "app dir - metadata dynamic routes sitemap social image routes should support generate multi sitemaps with generateSitemaps", + "app dir - metadata dynamic routes sitemap should support alternate.languages in sitemap", + "app dir - metadata dynamic routes robots.txt should handle robots.[ext] dynamic routes" ], "failed": [], "pending": [],