Commit graph

1422 commits

Author SHA1 Message Date
Michael Novotny
83860091a6
Removes PORT from .env concatenation example (#51063)
This is to [avoid confusion](https://github.com/vercel/next.js/issues/32603#issuecomment-996751692) about being able to set Next.js's port via `.env`, which is currently not allowed.
2023-06-10 10:47:49 +00:00
Delba de Oliveira
ccc64d96b6
[Docs] Remove html <b> from summaries (#51008)
This PR removes manual HTML `<b>` tags in `<details><summary>...` titles. They are unnecessary because we add bold styling in CSS.

Also did a tiny fix to some other unnecessary inline HTML.
2023-06-09 22:12:58 +00:00
Michael Novotny
9fad474018
Adds the "why" for next/image optimization (#51066)
Give a touch more context as to why one would want to use image optimization.

Fixes #30220
2023-06-09 22:02:35 +00:00
Delba de Oliveira
9c44c1dca1
[Docs] Add section on how to preview docs changes on VSCode (#51019) 2023-06-09 15:16:19 +00:00
Delba de Oliveira
9800eaf467
[Docs] Clarify a few things about the instrumentation.ts file (#51034)
There was some confusion about where to place it.
2023-06-09 13:40:53 +00:00
Alain Kaiser
8370e52a32
Fix Typo in Metadata API Description (#51024)
### Fix Typo in Metadata API Description

#### Description:

This PR fixes a minor typo in the description of the Metadata API.

#### Changes:

- Fixed typo in the Metadata API description. 

**File:** `docs/02-app/01-building-your-application/05-optimizing/04-metadata.mdx`

**Old Sentence:**

> Next.js has a Metadata API that can used to define your application metadata (e.g. `meta` and `link` tags inside your HTML `head` element) for improved SEO and web shareability.

**New Sentence:**

> Next.js has a Metadata API that can be used to define your application metadata (e.g. `meta` and `link` tags inside your HTML `head` element) for improved SEO and web shareability.

This change helps improve the readability and understanding of the documentation for readers and users.

#### Checks:

- [x] Followed the Docs Contribution Guide
- [x] Linting passes (`pnpm build && pnpm lint`)
2023-06-09 12:20:41 +00:00
Kevin Ang
e5b88caed7
fix revalidateTag import (#51005)
This PR fixes the erroneous `revalidateTag` import on certain examples.
It was imported from `next/server`, but should be imported from
`next/cache` instead.

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
2023-06-09 09:23:58 +01:00
Taylor Bryant
8484a6b9c2
Fix typos in 01-contribution-guide.mdx (#51006)
This PR fixes some small typos in the Contribution Guide.
2023-06-09 08:16:12 +00:00
Tyler Lutz
aef03cf3a5
docs: update ESLint prompt output. (#50986)
Co-authored-by: Lee Robinson <me@leerob.io>
2023-06-08 19:07:58 -07:00
PatrickCodes_
3817770bc0
docs: update Route Handlers to have JS/TS code snippet. (#51003)
Added a TS and JS switcher. Previously the code snippet did not have a
switcher. The file extension was .js when the code was TypeScript which
made it confusing to try to read.

---------

Co-authored-by: Lee Robinson <me@leerob.io>
2023-06-08 19:06:08 -07:00
Michael Novotny
9c4b0ec9e9
Adds missing JavaScript codeblock in Opengraph Image API reference (#50996)
Also changes JavaScript examples to use `.jsx` extensions so IDEs better recognize the JSX allowed as the first argument to `ImageResponse`. 

Fixes #50141
2023-06-08 21:29:47 +00:00
didemkkaslan
f2cbfe3147
docs: Fix typo in colocation documentation. (#50975) 2023-06-08 12:16:48 -07:00
Tyler Lutz
3ccbe82280
Update create-next-app docs (#50981)
### What?

Update the create-next-app prompts and create-next-app --help
documentation
2023-06-08 12:16:05 -07:00
Ethan Mick
9a08206242
docs: Correct useFormStatus to be a client component (#50991)
### What?

The `useFormStatus` needs to be used in a client component. That
component should be used within a `form` for the `pending` property to
reflect the form status.

### Why?

The docs are currently not accurate.

### Notes

I could also update the name of the file to not be `form.js`, which
implies this is the entire form instead of just the submit button being
used as a component within the form.
2023-06-08 12:13:13 -07:00
Michael Novotny
61a553963d
Adds missing async to Opengraph Image code example. (#50990) 2023-06-08 12:08:04 -07:00
Jiwoo JEONG
b8e08abf9e
fix: add missed / at useSelectedLayoutSegment at App routing/Pages and Layout (#50956)
## Why?
- When i click `red box` in following image, page returns 404 page.
<img width="1728" alt="스크린샷 2023-06-08 오후 7 31 37" src="https://github.com/vercel/next.js/assets/63336958/903b11e3-17af-426e-8787-b6e033c14a24">

## How?
- I found that `/` is missed at `docs/02-app/01-building-your-application/01-routing/02-pages-and-layouts.mdx`.
- So I added `/`.
2023-06-08 15:33:25 +00:00
Delba de Oliveira
f4f34e4226
[Next Docs] Migrate new docs from next-site to Next.js repo (#50701) 2023-06-08 12:03:14 +02:00
Delba de Oliveira
8c2e5bd072
Update codeowners to use Vercel Spaces (#50841)
Move as much of codeowners as possible to use Vercel Spaces. 

1. Makes `@timneutkens @ijjk @shuding @huozhi @feedthejim` global owners
2. Make the `@vercel/next-js` team _optional_ owners of **/docs**,
**/errors**, and **/contributing**, makes team owners of a few packages
as per old config.
3. Make `@vercel/devex` (docs and devrel) owners of **/docs**,
**/errors**, and **/contributing**
4. Make `@vercel/devrel` (devrel only) owners of **/examples**
5. Make `@vercel/web-tooling` owners of specific files and folders (as
per old config)

Leaves @styfle as owner of **image** files on the old config since this
pattern `/**/*image*/** ` can't be used with Vercel Spaces.

Note: We cannot add * or / at the end of files.
[Docs](https://spaces-docs.vercel.sh/docs/code-owners#:~:text=Code%20Owners%20files%20are%20meant%20to%20encourage%20distributed%20ownership%20definitions%20across%20a%20codebase.)
2023-06-08 12:02:18 +02:00
Javi Velasco
aa91de56ce
Remove static analysis of process.env (#50260)
Since there is no longer a limitation that requires us to static analyze
`process.env`, this PR removes it from the build process and updates the
corresponding documentation.
2023-05-24 08:19:02 -07:00
Anders Kjær Damgaard
428342dbdf
Add --use-yarn flag to create-next-app (#49407)
# Add `--use-yarn` flag to `create-next-app`

fixes #49405

- [x] Implement `--use-yarn` flag
- [x] Update docs
- [x] Add tests

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-05-10 14:51:12 +02:00
Gabriel Schneider
c9d87eec7c
Add note about custom distDir to standalone build docs (#48592)
### What?
Add a note that if a custom `distDir` has been set, the standalone build
can be found at the specified location and the static files folder has
to be copied to the custom location as well.

### Why?
This may be obvious, but such a note would've saved me some minutes, not
gonna lie.

### How?
\-

---------

Co-authored-by: Steven <steven@ceriously.com>
2023-05-10 12:33:24 +02:00
Maia Teegarden
fdd6e979f4
Turbopack alpha -> beta (#49103)
Closes WEB-918
Closes WEB-913
2023-05-04 16:53:40 +02:00
Shu Ding
83b774eeb6
Fix standalone mode with appDir running in a single process (#49116)
Fixes #49055, fixes #48918. 

App dir will always require the server to run in the workers mode, so it
can keep a separate Node.js process for pages. This PR updates the
standalone server to initialize a "standalone server" (which works
similar to `start-server`), and changes the tracked files to include
Jest worker.
2023-05-04 05:55:05 +02:00
Tim Neutkens
3cb15a064b
Update create-next-app App Router question (#49111)
<!-- 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 or adding/fixing 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>
2023-05-02 17:28:31 -07:00
JJ Kasper
26f69d5ef3
Simplify CNA prompts a bit (#49063)
This updates the default CNA prompts a bit to be more straightforward.

x-ref: [slack thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1681919151818769)
x-ref: [slack thread](https://vercel.slack.com/archives/C04K237UHCP/p1682959312307409)
2023-05-02 17:01:36 +00:00
Alberto Vilches
2343610fdf
fix: wrong link in docs (#49001)
A link to a third-party package in the docs directs you to the wrong page.
2023-05-01 15:28:50 +00:00
Steven
e7c9d3c051
fix: bump minimum Node.js version to 16.8.0 (#48957)
We bumped `undici` fetch which has a minimum version of 16.8.0 so we need to make sure `next` and `create-next-app` also have the same minimum version.

Since 14.x reaches End-of-Life on [2023-04-30](https://github.com/nodejs/Release), we can drop support for 14 in the next release.

See also:

- Related to #48870
- Related #48941
2023-04-28 15:07:54 +00:00
Jan Kaifer
cc2bcece63
Start recommending gRPC with otel (#48915) 2023-04-28 11:43:28 +00:00
JTaylor0196
f7baa56792
update example Deploy button URLs (#48842)
### What?
Updates Deploy button URLs for all listed examples here:
https://github.com/vercel/next.js/tree/canary/examples

### Why?
The Deploy URLs are currently broken and result in a failed clone
attempt on Vercel.

### How?
The URLs have been changed from https://vercel.com/new/git/external?… to
-> https://vercel.com/new/clone?…
(Last updated
[here](8eaabe2fb0)
in 2021)
2023-04-26 13:31:44 -04:00
Martin Wahlberg
c390c1662b
Add missing word to getStaticProps documentation (#48854)
### What?
Added missing `that` to documentation for getStaticProps

### Why?
This change fixes grammar.

### How?
Updated the text.
2023-04-26 14:02:53 +00:00
Jan Kaifer
db764c35e6
Add support for async instrumentation register (#48575) 2023-04-24 11:43:50 +00:00
Chris
2679ab672d
Update naming for Next.js Analytics (#48618)
Updates the name of Next.js Analytics to Next.js Speed Insights

closes ALY-579

---------

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-04-24 12:14:45 +02:00
Afonso Jorge Ramos
2e99645b6c
docs: update Image props (#48726)
Hey! Hope this can help anyone dealing with this in the future.

I'm also using the `TinaMarkdown` provider to generate my MDX and one of the things that I've found helpful so that the image was better handled in the browser was to set position to `undefined`, as it was the only way to unset it from `absolute`, which was affecting the visual aspect of the page.

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-04-23 20:28:03 +00:00
Jan Kaifer
82a01c11a7
Fix TYPO in otel docs (#48623)
<!-- 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 or adding/fixing 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 #

-->
2023-04-20 11:30:40 +00:00
Ryo
9c0a8ce730
Docs: Unify note formatting (#48417)
<!-- 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 or adding/fixing 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 #

-->

closes #48416 

### What?

Standardize the "Note" format in the Next.js documentation for improved
consistency and readability.

### Why?

There are currently four different variations of "Note" formatting in
the documentation.
Standardizing to a single format will improve the overall experience for
users.

### How?

Update all instances of "Note" in the documentation to follow the most
common format, `**Note**:` (used in 27 files).
This will involve updating the following variations:

- `Note` (12 files)
- `Note:` (20 files)
- `**Note:**` (21 files)

---------

Co-authored-by: Steven <steven@ceriously.com>
2023-04-19 20:21:28 +00:00
Toru Kobayashi
7b6e336bc5
docs: fix minimum Node.js version to 14.18.0 (#48545)
fixes #42729

According to #42729, the minimum Node.js version of Next is `14.18.0`,
but some docs say `14.6.0`, and it's error-prone.
https://github.com/vercel/next.js/issues/42729#issuecomment-1309947579
pointed out it's a bug rather than wrong documentation.

But Node v14 is going to be EOF this month, so Next will update the
minimum version in the next major release.
https://github.com/nodejs/release#release-schedule

So I feel it's enough to only fix the documentation rather than fixing
the implementation to work with 14.6.0 as a temporary fix.


<!-- 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 or adding/fixing 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: Steven <steven@ceriously.com>
2023-04-19 15:16:37 +00:00
Chris McGrath
a9e4b795d7
typo (#48495)
<!-- 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 or adding/fixing 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 #

-->
2023-04-18 02:39:15 +00:00
Rodrigo Feijao
3aca97b410
Update instrumentation.md (#48394)
There is a typo on `export const` where it should be `export function`
2023-04-14 19:06:21 +02:00
Jan Kaifer
79f4e11034
Fix grammar and typos in OTEL docs (#48235)
I ran a grammar check on OTEL docs to get any remaining issues that
spell check didn't fix.

---------

Co-authored-by: Steven <steven@ceriously.com>
2023-04-13 21:21:06 -07:00
Mohit Yadav
c1991c6bae
docs: fix grammar for dynamic routes catch-all explanation and give better examples (#48181)
### Why?

Making the explanation more obvious because it took quite a while for me
to figure out the difference between catch-all and optional catch-all,
and I think others may feel the same way too.

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-04-13 21:12:46 -07:00
Jan Kaifer
89366ff44c
Add information about deploy to open telemetry docs (#48241)
Added information on how to deploy with OTEL.

- mentioned that `@vercel/otel` works on Vercel and when self-hosted
- added links to Vercel docs
- added links into OTEL docs for self-hosted
- Added information about custom exporter

Questions:

- should we mention Datadog, NewRelic and others as an examples of
custom exporters?
  - https://docs.datadoghq.com/opentelemetry/
-
https://docs.newrelic.com/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/opentelemetry-legacy-new-relic-exporters/
2023-04-12 14:45:46 +00:00
apeltop
8bacad921b
Fix typo in script.md (#48225)
occuring -> occurring

I hope it helps.

<!-- 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 or adding/fixing 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 #

-->
2023-04-11 13:26:23 +00:00
Jan Kaifer
af12a94a28
Docs: Describe how to manually configure open telemetry (#48071)
It's currently not clear that `@vercel/otel` is just a simple wrapper
when you are trying things out. So I added an excellent example of how
to instrument create an OpenTelemetry setup.

The only FUD I have here is that people won't skip that `Manual
OpenTelemetry setup` and try to understand it. But I try to describe
this at the beginning of that section.

I'll also try to update `@vercel/otel` readme to be more transparent on
what it does.
2023-04-11 10:59:00 +00:00
Chandrajeet Maurya
536b4dca8c
Update deployment.md (#48062)
Since the code above is referring to `package.json` it should be `npm
run build` and `npm run start` instead of running `next build` and `next
start` directly

<!-- 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 or adding/fixing 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>
2023-04-07 08:38:59 -07:00
Steven
690208b11f
fix: show error when "next start" is used with "output" config (#47989)
fix #47334
fix NEXT-861
2023-04-06 17:28:27 -07:00
Jan Kaifer
e35710f71f
Recommend @opentelemetry/api instead of @vercel/otel reexport (#48013)
- remove vscode folder from example
- recommend `@poentelemetry/api` over `@vercel/otel`

<!-- 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 or adding/fixing 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 #

-->

fix NEXT-959
2023-04-06 14:17:47 +02:00
Jan Kaifer
dd959251e6
Docs: Improve Open Telemetry documentation (#47955)
- Removed duplicate information
- Add links into official docs to explain `http.*` attributes
- Properly explain what `next.page` means.
fix NEXT-945

---------

Co-authored-by: Lee Robinson <me@leerob.io>
2023-04-06 11:41:19 +00:00
Gustavo Steinmetz
9df4e0614e
Update Local Images Example to Use Assets Folder (#47878)
This pull request updates the Local Images example in the Next.js
documentation to use an ``assets`` folder inside the ``src`` directory
instead of the ``public`` folder. The changes are made to emphasize the
recommended practice of organizing and importing static assets when
using the Next.js ``Image`` component.

The previous example could cause confusion as it suggested importing
images from the ``public`` folder, which is generally used for static
files that can be accessed directly via a URL. However, when using the
Next.js ``Image`` component, it is recommended to import images as
modules and store them in a folder like ``assets`` inside the ``src``
directory. This approach allows the Image component to optimize images
and prevent Cumulative Layout Shift while loading.

This PR changes the image import statements as the example below:

```jsx
import profilePic from '@/assets/me.png';
```

These changes aim to provide clearer guidance on how to handle local
images. To avoid misunderstandings while the developer follows the
documentation.

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-04-05 04:10:31 +00:00
Swarnava Sengupta
a79d1efdd0
[Docs] Update react docs link (#47891)
- This PR fixed the  Documentation link of new react.dev website.
2023-04-04 11:56:03 -07:00
Jan Kaifer
a3acbf4f55
Add documentation on OTEL support (#47194)
Added docs that mention:
- important code-snippets from example
- links to official OTEL docs
- document NEXT_VERBOSE_OTEL
- explain what we provide out of the box
- what we don’t
- explain how you can add tracing yourself
- explain how instrumentation.js works
- it can be used for different types of instrumentation that don't use
OTEL. It's just a hook called when starting up a new node environment.

- list of all spans we instrument by default
 
fix NEXT-799 ([link](https://linear.app/vercel/issue/NEXT-799))

---------

Co-authored-by: S3Prototype <liuqahs15@gmail.com>
2023-04-04 14:24:46 +00:00