next.js
495d50f1 - docs: document revalidateTag's required second argument in upgrade guide (#92134)

Commit
44 days ago
docs: document revalidateTag's required second argument in upgrade guide (#92134) ### What? Add a before/after migration snippet to the version 16 upgrade guide showing the old single-argument `revalidateTag('posts')` and the new required two-argument `revalidateTag('posts', 'max')` signature. Also mention the TypeScript error users will see and the `updateTag` alternative for immediate expiration. ### Why? Users upgrading from Next.js 15 to 16 encounter `Expected 2 arguments, but got 1` when using the old single-argument syntax. The upgrade guide previously only showed the new code without showing the old pattern, requiring users to search externally to understand what changed. ### How? - Added a concise `// Before` / `// After` code block showing the migration, matching the convention used elsewhere in the upgrade guide (e.g. `next/legacy/image`) - Added a note that the single-argument form produces a TypeScript error - Added a note pointing to `updateTag` as the alternative for immediate expiration - Kept the original full example with stale-while-revalidate behavior explanation ## PR checklist (Improving Documentation) - Run `pnpm prettier-fix` to fix formatting issues before opening the PR - Follow the docs contribution guide: https://nextjs.org/docs/community/contribution-guide
Author
Parents
Loading