Update links from beta to stable docs. (#49349)

Now that the beta docs have been merged into stable with the release of
13.4, this updates all links as some paths have changed due to
redirects.

---------

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
This commit is contained in:
Lee Robinson 2023-05-11 11:52:29 -07:00 committed by GitHub
parent 0f332055d4
commit fa1370fd9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 41 additions and 43 deletions

View file

@ -7,11 +7,6 @@ export default function RootLayout({
}) {
return (
<html lang="en">
{/*
<head /> will contain the components returned by the nearest parent
head.tsx. Find out more at https://beta.nextjs.org/docs/api-reference/file-conventions/head
*/}
<head />
<body>{children}</body>
</html>
)

View file

@ -40,7 +40,7 @@ export default function Home() {
<div className={styles.grid}>
<a
href="https://beta.nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className={styles.card}
target="_blank"
rel="noopener noreferrer"

View file

@ -4,7 +4,7 @@ Next.js enables starting as a static site or Single-Page Application (SPA), then
When running `next build`, Next.js generates an HTML file per route. By breaking a strict SPA into individual HTML files, Next.js can avoid loading unnecessary JavaScript code on the client-side, reducing the bundle size and enabling faster page loads.
Learn more: https://beta.nextjs.org/docs/configuring/static-export
Learn more: https://nextjs.org/docs/app/building-your-application/deploying/static-exports
## Deploy your own

View file

@ -20,7 +20,7 @@ export default function Page() {
<div>
<a
className="font-medium text-zinc-300 hover:text-white"
href="https://beta.nextjs.org/docs/rendering/server-and-client-components#using-context"
href="https://nextjs.org/docs/rendering/server-and-client-components#using-context"
>
Learn more
</a>

View file

@ -10,7 +10,7 @@ export default function Page() {
<div>
<a
className="font-medium text-zinc-300 hover:text-white"
href="https://beta.nextjs.org/docs/styling/css-modules"
href="https://nextjs.org/docs/app/building-your-application/styling/css-modules"
>
Learn more
</a>

View file

@ -41,7 +41,7 @@ export default function Home() {
<div className="mb-32 grid text-center lg:mb-0 lg:grid-cols-4 lg:text-left">
<a
href="https://beta.nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"

View file

@ -41,7 +41,7 @@ export default function Home() {
<div className="mb-32 grid text-center lg:mb-0 lg:grid-cols-4 lg:text-left">
<a
href="https://beta.nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"

View file

@ -41,7 +41,7 @@ export default function Home() {
<div className={styles.grid}>
<a
href="https://beta.nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className={styles.card}
target="_blank"
rel="noopener noreferrer"

View file

@ -41,7 +41,7 @@ export default function Home() {
<div className={styles.grid}>
<a
href="https://beta.nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className={styles.card}
target="_blank"
rel="noopener noreferrer"

View file

@ -4,4 +4,4 @@
This new font system also allows you to conveniently use all Google Fonts with performance and privacy in mind. CSS and font files are downloaded at build time and self-hosted with the rest of your static assets. No requests are sent to Google by the browser.
[Read more](https://beta.nextjs.org/docs/optimizing/fonts)
[Read more](https://nextjs.org/docs/app/building-your-application/optimizing/fonts)

View file

@ -128,7 +128,10 @@ impl Issue for NextSegmentConfigParsingIssue {
#[turbo_tasks::function]
fn documentation_link(&self) -> StringVc {
StringVc::cell("https://beta.nextjs.org/docs/api-reference/segment-config".to_string())
StringVc::cell(
"https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config"
.to_string(),
)
}
#[turbo_tasks::function]

View file

@ -412,7 +412,7 @@ export async function getPageStaticInfo(params: {
}
if (pageType === 'app') {
if (config) {
const message = `\`export const config\` in ${pageFilePath} is deprecated. Please change \`runtime\` property to segment export config. See https://beta.nextjs.org/docs/api-reference/segment-config`
const message = `\`export const config\` in ${pageFilePath} is deprecated. Please change \`runtime\` property to segment export config. See https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config`
if (isDev) {
Log.warnOnce(message)
} else {

View file

@ -91,7 +91,7 @@ export { e${cnt++} as ${ref} };`
if (buildInfo.rsc?.type !== RSC_MODULE_TYPES.client) {
if (noopHeadPath === this.resourcePath) {
warnOnce(
`Warning: You're using \`next/head\` inside the \`app\` directory, please migrate to the Metadata API. See https://beta.nextjs.org/docs/api-reference/metadata for more details.`
`Warning: You're using \`next/head\` inside the \`app\` directory, please migrate to the Metadata API. See https://nextjs.org/docs/app/api-reference/file-conventions/metadata for more details.`
)
}
}

View file

@ -65,7 +65,7 @@ function formatRSCErrorMessage(
if (isPagesDir) {
formattedMessage = message.replace(
NEXT_RSC_ERR_CLIENT_IMPORT,
`\n\nYou're importing a component that needs $1. That only works in a Server Component which is not supported in the pages/ directory. Read more: https://beta.nextjs.org/docs/rendering/server-and-client-components\n\n`
`\n\nYou're importing a component that needs $1. That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/getting-started/react-essentials#server-components\n\n`
)
formattedVerboseMessage = '\n\nImport trace for requested module:\n'
} else {
@ -91,7 +91,7 @@ function formatRSCErrorMessage(
} else if (NEXT_RSC_ERR_INVALID_API.test(message)) {
formattedMessage = message.replace(
NEXT_RSC_ERR_INVALID_API,
`\n\n"$1" is not supported in app/. Read more: https://beta.nextjs.org/docs/data-fetching/fundamentals\n\n`
`\n\n"$1" is not supported in app/. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching\n\n`
)
formattedVerboseMessage = '\n\nFile path:\n'
} else if (NEXT_RSC_ERR_ERROR_FILE_SERVER_COMPONENT.test(message)) {
@ -103,14 +103,14 @@ function formatRSCErrorMessage(
} else if (NEXT_RSC_ERR_CLIENT_METADATA_EXPORT.test(message)) {
formattedMessage = message.replace(
NEXT_RSC_ERR_CLIENT_METADATA_EXPORT,
`\n\nYou are attempting to export "$1" from a component marked with "use client", which is disallowed. Either remove the export, or the "use client" directive. Read more: https://beta.nextjs.org/docs/api-reference/metadata\n\n`
`\n\nYou are attempting to export "$1" from a component marked with "use client", which is disallowed. Either remove the export, or the "use client" directive. Read more: https://nextjs.org/docs/getting-started/react-essentials#the-use-client-directive\n\n`
)
formattedVerboseMessage = '\n\nFile path:\n'
} else if (NEXT_RSC_ERR_CONFLICT_METADATA_EXPORT.test(message)) {
formattedMessage = message.replace(
NEXT_RSC_ERR_CONFLICT_METADATA_EXPORT,
`\n\n"metadata" and "generateMetadata" cannot be exported at the same time, please keep one of them. Read more: https://beta.nextjs.org/docs/api-reference/metadata\n\n`
`\n\n"metadata" and "generateMetadata" cannot be exported at the same time, please keep one of them. Read more: https://nextjs.org/docs/app/api-reference/file-conventions/metadata\n\n`
)
formattedVerboseMessage = '\n\nFile path:\n'

View file

@ -35,7 +35,7 @@ export function getSocialImageFallbackMetadataBase(
// Add new line to warning for worker output
console.log()
Log.warnOnce(
`metadata.metadataBase is not set for resolving social open graph or twitter images, fallbacks to "${fallbackMetadata.origin}". See https://beta.nextjs.org/docs/api-reference/metadata#metadatabase`
`metadata.metadataBase is not set for resolving social open graph or twitter images, fallbacks to "${fallbackMetadata.origin}". See https://nextjs.org/docs/app/api-reference/functions/generate-metadata#metadatabase`
)
}

View file

@ -222,7 +222,7 @@ export async function writeConfigurationDefaults(
'tsconfig.json'
)} extends another configuration, which means we cannot add the Next.js TypeScript plugin automatically. To improve your development experience, we recommend adding the Next.js plugin (\`${chalk.cyan(
'"plugins": [{ "name": "next" }]'
)}\`) manually to your TypeScript configuration. Learn more: https://beta.nextjs.org/docs/configuring/typescript#using-the-typescript-plugin\n`
)}\`) manually to your TypeScript configuration. Learn more: https://nextjs.org/docs/app/building-your-application/configuring/typescript#the-typescript-plugin\n`
)
} else if (!hasNextPlugin) {
if (!('plugins' in userTsConfig.compilerOptions)) {

View file

@ -182,7 +182,7 @@ export interface ExperimentalConfig {
externalDir?: boolean
/**
* The App Router (app directory) enables support for layouts, Server Components, streaming, and colocated data fetching.
* @see https://beta.nextjs.org/docs/api-reference/next-config#appdir
* @see https://nextjs.org/docs/app/api-reference/next-config-js/appDir
*/
appDir?: boolean
amp?: {
@ -224,7 +224,7 @@ export interface ExperimentalConfig {
/**
* A list of packages that should be treated as external in the RSC server build.
* @see https://beta.nextjs.org/docs/api-reference/next-config#servercomponentsexternalpackages
* @see https://nextjs.org/docs/app/api-reference/next-config-js/serverComponentsExternalPackages
*/
serverComponentsExternalPackages?: string[]
@ -251,14 +251,14 @@ export interface ExperimentalConfig {
/**
* For use with `@next/mdx`. Compile MDX files using the new Rust compiler.
* @see https://beta.nextjs.org/docs/api-reference/next-config#mdxrs
* @see https://nextjs.org/docs/app/api-reference/next-config-js/mdxRs
*/
mdxRs?: boolean
/**
* Generate Route types and enable type checking for Link and Router.push, etc.
* This option requires `appDir` to be enabled first.
* @see https://beta.nextjs.org/docs/api-reference/next-config#typedroutes
* @see https://nextjs.org/docs/app/api-reference/next-config-js/typedRoutes
*/
typedRoutes?: boolean

View file

@ -36,7 +36,7 @@ const API_DOCS: Record<
'"force-static"':
'This forces caching of all fetches and returns empty values from `cookies`, `headers` and `useSearchParams`.',
},
link: 'https://beta.nextjs.org/docs/api-reference/segment-config#dynamic',
link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamic',
},
fetchCache: {
description:
@ -57,7 +57,7 @@ const API_DOCS: Record<
'"force-cache"':
"This lets you intentionally opt-in to all caching of data. This option forces all fetches to be cache even if the `cache: 'no-store'` option is passed to `fetch()`.",
},
link: 'https://beta.nextjs.org/docs/api-reference/segment-config#fetchcache',
link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#fetchcache',
},
preferredRegion: {
description:
@ -68,7 +68,7 @@ const API_DOCS: Record<
'"global"': 'Prefer deploying globally.',
'"home"': 'Prefer deploying to the Home region.',
},
link: 'https://beta.nextjs.org/docs/api-reference/segment-config#preferredregion',
link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#preferredregion',
isValid: (value: string) => {
try {
const parsed = JSON.parse(value)
@ -98,7 +98,7 @@ const API_DOCS: Record<
0: 'Specifying `0` implies that this layout or page should never be static.',
30: 'Set the revalidation time to `30` seconds. The value can be `0` or any positive number.',
},
link: 'https://beta.nextjs.org/docs/api-reference/segment-config#revalidate',
link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#revalidate',
isValid: (value: string) => {
return value === 'false' || Number(value) >= 0
},
@ -114,7 +114,7 @@ const API_DOCS: Record<
false:
'Disallow rendering dynamic params that are not generated by `generateStaticParams`.',
},
link: 'https://beta.nextjs.org/docs/api-reference/segment-config#dynamicparams',
link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams',
},
runtime: {
description:
@ -124,11 +124,11 @@ const API_DOCS: Record<
'"edge"': 'Prefer the Edge runtime.',
'"experimental-edge"': 'Prefer the experimental Edge runtime.',
},
link: 'https://beta.nextjs.org/docs/api-reference/segment-config#runtime',
link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#runtime',
},
metadata: {
description: 'Next.js Metadata configurations',
link: 'https://beta.nextjs.org/docs/api-reference/metadata',
link: 'https://nextjs.org/docs/app/api-reference/file-conventions/metadata',
},
}

View file

@ -22,7 +22,7 @@ const errorEntry = {
file: source,
category: ts.DiagnosticCategory.Error,
code: NEXT_TS_ERRORS.INVALID_ERROR_COMPONENT,
messageText: `Error Components must be Client Components, please add the "use client" directive: https://beta.nextjs.org/docs/api-reference/file-conventions/error`,
messageText: `Error Components must be Client Components, please add the "use client" directive: https://nextjs.org/docs/app/api-reference/file-conventions/error`,
start: 0,
length: source.text.length,
},

View file

@ -425,7 +425,7 @@ const metadata = {
file: getSource(fileName),
category: ts.DiagnosticCategory.Error,
code: NEXT_TS_ERRORS.INVALID_METADATA_EXPORT,
messageText: `The 'metadata' export value is not typed correctly, please make sure it is typed as 'Metadata':\nhttps://beta.nextjs.org/docs/guides/seo#static-metadata`,
messageText: `The 'metadata' export value is not typed correctly, please make sure it is typed as 'Metadata':\nhttps://nextjs.org/docs/app/building-your-application/optimizing/metadata#static-metadata`,
start: e.name.getStart(),
length: e.name.getWidth(),
},

View file

@ -29,10 +29,10 @@ createNextDescribe(
const text = await link.text()
const href = await link.getAttribute('href')
expect(text).toEqual(
'https://beta.nextjs.org/docs/data-fetching/fundamentals'
'https://nextjs.org/docs/app/building-your-application/data-fetching'
)
expect(href).toEqual(
'https://beta.nextjs.org/docs/data-fetching/fundamentals'
'https://nextjs.org/docs/app/building-your-application/data-fetching'
)
await cleanup()

View file

@ -52,7 +52,7 @@ createNextDescribe(
"./components/Comp.js
ReactServerComponentsError:
You're importing a component that needs next/headers. That only works in a Server Component which is not supported in the pages/ directory. Read more: https://beta.nextjs.org/docs/rendering/server-and-client-components
You're importing a component that needs next/headers. That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/getting-started/react-essentials#server-components
,-[1:1]
1 |
@ -94,7 +94,7 @@ createNextDescribe(
"./components/Comp.js
ReactServerComponentsError:
You're importing a component that needs server-only. That only works in a Server Component which is not supported in the pages/ directory. Read more: https://beta.nextjs.org/docs/rendering/server-and-client-components
You're importing a component that needs server-only. That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/getting-started/react-essentials#server-components
,-[1:1]
1 |

View file

@ -21,7 +21,7 @@ createNextDescribe(
}
expect(next.cliOutput).toContain('`export const config`')
expect(next.cliOutput).toContain(
'app/legacy-runtime-config/page.js is deprecated. Please change `runtime` property to segment export config. See https://beta.nextjs.org/docs/api-reference/segment-config'
'app/legacy-runtime-config/page.js is deprecated. Please change `runtime` property to segment export config. See https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config'
)
})
}

View file

@ -15,7 +15,7 @@ export default function Home() {
</p>
<div className={styles.grid}>
<a href="https://beta.nextjs.org/docs" className={styles.card}>
<a href="https://nextjs.org/docs" className={styles.card}>
<h2>Documentation &rarr;</h2>
<p>Find in-depth information about Next.js 13</p>
</a>

View file

@ -25,7 +25,7 @@ describe('app dir - metadata missing metadataBase', () => {
)
expect(next.cliOutput).toInclude('"http://localhost:')
expect(next.cliOutput).toInclude(
'. See https://beta.nextjs.org/docs/api-reference/metadata#metadatabase'
'. See https://nextjs.org/docs/app/api-reference/functions/generate-metadata#metadatabase'
)
})
})