The Node.js® Website

chore: update incorrect code comments regarding dynamicParams (#6473)

authored by Dario Piotrowicz and committed by GitHub 5e6a6e27 218dbb14

Changed files
+5 -2
app
[locale]
feed
[feed]
next-data
+3 -1
app/[locale]/feed/[feed]/route.ts
··· 29 export const generateStaticParams = async () => 30 siteConfig.rssFeeds.map(feed => ({ feed: feed.file, locale })); 31 32 - // Forces that only the paths from `generateStaticParams` are allowed, giving 404 on the contrary 33 // @see https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams 34 export const dynamicParams = true; 35
··· 29 export const generateStaticParams = async () => 30 siteConfig.rssFeeds.map(feed => ({ feed: feed.file, locale })); 31 32 + // In this case we want to catch-all possible requests. This is so that if a non defined feed is 33 + // requested we can manually return a 404 response for it instead of having Next.js handle it 34 + // and return our top level custom 404 html page instead 35 // @see https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams 36 export const dynamicParams = true; 37
+2 -1
app/[locale]/next-data/og/route.tsx
··· 64 // @see https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#runtime 65 export const runtime = VERCEL_ENV ? 'edge' : 'nodejs'; 66 67 - // Enforces that only the paths from `generateStaticParams` are allowed, giving 404 on the contrary 68 // @see https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams 69 export const dynamicParams = true; 70
··· 64 // @see https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#runtime 65 export const runtime = VERCEL_ENV ? 'edge' : 'nodejs'; 66 67 + // In this case we want to catch-all possible requests. This ensures that we always generate and 68 + // serve the OpenGrapgh images independently on the locale 69 // @see https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams 70 export const dynamicParams = true; 71