Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update links from beta to stable docs. #49349

Merged
merged 6 commits into from May 11, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 0 additions & 5 deletions examples/app-dir-mdx/app/layout.tsx
Expand Up @@ -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>
)
Expand Down
2 changes: 1 addition & 1 deletion examples/app-dir-mdx/app/page.tsx
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion examples/with-static-export/README.md
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion examples/with-turbopack/app/context/page.tsx
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion examples/with-turbopack/app/styling/page.tsx
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion packages/create-next-app/templates/app-tw/js/app/page.js
Expand Up @@ -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"
Expand Down
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/create-next-app/templates/app/js/app/page.js
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/create-next-app/templates/app/ts/app/page.tsx
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/font/README.md
Expand Up @@ -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)
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/build/analysis/get-page-static-info.ts
Expand Up @@ -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 {
Expand Down
Expand Up @@ -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.`
)
}
}
Expand Down
Expand Up @@ -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 {
Expand All @@ -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)) {
Expand All @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/lib/metadata/resolvers/resolve-url.ts
Expand Up @@ -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`
)
}

Expand Down
Expand Up @@ -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)) {
Expand Down
8 changes: 4 additions & 4 deletions packages/next/src/server/config-shared.ts
Expand Up @@ -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?: {
Expand Down Expand Up @@ -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[]

Expand All @@ -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

Expand Down
14 changes: 7 additions & 7 deletions packages/next/src/server/typescript/rules/config.ts
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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)
Expand Down Expand Up @@ -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
},
Expand All @@ -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:
Expand All @@ -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',
},
}

Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/typescript/rules/error.ts
Expand Up @@ -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,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/typescript/rules/metadata.ts
Expand Up @@ -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(),
},
Expand Down
4 changes: 2 additions & 2 deletions test/development/acceptance-app/error-message-url.test.ts
Expand Up @@ -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()
Expand Down
Expand Up @@ -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/app/api-reference/functions/headers

,-[1:1]
1 |
Expand Down Expand Up @@ -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 |
Expand Down
Expand Up @@ -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'
)
})
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/app-dir/create-next-app-template/app/page.tsx
Expand Up @@ -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>
Expand Down
Expand Up @@ -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'
)
})
})