Commit graph

30 commits

Author SHA1 Message Date
Delba de Oliveira
971a1a6421
Docs: Address community feedback (#61857)
Closes: 

- https://github.com/vercel/feedback/issues/54964
- https://github.com/vercel/feedback/issues/54580
- https://github.com/vercel/feedback/issues/54555
- https://github.com/vercel/feedback/issues/54341
- https://github.com/vercel/feedback/issues/54309
- https://github.com/vercel/feedback/issues/53751
- https://github.com/vercel/feedback/issues/55173

Add diagram: https://github.com/vercel/front/pull/29561
2024-02-10 09:59:29 -06:00
Delba de Oliveira
cb42417985
Docs: Update parallel routes docs, add default.js pt 1. (#60806) 2024-01-18 17:57:54 -06:00
Delba de Oliveira
ee425d4cb2
Docs: Document generateSitemaps (#59626) 2023-12-18 13:40:56 +01:00
vivianyentran
fd0c3c63ec
docs: update installation section (#58555) 2023-11-16 21:39:18 -06:00
Lee Robinson
92b4d6737c
docs: Next.js 14 (#57342)
- Fetch logging configuration is no longer experimental
- Add `unstable_noStore` reference
- Add `unstable_cache` reference
- Add codemod docs for `next/og` import changes
- Update docs around stable Server Actions
- Add example of revalidating the entire data cache
- Update static export docs for `next export` command removal
- Update minimum required Node.js version
- Add `viewport` and `generateViewport` reference

Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
2023-10-26 15:30:43 +00:00
Vũ Văn Dũng
cf3d73a46b
Add the default import alias to create-next-app prompt for clarity (#55896)
### Why?

Whenever I run `create-next-app` and reach this question

```
Would you like to customize the default import alias? No / Yes
```

I always have to select "No", because I don't remember what this default import alias here is. [It _is_ documented to be `@/*`](https://nextjs.org/docs/app/api-reference/create-next-app#non-interactive), but the documentation is relatively hidden and not many people know about it – it's also easy to forget.

Even more confusingly, the next question ("What import alias would you like configured?") doesn't have this `@/*` as the default answer, but the user's last choice as the default answer instead (which could be different from `@/*` – making people wonder if Next.js changed their defaults overnight).

I suppose it would be better to just make it clear in the prompt itself, so people with skill issues who happen to forget that default value (like me) can still confidently select "Yes" if they want `@/*`, without having to do "No" and manually type `@/*` again.

### How

```diff
- Would you like to customize the default import alias?
+ Would you like to customize the default import alias (@/*)?
```
2023-09-26 22:58:46 +00:00
MUTESA Cedric
730b43d0ce
docs: link from install docs to create-next-app-docs (#55909)
as many developers are moving to bun, its a good idea that it also be included as an installation method.



Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-09-26 15:28:56 +00:00
water
ed6e8010e4
Update 02-project-structure.mdx (#55940)
Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
2023-09-26 10:08:55 +00:00
迷悟
57bbc59028
docs: fix typo (#54973) 2023-09-06 07:16:19 +00:00
Hyewon Kim
85fb714f16
docs: Fix typo in getting-started/project-structure (#55035)
<!-- 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 #

-->

- Fix typo in [Next.js Project Structure: Top-level
files](https://nextjs.org/docs/getting-started/project-structure#top-level-files)
- It's common to create it as `next-env.d.ts` without dots.
2023-09-06 00:12:17 -07:00
Delba de Oliveira
94b7743cbe
Docs: Fix formatting issues in the rendering docs (#54517) 2023-08-24 16:49:46 +00:00
Delba de Oliveira
1dc5c066cb
docs: Rewrite Rendering Section and React Essentials Page (#51579)
We initially wrote the [React
page](https://nextjs.org/docs/getting-started/react-essentials) to
introduce Server Components in the App Router, but over time, some
implementation details have changed, and the information has become
stale. The React team is working on adding new docs, so I'd like to
change the narrative on the Next.js docs from "client vs. server
components" to "writing code for the server and for the client" - and
link back to the React documentation when it becomes available.

As React developers, we're very familiar with writing code for the
client, it's nice and simple. But doing so comes at the expense of not
being familiar with the server. The aim of these docs is to help
developers become proficient in both the client and server environments.

I'd like to take it back to the foundations, and not use abstractions
like SSG and CSR, MPAs or SPAs, as those terms come with their own set
of assumptions that make it harder to understand how RSC works. Instead,
we'll focus on the request lifecycle, show how application code flows
from the server to the client, and discuss the trade-offs of doing
operations in each environment.

- [x] Page: Rendering Fundamentals
   - [x] Environments: Client and Server
   - [x] Request-response lifecycle
   - [x] Network Boundary
- [x] Page: Server Components
    - [x] Benefits and use cases of server rendering
    - [x] How to use Server Components in Next.js
    - [x] How Server Components are rendered
    - [x] Static Rendering
    - [x] Dynamic Rendering
    - [x] Streaming
- [x] Page: Client Components
    - [x] Benefits and use cases of client rendering
    - [x] How to use Client Components in Next.js
    - [x] How Client Components are rendered
        - [x] Initial vs. Subsquent navigation
- [x] Page: Composition Patterns
    - [x] When to use client and server components
    - [x] Server Component Patterns
    - [x] Client Component Patterns
    - [x] Interleaving Client and Server Components
- [ ] ~Diagrams~ will follow up with new PR.
- [x] Set up redirects: https://github.com/vercel/front/pull/24917

---------

Co-authored-by: Térence Hollander <hollanderterence@gmail.com>
Co-authored-by: shawnthwei <32075290+shawnthwei@users.noreply.github.com>
Co-authored-by: Michael Novotny <manovotny@gmail.com>
2023-08-24 08:48:44 -05:00
Steven
f6d2aa09de
fix: minimum node version 16.14.0 (#54331)
- Fixes https://github.com/vercel/next.js/issues/54269
- Related to https://github.com/vercel/next.js/pull/54285
2023-08-22 08:58:53 +00:00
Banbarashik
424b205344
fix typo (#53908)
remove misused pronoun "it"

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-08-11 21:59:31 +00:00
Delba de Oliveira
dc3936b11a
Docs: Review Getting Started Section (#53377)
I've started reviewing the docs to identify areas we need to cover / improve. This PR contains minor improvements for the **getting started**, **installation**, and **project structure** pages.


New tasks added to linear: 
- Create [middleware.ts](https://linear.app/vercel/issue/DX-1834/create-middlewarets-api-reference-in-file-conventions) page
- Create [instrumentation.ts](https://linear.app/vercel/issue/DX-1833/create-instrumentationts-api-reference-in-file-conventions) page
2023-08-01 15:12:18 +00:00
Delba de Oliveira
98c3076eb4
Docs: Document caching mechanisms (#52514)
This PR document the caching semantics in Next.js, how they interact, and what APIs affect them. We're also taking the opportunity to consolidate terminology, remove duplicate content, and update sections of the docs that relate to caching. 

### Documentation

- [x] Create a new section for caching
- [x] Explain how the different caching mechanisms work
   - [x] Request Memoization (React Cache)
   - [x] Persistent Data Cache 
   - [x] Persistent Full Route Cache 
   - [x] In-memory, client-side Router Cache 
- [x] Document how different APIs affect caching
- [x] Document cache interactions 
- [x] Clean up stale information in the other docs sections
   - [x] Routing Section
      - [x] Move advanced navigation topics from fundamentals to **How Navigation Works** section
      - [x] Rewrite the **How Navigation Works** section
   - [x] Rendering Section
      - [x] Simplify fundamentals page
      - [x] Rewrite the **Static and Dynamic Rendering** pages
      - [ ] ~Create a page to explain how **Client and Server Components** are rendered~. Moved to this PR: https://github.com/vercel/next.js/pull/51579
   - [x] Data fetching section 
      - [x] Consolidate data fetching story for fetching, caching, and revalidating
      - [x] Clarify data fetching story with 3rd party libraries and React `cache`
      - [x] Create **Data Fetching Patterns** page
- [x] Document other related behaviors: 
   - [x] Update information on scroll position for back/forward navigation 
   - [x] Remove the concepts of **soft and hard navigation**
   - [x] Remove the concepts of **static and dynamic data fetching**
   - [x] Use consistent terminology **runtime** 👉🏼  **request time**. Runtime for Edge and Node.js, request time to describe when dynamic stuff happens
   - [x] `generateStaticParams` being able to seed the Full Route Cache
- [x] Polish 💅🏼 

---
### Related PRs:

- Diagrams: https://github.com/vercel/front/pull/24142
- Redirects: https://github.com/vercel/front/pull/24179
2023-07-31 17:03:26 +00:00
Aryan Malik
ccc269a5ae
Update 01-installation.mdx (#53192)
Added switcher on `page/_document.tsx` example just for a consistency
2023-07-26 15:34:27 +00:00
trigaten
e4871f6927
docs: remove unneeded good to know section during installation (#53078)
Co-authored-by: Lee Robinson <me@leerob.io>
2023-07-23 09:49:51 -07:00
Fernand
1989f4943d
Fixed grammar in 03-react-essentials.mdx (#52597)
"will eventually be should be placed" was changed to "will eventually be placed".
2023-07-12 15:51:33 +00:00
Nick Mazuk
1ffada9a70
docs: Simplify message in React essentials section. (#52469)
`Infact` is not a word. It should be `In fact`.

Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-07-09 19:13:04 +00:00
Delba de Oliveira
931b1b5d87
[Docs] Add manual installation instructions for pages (#51995)
Fixes: https://github.com/vercel/next.js/issues/51938
2023-07-06 15:06:31 +00:00
Chris Yang
11bd7725b5
Add missing url hash (#52123)
<!-- 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>
2023-07-03 08:36:09 -07:00
Steven
97461f0bba
fix(create-next-app): consolidate messages to "Would you like to use" (#52011)
This PR ensure that `create-next-app` questions are all formatted the
same way:

```
Would you like to use <feature>?
```

fix NEXT-1333
2023-06-30 18:11:23 +02:00
Christian Ivicevic
73491308b4
[docs] Replace the term "hole" with "slot" (#51919)
It feels more natural to use the actual term "slot" when describing how
to interweave server and client components since it's used in other
frameworks as well.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-28 16:07:15 -07:00
Charles Dudley
e140e90e05
[Docs] Fix usage of article "an" before a consonant sound (#51803)
Because `<Carousel />` starts with the consonant, "C", the preceding article should be "a" not "an".

Reference: [https://www.merriam-webster.com/words-at-play/is-it-a-or-an](https://www.merriam-webster.com/words-at-play/is-it-a-or-an)
2023-06-26 15:34:31 +00:00
Bigyan
df08b22e7f
docs: fix generated app icons file extensions (#51562)
The file extensions of the generated file extensions section are not what it's supposed to be or not what documentation has specified.

Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
Co-authored-by: Jiachi Liu <4800338+huozhi@users.noreply.github.com>
2023-06-23 10:34:16 +00:00
Michael Novotny
cefdb27662
docs: Adds Note to Good to know consistency (#51080)
* Changes all `Note` → `Good to know`
* Consistently puts the colon on the outside of bold text
* Documents singe and multi-line styles in contribution guide

---------

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
2023-06-12 19:00:07 -07:00
Michael Novotny
a973ad64d4
Makes codeblock language and filename extensions consistent (#51056)
There was mismatched usage of `js`, `jsx`, `ts`, and `tsx`. Just tried to get them all in sync.
2023-06-12 18:55:08 +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
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