Skip to content

Commit

Permalink
Docs: Add version tags for RC and experimental features (#68840)
Browse files Browse the repository at this point in the history
  • Loading branch information
delbaoliveira authored Aug 13, 2024
1 parent 01b6ec5 commit 3dcbcf5
Show file tree
Hide file tree
Showing 20 changed files with 54 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ export function register() {

### `onRequestError` (optional)

> This API is available in Next.js canary.
You can optionally export an `onRequestError` function to track and send **server** errors to an observability tool.

```ts filename="instrumentation.ts" switcher
Expand Down
5 changes: 4 additions & 1 deletion docs/02-app/02-api-reference/04-functions/fetch.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ fetch(`https://...`, { cache: 'force-cache' | 'no-store' })
- If there is a match and it is fresh, it will be returned from the cache.
- If there is no match or a stale match, Next.js will fetch the resource from the remote server and update the cache with the downloaded resource.

> **Good to know**: The `no-cache` option behaves the same way as `no-store` in Next.js.
> **Good to know**:
>
> - In version 15, the default cache option was changed from `'force-cache'` to `'no-store'`. If you're using an older version of Next.js, the default cache option is `'force-cache'`.
> - The `no-cache` option behaves the same way as `no-store` in Next.js.
### `options.next.revalidate`

Expand Down
5 changes: 2 additions & 3 deletions docs/02-app/02-api-reference/04-functions/unstable_after.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
title: unstable_after (experimental)
title: unstable_after
description: API Reference for the unstable_after function.
version: RC
---

> This API is **experimental** and subject to change.
`unstable_after()` allows you to schedule work to be executed after a response is finished. This is useful for tasks and other side effects that should not block the response, such as logging and analytics.

It can be used in [Server Components](/docs/app/building-your-application/rendering/server-components) (including [`generateMetadata`](https://nextjs.org/docs/app/api-reference/functions/generate-metadata)), [Server Actions](/docs/app/building-your-application/data-fetching/server-actions-and-mutations), [Route Handlers](/docs/app/building-your-application/routing/route-handlers), and [Middleware](/docs/app/building-your-application/routing/middleware).
Expand Down
3 changes: 2 additions & 1 deletion docs/02-app/02-api-reference/04-functions/unstable_cache.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: unstable_cache (experimental)
title: unstable_cache
description: API Reference for the unstable_cache function.
version: unstable
---

`unstable_cache` allows you to cache the results of expensive operations, like database queries, and reuse them across multiple requests.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: unstable_noStore (experimental)
title: unstable_noStore
description: API Reference for the unstable_noStore function.
version: unstable
---

`unstable_noStore` can be used to declaratively opt out of static rendering and indicate a particular component should not be cached.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: unstable_rethrow (experimental)
title: unstable_rethrow
description: API Reference for the unstable_rethrow function.
version: unstable
---

`unstable_rethrow` can be used to avoid catching internal errors thrown by Next.js when attempting to handle errors thrown in your application code.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: cssChunking (Experimental)
title: cssChunking
description: Use the `cssChunking` option to control how CSS files are chunked in your Next.js application.
version: experimental
---

CSS Chunking is a strategy used to improve the performance of your web application by splitting and re-ordering CSS files into chunks. This allows you to load only the CSS that is needed for a specific route, instead of loading all the application's CSS at once.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ description: Optimized pages include an indicator to let you know if it's being

## `appIsrStatus` (Static Indicator)

> This option is available in Next.js canary.
Next.js displays a static indicator in the bottom corner of the screen that signals if a route will be prerendered at build time. This makes it easier to understand whether a route is static or dynamic, and for you to identify if a route [opts out of static rendering](#static-route-not-showing-the-indicator).

<Image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ Returns `Promise<void>`. Learn more about [revalidating data](/docs/app/building

## Version History

| Version | Changes |
| --------- | ------------------------------------------------------------------------ |
| `v14.1.0` | Renamed `cacheHandler` is stable. |
| `v13.4.0` | `incrementalCacheHandlerPath` (experimental) supports `revalidateTag`. |
| `v13.4.0` | `incrementalCacheHandlerPath` (experimental) supports standalone output. |
| `v12.2.0` | `incrementalCacheHandlerPath` (experimental) is added. |
| Version | Changes |
| --------- | ------------------------------------------------------------ |
| `v14.1.0` | Renamed to `cacheHandler` and became stable. |
| `v13.4.0` | `incrementalCacheHandlerPath` support for `revalidateTag`. |
| `v13.4.0` | `incrementalCacheHandlerPath` support for standalone output. |
| `v12.2.0` | Experimental `incrementalCacheHandlerPath` added. |
2 changes: 2 additions & 0 deletions docs/02-app/02-api-reference/05-next-config-js/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ module.exports = (phase, { defaultConfig }) => {

## TypeScript

> This feature is available from Next.js canary.
If you are using TypeScript in your project, you can use [`next.config.ts`](/docs/app/building-your-application/configuring/typescript#type-checking-nextconfigts) to use TypeScript in your configuration:

```ts filename="next.config.ts"
Expand Down
5 changes: 2 additions & 3 deletions docs/02-app/02-api-reference/05-next-config-js/mdxRs.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
title: mdxRs (experimental)
title: mdxRs
description: Use the new Rust compiler to compile MDX files in the App Router.
version: experimental.
---

> **Warning**: The `mdxRs` configuration is an experimental feature. This configuration strategy will likely change in the future.
For experimental use with `@next/mdx`. Compiles MDX files using the new Rust compiler.

```js filename="next.config.js"
Expand Down
13 changes: 8 additions & 5 deletions docs/02-app/02-api-reference/05-next-config-js/ppr.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Partial Prerendering
nav_title: ppr (experimental)
description: Learn how to enable Partial Prerendering (experimental) in Next.js.
title: ppr
description: Learn how to enable Partial Prerendering in Next.js.
version: experimental
related:
title: Learn more about Partial Prerendering
links:
Expand All @@ -10,8 +10,6 @@ related:

Partial Prerendering (PPR) enables you to combine static and dynamic components together in the same route. Learn more about [PPR](/docs/app/building-your-application/rendering/partial-prerendering).

> **Note:** Partial Prerendering is an **experimental** feature and subject to change. It is not ready for production use.
## Using Partial Prerendering

### Incremental Adoption (Version 15)
Expand Down Expand Up @@ -109,3 +107,8 @@ const nextConfig = {

module.exports = nextConfig
```

| Version | Changes |
| --------- | ------------------------------ |
| `v15.0.0` | `incremental` value introduced |
| `v14.0.0` | experimental `ppr` introduced |
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
title: reactCompiler (experimental)
title: reactCompiler
description: Enable the React Compiler to automatically optimize component rendering.
version: RC
---

> This feature is **experimental** and may change in future releases.
Next.js 15 introduced experimental support for the [React Compiler](https://react.dev/learn/react-compiler). The compiler improves performance by automatically optimizing component rendering. This reduces the amount of manual memoization developers have to do through APIs such as `useMemo` and `useCallback`.
Next.js 15 RC introduced support for the [React Compiler](https://react.dev/learn/react-compiler). The compiler improves performance by automatically optimizing component rendering. This reduces the amount of manual memoization developers have to do through APIs such as `useMemo` and `useCallback`.

To use it, upgrade to Next.js 15, install the `babel-plugin-react-compiler`:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: severComponentsHmrCache
description: Configure whether fetch responses in Server Components are cached across HMR refresh requests.
version: RC
---

The experimental `serverComponentsHmrCache` option allows you to cache `fetch` responses in Server Components across Hot Module Replacement (HMR) refreshes in local development. This results in faster responses and reduced costs for billed API calls.
Expand Down
7 changes: 3 additions & 4 deletions docs/02-app/02-api-reference/05-next-config-js/staleTimes.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
title: staleTimes (experimental)
title: staleTimes
description: Learn how to override the invalidation time of the Client Router Cache.
version: experimental
---

> **Warning**: The `staleTimes` configuration is an experimental feature. This configuration strategy will likely change in the future.
`staleTimes` is an experimental feature that enables caching of page segments in the [client-side router cache](/docs/app/building-your-application/caching#client-side-router-cache).

You can enable this experimental feature and provide custom revalidation times by setting the experimental `staleTimes` flag:
Expand Down Expand Up @@ -42,5 +41,5 @@ You can learn more about the Client Router Cache [here](/docs/app/building-your-

| Version | Changes |
| --------- | ------------------------------------------------------ |
| `v15.0.0` | The "dynamic" staleTime default changed from 30s to 0s |
| `v15.0.0` | The `dynamic` staleTime default changed from 30s to 0s |
| `v14.2.0` | experimental `staleTimes` introduced |
4 changes: 2 additions & 2 deletions docs/02-app/02-api-reference/05-next-config-js/turbo.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: turbo (experimental)
nav_title: turbo
title: turbo
description: Configure Next.js with Turbopack-specific options
version: experimental
---

{/* The content of this doc is shared between the app and pages router. You can use the `<PagesOnly>Content</PagesOnly>` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: typedRoutes (experimental)
nav_title: typedRoutes
title: typedRoutes
description: Enable experimental support for statically typed links.
version: experimental
---

Experimental support for [statically typed links](/docs/app/building-your-application/configuring/typescript#statically-typed-links). This feature requires using the App Router as well as TypeScript in your project.
Expand Down
6 changes: 3 additions & 3 deletions docs/02-app/02-api-reference/05-next-config-js/urlImports.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
title: urlImports
description: Configure Next.js to allow importing modules from external URLs (experimental).
description: Configure Next.js to allow importing modules from external URLs.
version: experimental
---

{/* The content of this doc is shared between the app and pages router. You can use the `<PagesOnly>Content</PagesOnly>` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */}

URL imports are an experimental feature that allows you to import modules directly from external servers (instead of from the local disk).

> **Warning**: This feature is experimental. Only use domains that you trust to download and execute on your machine. Please exercise
> discretion, and caution until the feature is flagged as stable.
> **Warning**: Only use domains that you trust to download and execute on your machine. Please exercise discretion, and caution until the feature is flagged as stable.
To opt-in, add the allowed URL prefixes inside `next.config.js`:

Expand Down
4 changes: 2 additions & 2 deletions docs/03-pages/02-api-reference/04-next-config-js/turbo.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: turbo (experimental)
nav_title: turbo
title: turbo
description: Configure Next.js with Turbopack-specific options
version: experimental
source: app/api-reference/next-config-js/turbo
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: urlImports
description: Configure Next.js to allow importing modules from external URLs (experimental).
description: Configure Next.js to allow importing modules from external URLs.
version: experimental
source: app/api-reference/next-config-js/urlImports
---

Expand Down

0 comments on commit 3dcbcf5

Please sign in to comment.