Commit Graph

15 Commits

Author SHA1 Message Date
Delba de Oliveira c2b4c0815c Unify caching story across the docs (#90149)
This PRs unifies the caching story across the docs, making Cache
Components the happy path, while still providing guidance to users in
the old model. However, instead of explaining the old model and its
caching layers, we've created a new guide focusing on what APIs to use
and when.

This follow-up PR aligns terminology across the docs:
https://github.com/vercel/next.js/pull/90589

## IA updates

Getting Started section: 

- Improves Getting Started progression:
- **Before:** CC → Fetching Data → Updating Data → Caching and
Revalidating (old and new model mixed)
- **After:** Fetching Data (Dynamic) → Mutating Data (Dynamic) → Caching
with CC (Prerendering) → Revalidating with CC.
- New: `caching.mdx` (CC-first)
   - Structure: 
      - Enabling Cache Components
      - Data vs UI-level caching
      - Working with request time APIs
      - Passing request values to cached functions
      - Working with non-deterministic operations
      - Working with synchronous operations
      - How rendering works (PPR and static shell story)
- New: `revalidating.mdx` (CC-first)
   - Explains how to use `cacheLife` and `cacheTag`

Guides Section: 

- New: `caching-and-revalidating.mdx` (Previous Model)
- For users who are not using CC, includes `fetch` options and route
segment config
- Moves route segment config options that don't apply to CC from API
reference to this guide (for easy archiving in the future).
- New: `migrating-to-cache-components.mdx` (WIP)
- Del: `caching.mdx` 😌 

## Terminology

We should remove caching layers from the docs. Users only needed to be
exposed to them when they were configured independently, but the new CC
APIs work across layers.

To make it easier to review this PR, I'm consolidating terminology and
fixing broken links in a new PR:
https://github.com/vercel/next.js/pull/90589

---------

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2026-03-03 13:14:24 +00:00
Joseph 4cae094393 docs: cache components - introduction (#85196) 2025-10-22 12:41:45 +02:00
Jiwon Choi 1dda5b668b [Breaking] Remove deprecated sync access to Dynamic APIs (#84179)
This PR removes the deprecated sync access to Dynamic APIs.

- Removed UnsafeUnwrapped* types.
- Replaced `as unknown as UnsafeUnwrapped ` type casts to `as any` for
dev warning.
- Removed tests that expected sync access to not error.
- Removed `UntrackedExotic` functions.
- Modified tests that were accidentally doing sync access.
- Updated warnings to emphasize that it is a Promise and must be
awaited.
- Removed paragraph that states access is allowed from
`errors/sync-dynamic-apis.mdx`.

---------

Co-authored-by: Josh Story <story@hey.com>
2025-09-27 22:44:45 +02:00
Joseph ffee9aabc4 chore: remove $ from cli cmd (#83603)
$ in the command example makes it annoying to copy paste
2025-09-09 10:07:41 +00:00
Delba de Oliveira 9c757f6d5c Docs IA 2.0: Server and Client Components (#79143)
Closes: 
- https://linear.app/vercel/issue/DOC-4655/client-components
- https://linear.app/vercel/issue/DOC-4656/server-components
- https://linear.app/vercel/issue/DOC-4657/composition-patterns

Redirects: https://github.com/vercel/front/pull/45564

This PR:

- Adds new **Server and Client Components** page to **Getting Started**
   - Explains how Server and Client components are rendered 
   - Clarifies when to use them
   - Reviews and simplifies composition patterns (examples)
- Improves the **How does PPR work** section in light of static,
dynamic, and streaming.
2025-05-15 14:26:19 +01:00
Delba de Oliveira ae1cad07dd Docs IA 2.0: Move version upgrade docs under Guides (#78189)
Closes: https://linear.app/vercel/issue/DOC-4539/version-upgrade-guides

Redirects: https://github.com/vercel/front/pull/44175

Move version upgrade guides under `Guides`. Also creates a guides
section under the Pages docs.
2025-04-15 16:00:54 +01:00
Ahsan Moin 13880d37d2 docs(typo): fix typos in file conventions, functions, and errors (#73376)
`occured` -> `occurred`
`compatability` -> `compatibility`

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
2024-12-03 14:01:38 +00:00
Jam Balaya 20dc57391e docs: fix code block language in error pages (#72943)
## Summary
Update code block language in [error
pages](https://github.com/vercel/next.js/tree/canary/errors).

### Improving Documentation

- [x] Run `pnpm prettier-fix` to fix formatting issues before opening
the PR.
- [x] Read the Docs Contribution Guide to ensure your contribution
follows the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
2024-11-19 07:56:55 +00:00
Jam Balaya e5e1cfe4c8 docs: add bash filename=Terminal to code block (#72281)
## Summary
Add `bash filename="Terminal"` to improve readability.

### Improving Documentation

- [x] Run `pnpm prettier-fix` to fix formatting issues before opening
the PR.
- [x] Read the Docs Contribution Guide to ensure your contribution
follows the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
2024-11-05 07:28:23 +00:00
Antonis Angelis 9d8b145dfc Update sync-dynamic-apis.mdx (#71907) 2024-10-26 22:50:01 +02:00
Delba de Oliveira 2f6054f419 Docs: RC Updates (#70031)
**Do not merge.**

- [x] `staticgeneration*` options
- [x] `next/form` now available in pages, `prefetch` prop added to app 
- [x]  ~`next/after` stable~ reverted changes
- [x]  `instrumentation.js` stable
- [x]  More secure server actions
- [x]  Update turbopack docs
    - [x]  https://nextjs.org/docs/architecture/turbopack
- [x] https://nextjs.org/docs/app/api-reference/next-config-js/turbo
    - [x]  Move `turbo` config option out of experimental
- [x]  Document `connection()`
- [x] De-prioritize `unstable_noStore` - add note about using
`connection()`
    - [x]  Replace examples of `noStore` with `connection`
- [x]  Async APIs
    - [x]  Reference Pages
        - [x]  `cookies`
        - [x]  `headers`
        - [x]  `draftMode`
        - [x]  `page.js` (`searchParams` and `params` prop)
        - [x]  `layout.js` (`params` prop)
        - [x]  `route.js` (`params` prop)
        - [x]  `default.js` (`params` prop)
- [x] Clarify `use` usage
https://vercel.slack.com/archives/C06N3AXRQ82/p1726483924090979?thread_ts=1726250070.321229&cid=C06N3AXRQ82
    - [x]  Update **examples** throughout the docs:
        - [x]  `cookies`
        - [x]  `headers`
        - [x]  `draftMode`
        - [x]  `searchParams`
        - [x]  `params`
- [x] Update Dynamic API section in the Server Components Page:
https://nextjs.org/docs/app/building-your-application/rendering/server-components#dynamic-rendering
- [x] Update Dynamic API mentions in Route Handler page:
https://nextjs.org/docs/app/building-your-application/routing/route-handlers#dynamic-functions
- [x] Update upgrade guide for Next 15 RC:
https://nextjs.org/docs/app/building-your-application/upgrading/version-15
- [x] Document codemods for async APIs. PR:
https://github.com/vercel/next.js/pull/69572
- [x] Document geo codemod. Done here:
https://github.com/vercel/next.js/pull/70064

Closes: https://linear.app/vercel/issue/DOC-3018/nextjs-15-rc-2

---------

Co-authored-by: Rich Haines <hello@richardhaines.dev>
Co-authored-by: Ahmed Abdelbaset <A7med3bdulBaset@gmail.com>
Co-authored-by: Nikhil S <nikhilsnayak3473@gmail.com>
2024-10-14 11:41:49 +01:00
Jiachi Liu 1b89b4b988 feat: block compilation on codemod comments and ask to remove (#71103)
Co-authored-by: 강동윤 (Donny) <kdy1997.dev@gmail.com>
2024-10-11 19:37:38 +02:00
Zack Tanner 61f5b95cf6 docs: misc typo corrections in upgrade guide & codemod (#71098)
Caught these when reviewing the published changes.
2024-10-10 17:52:08 +02:00
Zack Tanner af80d80132 polish sync-dynamic-apis error page (#71049)
Grammar, clarity, and formatting fixes.
2024-10-09 19:41:37 -07:00
Sebastian "Sebbie" Silbermann 772b0ea271 condense warnings for direct access of dynamic APIs (#70682) 2024-10-02 14:15:08 +02:00