Commit Graph

1072 Commits

Author SHA1 Message Date
Nick Oates 1ea3ba06ed Fix typo in generateViewport docs (#74288)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

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

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
2024-12-27 20:34:11 +00:00
sommeeeR 6543d0b349 docs: fix typo in self-host after() details (#74243)
fix typo

Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com>
2024-12-23 20:09:26 +00:00
ytreister 18be41b302 Fixed typo in documentation (#74254)
There is a bug in the documentation. The code sample sets the `distDir
`to `'./build'`, but the comment says `'./dist'`.
2024-12-23 19:53:31 +00:00
Lee Robinson 72b52e7c86 docs: update ISR self-hosting example code (#74211)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-12-22 11:36:26 -06:00
Niklas Mischkulnig 0e49bacbcc docs: Fix filename for Turbopack traces (#74066) 2024-12-18 13:54:39 +01:00
YeonHee c4967b4fd7 docs(redirect): add typescript example and fix params as promise (#73963)
Hi Team.

This PR enhances the redirect function documentation by adding
TypeScript examples, and fixing the examples where the params object was
destructured without being awaited.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-12-18 08:21:31 +00:00
Rich Haines 2b615103af docs: Clarify redirects in next.config (#74019) 2024-12-17 08:53:09 -06:00
Abhishek Y 12a03abc39 docs: fixed regex for parsing base64String, and updated subscribeToPush function. (#73940)
### What?

Change 1:
At line 107, the regex code is now fixed to replace all "-" with "+",
which wasn't as expected with previous code, window.atob() would throw
an error saying the string is not encoded properly. The variable base64
will now have a URL safe base64String.

Change 2:
At line 177 and 178, the function is now updated to call the server
action subscribeUser() with a serialized object instead of a
PushSubscription object, as server actions can only be called with
serialized objects.

### Why?

I followed to docs to setup a PWA project with next, and I encountered
issues with the code mentioned in the documentation.

### How?

The fixed code snippets will work as expected, and anyone following the
docs later can find them helpful.

---------

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-12-17 06:48:24 +00:00
Sahil 79f46a2053 Fixed small typo in the doc (#73971)
There was small typo issues in the doc which is now fixed

Co-authored-by: Sam Ko <sam@vercel.com>
2024-12-16 17:50:49 -08:00
김용민 2a791d1b45 docs: add missing quotation marks (#73720)
Co-authored-by: Lee Robinson <me@leerob.io>
2024-12-16 11:15:54 -06:00
YeonHee ec7025ede4 docs: add typescript examples and fix params as promise (#73240)
Co-authored-by: Lee Robinson <me@leerob.io>
2024-12-16 10:16:14 -06:00
YeonHee 29bdca7075 docs: add missing jsx switcher example and types (#73473)
Co-authored-by: Lee Robinson <me@leerob.io>
2024-12-16 10:15:00 -06:00
Niklas Mischkulnig a1f26330ee docs: Fix MDX syntax error (#73970)
Same problem as https://github.com/vercel/next.js/pull/72453, once
again.
2024-12-16 10:34:06 +01:00
Jam Balaya eae6749c5f docs: update tailwind.config.ts to use satisfies operator (#73924)
Co-authored-by: Lee Robinson <me@leerob.io>
2024-12-15 19:29:09 -06:00
Jam Balaya a10515e3ea docs: fix file extension and missing export (#73842) 2024-12-15 19:21:15 -06:00
Attila Repka dc3bdd8f24 docs: fix vitest manual setup (#73754)
Co-authored-by: Lee Robinson <me@leerob.io>
2024-12-15 18:28:27 -06:00
David Hu e001900b31 docs: fix sitemap changelog table formatting (#73760)
Co-authored-by: Lee Robinson <me@leerob.io>
2024-12-15 18:02:37 -06:00
Lee Robinson 2de57bdcbf docs: minor typos and fixes (#73955)
Replaces https://github.com/vercel/next.js/pull/73717,
https://github.com/vercel/next.js/pull/73719, and
https://github.com/vercel/next.js/pull/73788.
2024-12-15 16:08:24 -06:00
Jam Balaya d7afe14f17 docs: add tsx switcher to linking and navigation (#73846)
Co-authored-by: Lee Robinson <me@leerob.io>
2024-12-15 14:43:47 -06:00
Jam Balaya 137fb7a954 examples: remove with-tailwindcss example (#73919)
Co-authored-by: Lee Robinson <me@leerob.io>
2024-12-15 14:38:46 -06:00
Jam Balaya 4393779935 docs: add next.config.ts code switcher to Redirecting docs (#73848)
Co-authored-by: Lee Robinson <me@leerob.io>
2024-12-15 14:38:35 -06:00
Delba de Oliveira 484e5b1d23 Docs: fix typo in examples page (#73907)
Fix typo in examples page
2024-12-15 14:34:12 -06:00
Sam Ko 21fa7730cf docs(mdx): add a dynamic imports section for App Router (#73466)
## Why?

Adding a section dedicated to dynamically importing MDX files inside
pages for App Router.

- x-ref: https://github.com/vercel/next.js/discussions/70417

---------

Co-authored-by: Lee Robinson <me@leerob.io>
2024-12-13 18:30:00 -06:00
Oliver Wickham 241a340c50 Correct typo in Update 04-images-and-fonts.mdx (#73790)
Super simple typo `Optmizing` -> `Optimizing`

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

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

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-12-13 14:06:41 -08:00
Steven 2a25cbdd99 chore(docs): add missing search: '' on remotePatterns (#73925)
We typically add `search: ''` on `remotePatterns` to disallow the query
string, which is the most common case.

There were a few missing places in the docs so this PR fills in those
gaps.
2024-12-13 17:05:47 -05:00
Abdón Rodríguez 75c1cd0ed5 docs: update WebVitals component (#73869)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

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

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

### What?

Update `WebVitals` component.

### Why?

In the `useReportWebVitals` documentation:

https://nextjs.org/docs/app/api-reference/functions/use-report-web-vitals

<img width="681" alt="Screenshot 2024-12-12 at 4 35 27 PM"
src="https://github.com/user-attachments/assets/afaf6450-e6f0-4351-8e5e-2cad343886a9"
/>

If you do it in a TypeScript project, you have this error:

<img width="864" alt="Screenshot 2024-12-12 at 3 49 07 PM"
src="https://github.com/user-attachments/assets/7cd973d1-a447-4afb-be2d-6e6429b859ac"
/>

```
'WebVitals' cannot be used as a JSX component.
  Its type '() => void' is not a valid JSX element type.
    Type '() => void' is not assignable to type '(props: any, deprecatedLegacyContext?: any) => ReactNode'.
      Type 'void' is not assignable to type 'ReactNode'.ts(2786)
```

### How?

Returning null solves the problem.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-12-13 21:46:37 +00:00
Steven 501c723866 chore(docs): update version history of next/image (#73923)
These features were added in Next.js 15.x but then back-ported to 14.x
since they can impact billing.

So we should land this docs PR and then also back-port it.

I also noticed that the heading was wrong for `localPatterns`.
2024-12-13 16:40:25 -05:00
Delba de Oliveira 7a124bc0dc Docs clean up: delete defining-routes.mdx and pages.mdx (#73863)
Please merge this PR first: https://github.com/vercel/next.js/pull/73859

Closes: 

-
https://linear.app/vercel/issue/DOC-4050/delete-routingdefining-routesmdx
- https://linear.app/vercel/issue/DOC-4051/delete-routingpagesmdx

The content for this page has already been moved to the Getting Started
section or API Reference.
2024-12-13 13:29:26 +00:00
Delba de Oliveira 26e8b765ae Docs clean up: Merge and delete content from routing/index.mdx (#73859)
Please merge this PR first: https://github.com/vercel/next.js/pull/73858

Closes: https://linear.app/vercel/issue/DOC-4049/delete-routingindexmdx

The content for this page has already been moved to the `Getting
Started` section or `API Reference`.

---------

Co-authored-by: Rich Haines <hello@richardhaines.dev>
2024-12-13 13:16:26 +00:00
Delba de Oliveira 67921c23ef Docs: Create Examples section (#73858)
Closes: https://linear.app/vercel/issue/DOC-4047/create-examples-section

Redirects: https://github.com/vercel/front/pull/39878
2024-12-13 12:08:44 +00:00
Delba de Oliveira 349e3ce4d6 Docs: Remove unstable_expirePath and unstable_expireTag docs (#73856)
These APIs are under development and haven't been announced. We are not
recommending people use it yet.

CloseS:
https://linear.app/vercel/issue/DOC-4038/remove-the-unstable-expiretag-and-unstable-expirepath-docs-as-the
Context: https://vercel.slack.com/archives/C06DGJ420TZ/p1733916966674099
Redirects: https://github.com/vercel/front/pull/39875
2024-12-13 11:40:24 +00:00
Jam Balaya 2165fbea87 docs: fix code block extension on after and error handling (#73844)
## Summary

Both `app/actions.ts` and `app/action.js` aren't JSX in [error
handling](https://nextjs.org/docs/app/building-your-application/routing/error-handling)
docs.
`app/api/route.ts` and `app/api/route.js` aren't also JSX in
[after](https://nextjs.org/docs/app/api-reference/functions/after) docs.

### 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: JJ Kasper <jj@jjsweb.site>
2024-12-12 16:59:49 +00:00
Janka Uryga 4d1613d049 docs: supporting after for providers (#73743)
Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
Co-authored-by: Lee Robinson <me@leerob.io>
2024-12-11 13:58:52 -06:00
Lee Robinson 92979e03c6 docs: add versions to connection API (#73798)
Small improvement here to clarify versions.
2024-12-11 09:29:44 -06:00
Hendrik Liebau 7db3bf73cb Fix unstable_allowDynamic when used with pnpm (#73732)
When using dependencies in Middleware that make use of dynamic code evaluation, Next.js emits a build error because this is not supported in the Edge runtime.

In rare cases, when the code can not be reached at runtime and can't be removed by tree-shaking, users might opt in to using the `unstable_allowDynamic` config.

When combined with pnpm, the provided glob patterns as documented at https://nextjs.org/docs/messages/edge-dynamic-code-evaluation#possible-ways-to-fix-it did not match correctly because of pnpm's use of the `.pnpm` directory.

To fix the pattern matching, we need to provide the `dot` option to [picomatch](https://github.com/micromatch/picomatch), which enables dotfile matching.

_Side note: Ideally we would detect dynamic code evaluation after tree shaking, to reduce the number of cases where users need to revert to using `unstable_allowDynamic`._

fixes #51401
2024-12-10 22:14:40 +01:00
Delba de Oliveira bf1b6a65eb 15.1 docs: stable after (#73038)
**Do not merge until stable `after` lands in canary (#73605).** 

Closes: https://linear.app/vercel/issue/DOC-3818/[stable]-nextafter
Redirect: https://github.com/vercel/front/pull/38704

---------

Co-authored-by: Lee Robinson <me@leerob.io>
2024-12-10 14:35:53 +00:00
Delba de Oliveira b097d10515 15.1 docs: Add experimental tags to forbidden and unauthorized APIs (#73513)
**Do not merge until 15.1 is released.** 

Currently these features are tagged as `canary`, but once 15.1 becomes
stable, they'll be `experimental`.

Closes:
https://linear.app/vercel/issue/DOC-3928/update-forbidden-docs-to-add-experimental-tag
2024-12-10 14:15:37 +00:00
Delba de Oliveira f8d7facdd8 Docs: Getting Started Nits (#73596)
Going through the getting started pages with fresh eyes, picked up some
nits.
2024-12-10 13:34:29 +00:00
Delba de Oliveira b730b9c0d2 15.1 docs: request APIs in after (#73692)
Closes:
https://linear.app/vercel/issue/DOC-3929/allow-request-apis-in-after

Adds example for using request APIs in `after`.
Adds note about Server Component restriction. 

related: https://github.com/vercel/next.js/pull/73345
2024-12-10 11:47:43 +00:00
Jude Gao 0c0c928e21 Add inlineCss trade-offs/gotchas and remove canary check (#73609) 2024-12-09 12:04:48 -05:00
Delba de Oliveira bb4ddae93e Docs: Add canary page to upgrade guides (#73518)
Closes:
https://linear.app/vercel/issue/DOC-3933/add-canary-docs-page-to-keep-track-of-features
2024-12-09 12:17:38 +00:00
Delba de Oliveira 030fe51eba 15.1 docs: React 19 (#73510)
Closes: 

- https://linear.app/vercel/issue/DOC-3927/react-19-stable
-
https://linear.app/vercel/issue/DOC-3931/update-mentions-of-useformstate-to-useactionstate-for-react-19-stable

This PR updates the docs for React 19 stable. 

- Reviews docs for mentions of React 19 canary
- Updates mentions of `useFormState` to `userActionState`
- Reviews mentions of `useFormStatus`, improves example

---------

Co-authored-by: Lee Robinson <me@leerob.io>
2024-12-09 12:10:04 +00:00
Jam Balaya caa6a43056 docs: fix code block language on forbidden (#73622)
## Summary

Change `tsx` and `jsx` to `ts` and `js` code block.

### 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
2024-12-09 04:09:31 +00:00
Jam Balaya 39d6a2eeeb docs: fix code block language in images-and-fonts docs (#73492)
## Summary
Update incorrect code block languages at [Images and
Fonts](https://nextjs.org/docs/canary/app/getting-started/images-and-fonts)
docs.

### 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-12-08 14:19:53 -08:00
Sebastian "Sebbie" Silbermann c291ff6b41 docs: Fix image component API reference parsing (#73658) 2024-12-08 17:58:35 +01:00
Steven f8494b48eb chore(docs): mention uses for unoptimized (#73604)
Add docs for `unoptimized` use cases.

- Closes https://github.com/vercel/next.js/issues/72140
2024-12-06 22:13:36 +00:00
yeji kim 1718d7372e docs(composition-patterns): add missing React.ReactNode type in layout.tsx example (#73577) 2024-12-06 16:41:02 +01:00
Zack Tanner a54beacc6c docs: fix forbidden file paths (#73575)
Noticed this while reviewing the docs -- unauthorized is fine, but
forbidden has incorrect file paths for the examples.
2024-12-06 13:57:42 +00:00
Jiachi Liu fdd93c11df docs: update the outdated generate sitemaps doc with versioned changes (#73547)
Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com>
2024-12-06 10:52:05 +00:00
Sebastian "Sebbie" Silbermann 550f4a8ca9 Use stable @types/react (#73563)
Also updated docs now that we no longer need these weird `npm:types-react` aliases.
2024-12-05 21:45:58 +01:00