Unverified Commit 52a822cf authored by Aurora Scharff's avatar Aurora Scharff Committed by GitHub

docs: link ensureStatic TypeScript hints to its API reference (#100033)

## Summary

The TypeScript language-service hints for the `ensureStatic` route
segment config pointed at `(docs coming soon)`, so hovering the export
in an editor gave no path to its API reference, which now exists. This
points the hint at that page and states in the `'prefetch'` option hint
that forcing a static prefetch stops runtime prefetch requests, while
request-specific content behind `<Suspense>` still renders during
navigation.

Maintainer dashboard:
https://next-maintainer-agent.vercel.tools/investigations/feedback/149
DX Agent feedback:
https://dxagent.labs.vercel.dev/dashboard/feedback/d98438c6-3ff3-4239-b5f9-5ccde3fe7b52

## Verification

- `npx prettier --check
packages/next/src/server/typescript/rules/config.ts`

<!-- NEXT_JS_LLM -->

Prepared in fork:
https://github.com/vercel-labs/next.js-experimental/pull/256

---------
Co-authored-by: 's avatarvercel-gh-bot-2[bot] <282331341+vercel-gh-bot-2[bot]@users.noreply.github.com>
parent 2af3c42a
...@@ -25,6 +25,8 @@ import { RenderStage } from '../app-render/staged-rendering' ...@@ -25,6 +25,8 @@ import { RenderStage } from '../app-render/staged-rendering'
* *
* Unlike `connection()`, it does not mark the subtree as request-dependent — * Unlike `connection()`, it does not mark the subtree as request-dependent —
* content below `await prefetch()` remains fully cacheable. * content below `await prefetch()` remains fully cacheable.
*
* Read more: [Next.js Docs: `prefetch`](https://nextjs.org/docs/app/api-reference/functions/prefetch)
*/ */
export function prefetch(): Promise<void> { export function prefetch(): Promise<void> {
const workStore = workAsyncStorage.getStore() const workStore = workAsyncStorage.getStore()
...@@ -177,6 +179,8 @@ export function prefetch(): Promise<void> { ...@@ -177,6 +179,8 @@ export function prefetch(): Promise<void> {
* *
* Unlike `connection()`, it does not mark the subtree as request-dependent — * Unlike `connection()`, it does not mark the subtree as request-dependent —
* content below `await navigation()` remains fully cacheable. * content below `await navigation()` remains fully cacheable.
*
* Read more: [Next.js Docs: `navigation`](https://nextjs.org/docs/app/api-reference/functions/navigation)
*/ */
export function navigation(): Promise<void> { export function navigation(): Promise<void> {
const workStore = workAsyncStorage.getStore() const workStore = workAsyncStorage.getStore()
......
...@@ -161,7 +161,7 @@ const API_DOCS: Record< ...@@ -161,7 +161,7 @@ const API_DOCS: Record<
}, },
prefetch: { prefetch: {
description: `Controls prefetching behavior for this segment. Some options are experimental and may change.`, description: `Controls prefetching behavior for this segment. Some options are experimental and may change.`,
link: '(docs coming soon)', link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config/prefetch',
type: `"auto" | "partial" | "force-disabled"`, type: `"auto" | "partial" | "force-disabled"`,
options: { options: {
auto: 'Default. Framework decides based on instant validation and segment configuration. You do not need to set this explicitly.', auto: 'Default. Framework decides based on instant validation and segment configuration. You do not need to set this explicitly.',
...@@ -173,7 +173,7 @@ const API_DOCS: Record< ...@@ -173,7 +173,7 @@ const API_DOCS: Record<
}, },
ensureStatic: { ensureStatic: {
description: `Controls which rendering phases require static output for this segment. This option is experimental and may change.`, description: `Controls which rendering phases require static output for this segment. This option is experimental and may change.`,
link: '(docs coming soon)', link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config/ensureStatic',
type: `"auto" | "shell" | "prefetch" | "navigation" | false`, type: `"auto" | "shell" | "prefetch" | "navigation" | false`,
options: { options: {
'"auto"': '"auto"':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment