Commit graph

960 commits

Author SHA1 Message Date
Maedah Batool
1f685ae532
Fixed broken links in data fetching docs (#33250)
Found some broken links in the updated Data Fetching docs. Fixed all of these.

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`


Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2022-01-13 16:12:55 +00:00
Gonzalo Pozzo
0c5f4e7844
Update font-optimization.md (#33266)
Copy pasting the first paragraph will trigger the `@next/next/google-font-display` lint rule, users should be able to copy and paste it without warnings.
2022-01-13 15:31:08 +00:00
Hammed A. Olajide
cc345b74ca
Typo Fix (#33252) 2022-01-13 13:39:53 +01:00
Aziz Abbas
de54ad895c
[examples] Add a statically generated blog example using Next.js and Builder.io (#22094)
A statically generated blog example using Next.js and [Builder.io](https://builder.io), demo on [https://cms-builder-io.vercel.app/](https://cms-builder-blog.vercel.app/)
2022-01-12 21:58:43 +00:00
Alexander Kachkaev
6c8808e90e
Remove outdated & possibly confusing statement about redirects (#33224)
## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`

The statement I have removed may be misleading. A colleague of mine has interpreted it as ‘we need to create a custom page or `<Link href="/redirect-path" />` won’t work on the client’. I just ran `npx create-next-app --example redirects redirects-app` and confirmed that this was not necessary.

So saying that redirects “do not affect client-side routing” is probably wrong. They do and they do it the right way.
2022-01-12 17:32:23 +00:00
Rich Haines
22eca10c6a
Added links to data fetching api refs, fixed title (#33221)
This PR adds links from the data fetching api pages to their api ref pages. Also removes rouge backticks on header

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-01-12 15:52:55 +00:00
Rich Haines
b3226303be
Removed backticks on data fetching api titles (#33216)
This PR removes the backticks used when referring to a data fetching api in a title `getStaticProps` => getStaticProps

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-01-12 14:21:22 +00:00
Rich Haines
029f2e360f
Fixed broken link (#33209) 2022-01-12 13:35:17 +01:00
Rich Haines
d291aa9134
Refactor data fetching API docs (#30615)
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-01-12 08:56:51 +01:00
Hiroaki Ogasawara
b6b7d85f6d
Docs: correct ignorance pattern for .env.local (#32647)
* Docs: correct ignorance pattern for env.local

In order to gitignore `.env.local`, I need to add `.env*.local` instead of `.env.*.local` to `.gitignore`.

* Update docs/basic-features/environment-variables.md

Co-authored-by: Steven <steven@ceriously.com>

* Update docs/basic-features/environment-variables.md

Co-authored-by: Balázs Orbán <info@balazsorban.com>

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-01-12 02:56:07 +01:00
Manny Becerra
36eba95227
Fixes #33153: Updating cross-references from master to main + canary (#33198)
* copy cleanup in env. variables docs

* copy cleanup in fast refresh docs

* Supplements #33153 - updating existing cross-references to `master` branch to renamed default branch of `main`

* Supplements #33153 - updating existing cross-references to `master` branch to renamed default branch of `main`

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-01-12 02:55:35 +01:00
Glenn Gijsberts
5f4947e5a2
Add Caveats section to custom error page (#33160)
## Desscription

This is a follow up of https://github.com/vercel/next.js/pull/32873. As discussed in #32873, currently it's not recommended to use getServerSideProps in the `Error` component, so this PR will add that caveat to the documentation page, like `Document` and `App` also have.

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-01-10 21:52:08 +00:00
Alexandru Tenie
8ae08b94d8
No info on environment variables in the src folder (#33110) (#33136)
Proposes fix to #33110

Adds info on environment variables and the /src folder in the following docs:

- https://nextjs.org/docs/advanced-features/src-directory
- https://nextjs.org/docs/basic-features/environment-variables#loading-environment-variables

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`


Co-authored-by: Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
2022-01-10 13:58:29 +00:00
Manny Becerra
213f5a43ea
docs: minor text-copy cleanup (#33120)
Proposes some minor text-copy cleanup in the following docs:

- https://nextjs.org/docs/basic-features/fast-refresh
- https://nextjs.org/docs/basic-features/environment-variables

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-01-10 10:52:47 +00:00
Balázs Orbán
e5e04c9039
Update using-mdx.md (#33077) 2022-01-07 00:32:31 +01:00
Lee Robinson
52d5adf8ab
Fix link for Next.js Analytics in docs (#33049)
The relative path was not working.
2022-01-06 01:30:34 +00:00
Lee Robinson
26ddf32f53
Update deployment documentation. (#32006)
Building off https://github.com/vercel/next.js/pull/31465 for `next export` docs.

- Clearly explains the standard output from `next build`
- Move Dockerfile snippet to example, instead of embedded directly
- Clarify both Vercel and `next start` use the Build API output spec
- Less emphasis on recommending Vercel (more neutrality)
- Mention Middleware & Edge Functions when discussing Vercel
- Add "Going to Production" link at the bottom for related reading
2022-01-05 21:56:05 +00:00
Balázs Orbán
3ad2035ae6
feat(cli): introduce next info CLI command (#32972)
This PR adds a new command to the `next` CLI.

Running `next info` will print useful information to the terminal about how/where Next.js is run. This information can be added to the Bug report when opening an issue in the repository.

This makes reporting issues more accurate and doesn't require the user to guess certain details, the command will retrieve it on their behalf.

Example output:

```sh
$ npx --no-install next info

    Operating System:
      Platform: linux
      Version: #22-Ubuntu SMP Fri Nov 5 13:21:36 UTC 2021
    Binaries:
      Node: 16.13.0
      npm: 8.1.0
      Yarn: 1.22.17
      pnpm: 6.24.2
    Relevant packages:
      next: 12.0.8-canary.14
      react: 17.0.2
      react-dom: 17.0.2


```

The idea is based on #32858

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`


Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2022-01-04 15:35:32 +00:00
Mike K
7c8500f16d
Updated wrong link to example of gtag init in measuring-performance.md (#32974)
Updated wrong link to example of gtag init



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ x ] Make sure the linting passes by running `yarn lint`
2022-01-04 01:57:59 +00:00
Doug
92c5aa8001
Update scrolling example using query param instead of hash (#31473)
The example cited doesn't make sense, unless I'm truly missing something. The example is talking about hashes... i.e. #about. Not a query param, like ?=count=10. So in the example, the scroll={false} doesn't make any sense, since the href is not using a hash/anchor tag. I could be wrong, so be gentle.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-01-01 18:11:09 +00:00
minervabot
a17807246f
Update lint-staged example to use node.js path (#30510)
The current example attempts to remove resolve the relative pathname of the absolute pathnames given by `lint-staged` using string manipulation and `process.cwd()`. This is a risky solution because pathnames have many platform dependent edge cases. The example also returns pathnames that are technically wrong in linux. `/home/project/file => /file`,

I propose to use the utilities provided by node.js to resolve the relative pathnames, and to format the sample `.lintstagedrc.js` file in a manner easier for novice programmers to understand and modify.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-01-01 17:35:28 +00:00
Houssein Djirdeh
d72f5bd69d
[ESLint] Adds lint rule to flag usage of <head> (#32897)
## Bug

- [X] Related issues linked using `fixes #number`
- [X] Tests added
- [X] Errors have helpful link attached, see `contributing.md`

Fixes #30142
2021-12-31 05:09:44 +00:00
Jiachi Liu
636d3aeda7
doc: add quotes to api (#32898)
x-ref: #32896
2021-12-29 18:15:23 +00:00
Shu Ding
ec2e107f7f
Update the React 18 documentation (#32896)
Currently you don't need to enable `concurrentFeatures` to start using React 18, this PR makes the docs more clear on that.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2021-12-29 17:25:55 +00:00
JJ Kasper
723caedaac
Update note about .next/static in standalone mode (#32771) 2021-12-23 12:24:38 -06:00
Balázs Orbán
48dba6457d
chore: convert Jest examples to TypeScript (#32705)
* chore: convert Jest examples to TypeScript

* test: use absolute imports in test files

* chore: address review comments

* fix: add pages to tsconfig.json paths

* fix: add styles to tsconfig.json paths

* chore: upgrade dependencies/snapshots

* docs: match Testing docs with example code

* docs: link to docs from mock test files

Co-authored-by: Lee Robinson <me@leerob.io>
2021-12-22 01:12:07 +01:00
Kiko Beats
0eba5b2558
web runtime: add AbortController & AbortSignal (#32089)
It adds AbortController and AbortSignal Web runtimes APIs to be used by the user at Edge Functions.

For doing that it delegates into `abort-controller` dependency that has been frozen to prevent any modification.

Co-authored-by: Zhang Zhi <20026577+fytriht@users.noreply.github.com>
2021-12-21 17:12:53 +00:00
Rich Haines
4f67edd638
Added example for setting cookie before redirect in middleware (#32542) 2021-12-21 15:12:02 +01:00
Rich Haines
f176683806
Added section about router methods returning a promise (#31341)
This PR adds a section on certain router methods returning a promise, and the error you will see if you have no-floating-promises enabled.

## Bug

- [x] Related issues linked using fixes: https://github.com/vercel/next.js/issues/31337
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2021-12-19 23:07:11 +00:00
Dan Page
2be207a288
Add moduleDirectories for TS Jest Config (#32574)
It took me a while to work out that if using TypeScript with the `baseUrl` set to `.` (quite common) - then the tests fail as Jest can't find the modules.

Explicitly setting the `moduleDirectories`, as per the change to the config, fixes this issue.



## Documentation / Examples

- [x] Fixup commit
- [x] Make sure the linting passes by running `yarn lint`
2021-12-17 21:30:26 +00:00
Hike Baghdasaryan
f26fea92af
Fix typo in documentation (#32581)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2021-12-16 18:39:14 +00:00
JJ Kasper
15ff1a37d9
Document basePath redirect field for getStaticProps/getServerSideProps (#32550) 2021-12-16 09:54:40 +01:00
Madison Dickson
0794cc07c0
Include mention of the onError Prop for next/script (#31945)
* Include mention of the onError Prop

None of the documentation includes this, despite being written into the code.
Would be good to mention the function signature change somewhere between v11 and v12 that now includes the error object. (Was confused when my TS definitions were complaining about my onError handler, reading the repo's code while using the v11.1.x version in my project)

* Update docs/basic-features/script.md

Co-authored-by: Steven <steven@ceriously.com>

* Update docs/basic-features/script.md

Co-authored-by: Steven <steven@ceriously.com>

* lint-fix

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-12-15 22:38:01 -06:00
Ismail Ghallou
797e260e1e
doc: update remark import (#32481)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2021-12-14 11:01:44 +00:00
Jiachi Liu
0ad4ad6dcd
Update react version to rc in react-18 doc (#32473)
* Update react version to rc in react-18 doc

* Apply suggestions from code review

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Lee Robinson <me@leerob.io>
2021-12-14 00:09:33 +01:00
xiaohai
d66579409e
docs: remove empty example link (#32439)
https://github.com/vercel/next.js/tree/canary/examples/custom-server 
This example has been moved to the documentation


## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2021-12-13 15:19:39 +00:00
Stephen Gheysens
adbe237d0c
Updated link to Local Images (#32427)
Local Images is on the Image Optimization page under the Basic Features docs



## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`


Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2021-12-12 20:12:26 +00:00
JJ Kasper
8d241ac4a7
Document staticPageGenerationTimeout config (#32306)
* Document staticPageGenerationTimeout config

* Apply suggestions from code review

Co-authored-by: Steven <steven@ceriously.com>

* Reword no activity

* Apply suggestions from code review

Co-authored-by: Steven <steven@ceriously.com>

* fix lint-language

Co-authored-by: Steven <steven@ceriously.com>
2021-12-08 17:05:05 -06:00
JJ Kasper
1a6a1e5fdf
Add docs for leveraging outputStandalone config (#32255)
This adds documentation to explain how the `outputStandalone` config can be leveraged to reduce production deployment size and leverage the output file traces.  This also adds a note for the `outputFileTracingRoot` config as it may be needed in some monorepo setups. 

A follow-up PR will update our Docker example to leverage this config as well. 

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`

x-ref: https://github.com/vercel/next.js/pull/31003
x-ref: https://github.com/vercel/next.js/issues/32252
Closes: https://github.com/vercel/next.js/issues/30822
2021-12-07 23:22:21 +00:00
Rasmus John Pedersen
ecf9f8775c
Add Umbraco Heartcore blog example (#21409)
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-12-07 16:38:55 +01:00
Maedah Batool
05bb5104d4
Details about starting dev server Next.js docs. (#32002)
The details about starting a development server and viewing your changes locally are wrongly placed in the Getting Started section in the Next.js Docs. Currently, it resides under the "Manual Setup" section. Ideally, it should be under the "Setup" section.

## Feature

- [x] Related issues linked using #31998
- [x] Documentation added

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2021-12-06 22:37:02 +00:00
Chimit
cffd209a67
Removed misleading id's from headings (#32163)
`id`'s are not generated automatically without plugins like `rehype-slug`.

https://github.com/vercel/next.js/issues/32158



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2021-12-06 17:04:26 +00:00
Arthur Fiorette
20814c34f5
Fixed Yarn and NPM dev swapped arguments (#32135)
## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2021-12-05 00:47:56 +00:00
Leonardo Ortiz
31d2184972
docs(Testing): Remove duplicate link (#32071)
There was two items `Use a development server`, both linking to the same URL. The last one was removed.
2021-12-03 01:07:31 +00:00
Leonard Martin
5747435d87
Add note to docs about sharp memory usage on default Linux setup (#31919)
It's fairly opaque to the user that there are problems with `sharp` in an out-of-the-box Linux environment, and so if `sharp` is going to be explicitly recommended for non-Vercel production environments then I think it's a good idea to make sure people are aware of the possible issues.

My vanilla Heroku deployment was using wild amounts of memory until I found the details in the sharp docs about how to configure the memory allocator, so signposting this a bit better should help prevent issues in future.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`


Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2021-12-01 20:53:04 +00:00
Vincent Voyer
2bd296d4ef
docs(NextRequest): req.cookie => req.cookies (#31975) 2021-11-30 15:34:17 -06:00
Delba de Oliveira
306c467c3b
Update Jest examples and docs (#31633)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: stefanprobst <stefan.probst@univie.ac.at>
Co-authored-by: Rich Haines <hello@richardhaines.dev>
2021-11-30 15:10:40 -06:00
Steven
b01a6ba665
Add TS types for NextMiddleware (#30578)
This allows TypeScript users to have type safety for middleware functions.

- Closes #30490 

Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2021-11-30 20:43:40 +00:00
Jiachi Liu
85e578a906
Enable default functional document when concurrentFeatures is enabled (#31954)
## Bug

Fixes: #31675 

Functional document without gIP should be enabled when streaming is enabled, even without rsc

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
2021-11-30 12:52:14 +00:00
Lee Robinson
6e6bd2158f
Update next export documentation. (#31465) 2021-11-29 20:50:41 -06:00
Maedah Batool
2781b8eb87
Improve Middleware Set Cookie API documentation (#31707) 2021-11-29 16:44:58 -06:00
Leonardo Ortiz
0202bb0a99
Docs(React 18): remove unnecessary React import (#31900)
In the `Server Components APIs (Alpha)` code sample, importing `React` is unnecessary. People may think that having `react`'s default export imported is needed to use `Suspense`
2021-11-29 01:21:06 +00:00
Leonardo Ortiz
efd5d03a8c
Docs(React 18): add missing Suspense import (#31897)
This PR adds a missing import in React 18 documentation's sample code, where `Suspense` is used without being imported.

_(edit: fix typo)_
2021-11-29 00:46:26 +00:00
Austin P
c10a841620
docs(middleware): file extension consistency (#31879)
Almost every one of the examples for middleware specific a `.ts` file extension, this PR just makes it consistent.
2021-11-28 15:56:31 +00:00
Samuli Asmala
ed1d0241db
Docs(router): Add type for url parameter (#31737)
Update documentation to have proper type for the url parameter of router.push method. Also add link to Node.JS documentation for full explanation of the UrlObject properties.
2021-11-26 13:37:46 +00:00
Abir
d72e429a73
[Docs][Fix] Broken Link to API Reference (#31820)
## Documentation / Examples
- [x] Make sure the linting passes by running `yarn lint`

## Steps to Reproduce

1. Go to https://nextjs.org/docs/advanced-features/debugging#debugging-with-vs-code

2. Click on the link as shown in red underlined in below image.
<img width="835" alt="image" src="https://user-images.githubusercontent.com/53480076/143548215-ee75deac-3e8b-42b3-ba72-fae0b76b30a3.png">

3. Ending up with the **404 Error** screen
<img width="835" alt="image" src="https://user-images.githubusercontent.com/53480076/143548364-7ddf45c9-4e69-44eb-9217-3547419e103a.png">

## Fixing Steps

Replace the broken link with correct one.
2021-11-26 09:13:01 +00:00
Gergely Gazda
b71f9d9475
docs(next-config): extend phase lines reference (#31711)
Next config `phase` attribute's default value list has been extended. This PR extends the number of referenced lines in the documentation.

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2021-11-25 10:37:18 +00:00
Rich Haines
a371447555
Added note on env vars (#31237)
This PR adds a note on how to access env vars in middleware

## Bug

- [x] Related issues linked using fixes: #30612
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`


Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2021-11-23 20:55:17 +00:00
Ben Schwarz
98227b273f
Fix typo in MDX guide (#31709)
In this PR:

- [x] Fixes a 1 character typo in the newly merged MDX guide
2021-11-22 23:35:25 +00:00
Rich Haines
91e8620376
Added guide for setting up Next.js with MDX (#30869)
This PR adds a new section on using MDX. It includes a guide for setting up Next.js with `@next/mdx`


## Bug

- [ ] Related issues linked using fixes: https://github.com/vercel/next.js/issues/29597
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [x] Related issues linked using Fixes: https://github.com/vercel/product/issues/35
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2021-11-22 17:27:43 +00:00
Tim Neutkens
b69f3b79c5 Fix prettier linting 2021-11-21 12:58:34 +01:00
Tim Neutkens
03ce622972
Add docs for the Next.js Compiler written in Rust (leveraging SWC) (#31485)
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Lee Robinson <lrobinson2011@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-11-21 12:42:52 +01:00
Mathieu Céraline
a48b8db94f
Fixing typo in Documentation about Testing (#31653)
Fixing a small typo in the sentence « It is recommend.. » about Playwright.

<!--
Thanks for opening a PR! Your contribution is much appreciated.
In order 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 that you're making:
-->

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2021-11-21 06:24:40 +00:00
Kevin Wolf
af6e9e2d87
Add middleware examples to custom page extensions (#31545)
## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2021-11-17 18:03:02 +00:00
xuchaobei
9739e6c100
Update environment-variables.md (#31525)
Remove `NEXT_PUBLIC_` prefix for server-only enviroment vars.


## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2021-11-17 17:01:42 +00:00
Nikola Knežević
af82de4274
Fix type declaration for API Routes response (#31486)
There is missing equals sign in the type declaration in the example for API Routes.

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2021-11-16 17:54:53 +00:00
Gonzalo Pozzo
d550b13b8d
Script examples (#31181)
* Add script component examples

* Update script examples

* Refactor code

* Remove unused files

* Fix linter

* Fix lint error

* Fix prettier
2021-11-16 11:47:12 -05:00
Tim Neutkens
d8028f553e
Revert "Add docs for the Rust Compiler (SWC)." (#31484) 2021-11-16 10:42:45 +01:00
Lee Robinson
47aad2fafd
Add docs for the Rust Compiler (SWC). (#31467)
This clearly lists what transforms are supported, which are currently experimental, and what is still unsupported with a place to leave feedback and your existing Babel setup.
2021-11-16 09:40:28 +00:00
Abdullah Mzaien
aedb86591f
Update react-18.md (#31476)
Changing the install tags to beta since react released the [beta](https://github.com/reactwg/react-18/discussions/112) today



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2021-11-16 04:09:42 +00:00
Vincent Voyer
7d82e07df8
docs(auth): fix iron-session example url + API (#31413)
This fixes the iron-session example url from an old url to the new,
always-up-to-date url.

I believe the Next.js team owns the previous url but it's not up-to-date.

This commit also changes req.session.get("user") => req.session.user to reflect
the new API.
2021-11-15 14:49:15 +00:00
Bradley Turek
a47955718e
Clarify with commas (#31224)
Adds a few commas where they could improve the clarity of the sentence.

- [X] Make sure the linting passes by running `yarn lint`


Co-authored-by: Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
2021-11-15 14:37:08 +00:00
Orri Arnarsson
06d4bbbb24
docs: next-iron-session renamed to iron-session (#31292)
## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2021-11-15 14:12:20 +00:00
Nikola Knežević
61ca7369c6
Fix function syntax for API Routes documentation (#31414)
There is a non-valid mix of classic and arrow function notation in the documentation. I've fixed it to be a classical function notation because all the other examples are like that.

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2021-11-15 10:50:13 +00:00
Onur Temiz
aaec9a9353
Update image-optimization.md (#31401)
"styled-jsx" link was broken. Added `/docs/` prefix and removed `.md` suffix to fix it.

Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2021-11-14 23:13:16 +00:00
Onur Temiz
10b4deaf90
Update data-fetching.md (#31394)
Added a link to third "Internationalized Routing"



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2021-11-14 19:46:30 +00:00
Emmanouil Zoumpoulakis
ce3112048f
Typo fixes on Markdown files (#31380)
Some simple typo fixes on Markdown files
2021-11-14 01:56:41 +00:00
Dyar Faradj
ae72632870
Changes in dev script (package.json) (#31245)
New Next.js projects now generates "dev": "next dev"



## Documentation / Examples

- [X] Make sure the linting passes by running `yarn lint`
2021-11-11 21:12:15 +00:00
Delba de Oliveira
5e179e32b6
Testing Docs: Add links to jump to sections (#31311)
Added Playwright to the top of the page and links to help readers jump to sections. 

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2021-11-11 15:18:23 +00:00
ThunderMiracle
4299cc169c
docs: fix typo in css-in-js page (#31244)
## Purpose

fix minor typo in [css-in-js page](https://nextjs.org/docs/basic-features/built-in-css-support#sass-variables) 

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2021-11-10 15:45:20 +00:00
Dusan Ralic
87c4d17726
Update upgrading.md (#31173)
Include required steps for the latest React and Next.js version upgrade via npm/yarn.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2021-11-08 20:53:25 +00:00
Lee Robinson
913adb8e43
Fix heading levels in URL imports docs. (#31163)
To ensure they are semantically accurate.
2021-11-08 17:51:05 +00:00
Brandon Romano
02872517b8
Include www subdomain example in Domain Routing (#30487)
* Include www subdomain example in Domain Routing

* Update comment

Co-authored-by: jj@jjsweb.site <jj@jjsweb.site>
2021-11-08 11:25:19 -06:00
Konstantin Popov
5f38b18b10
Fix minor typos (#31161)
Hello,
I've found some minor typos in the documentation, solved with this PR.
2021-11-08 11:24:53 -06:00
Houssein Djirdeh
ca41952d14
Expands next/script documentation (#31063)
This PR does the following to partially address #31062:

- Expands the [Script Component](https://nextjs.org/docs/basic-features/script) page in the core documentation
- Adds a `next/script` API reference page
2021-11-08 16:49:38 +00:00
Steven
83cd45215a
Add warning when image has unused sizes prop (#31064)
- Related to https://twitter.com/jaffathecake/status/1456579637987979265
- Closes #30640
2021-11-08 16:34:30 +00:00
Zeki
5db9d09edd
Added closing tag to <Suspense> (#30983)
There was no closing tag for the first `<Suspense>` tag.
2021-11-04 15:57:00 -05:00
Nicolas
19a6158631
Add config support for build activity indicator position (#30109)
When you edit your code, and Next.js is compiling the application, a compilation indicator appears in the bottom right corner of the page.

In some cases this indicator can be misplaced on the page, for example, when conflicting with a chat launcher. To change its position, open `next.config.js` and set the `buildActivityPosition` in the `devIndicators` object to `bottom-right` (default), `bottom-left`, `top-right` or `top-left`.

I also added the documentation for both `devIndicators.buildActivity` & the new `devIndicators.buildActivityPosition`.

## Feature

- [x] Implements a new feature
- [x] Documentation added
2021-11-03 21:17:36 +00:00
JJ Kasper
3c5d5b55c3
Add note about HMR WebSocket with express to upgrading (#30905)
x-ref: https://github.com/vercel/next.js/issues/30491#issuecomment-957865735

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2021-11-03 18:28:47 +00:00
Iris van Ollefen
d5d1bc0012
Update response-helpers.md (#30816)
In Setting the status code of a response, it says "returns a name property with the value of John Doe as a JSON response". But, the code example actually returns a message property with a different value.

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2021-11-02 13:08:36 +00:00
JJ Kasper
7cd9ffc519
Add note about rewrites query updating (#30747)
This adds a note for the query being updated for rewrites on static pages. 

Closes: https://github.com/vercel/next.js/issues/30720

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2021-11-02 10:17:09 +00:00
stef
5abfea3765
Recommend using next CLI for Docker entrypoint and not yarn (#29024)
Fixes #29023 

## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes
2021-11-01 20:26:14 +00:00
Jiachi Liu
4ac0227423
docs: update react 18 configuration (#30726)
* Add `next/head` as unsupported for rsc
* Change the description about `_document` page
2021-11-01 19:34:13 +00:00
Erik Hedberg
cd36e8c9d4
Fix spelling error (#30737) 2021-11-01 16:30:40 +01:00
Lee Robinson
a9ec61ea03
Add workaround for prefixing the default locale to the docs. (#30673) 2021-11-01 07:37:07 +01:00
Lee Robinson
175dd0f286
Add security notes to the URL imports documentation. (#30708) 2021-11-01 07:35:25 +01:00
JJ Kasper
900ec48c03
Add note about HMR WebSocket to upgrade guide (#30704)
Co-authored-by: Lee Robinson <me@leerob.io>
2021-11-01 07:27:04 +01:00
Julien Zapata Duque
c12ae5ea39
correct Next.js 11 upgrade instructions (#30665)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-10-30 21:20:17 +02:00
Kai Malcolm
39fcb8d338
Document Cross-Platform VS Code Debugging (#30052)
This PR adds documentation on how to debug through VS Code on Windows. Closes #30231

## Documentation / Examples

- [x] Make sure the linting passes
2021-10-28 10:59:31 +00:00
Lucas Vazquez
790261682b
Update examples at headers documentation (#30502)
Several examples at https://nextjs.org/docs/api-reference/next.config.js/headers have a comma at the end of the returns, which makes them invalid examples.
2021-10-28 03:20:05 +00:00
Balázs Orbán
574651adfd
docs: update Middleware API reference (#30485)
I changed the order of `NextRequest` and `NextFetchEvent` as they are presented in the function signature.

There also seemed to be some issues with the heading levels.

Also, `NextResponse` is a documented API, but the example code uses `Response`. I wasn't sure if this was a mistake in the docs or in the code.

I noticed that other similar docs pages have a collapsible `Examples` section at their top:

- https://nextjs.org/docs/api-reference/next/image
- https://nextjs.org/docs/api-reference/next/head
- https://nextjs.org/docs/api-reference/next/amp

Image below:
![image](https://user-images.githubusercontent.com/18369201/139145600-9f45d5be-b11c-4780-be95-c7f2ebeb49a9.png)

Should the Middleware docs have the same?
2021-10-27 21:08:54 +00:00
Luke Howsam
e82958ca78
fix(docs): Fix broken link in testing documentation (#30448)
This PR: 
Fixes a broken link in the testing documentation. It appears that the selector currently being used is `#test-environment-variable`. When clicked this results in the user being re-directed to the top of the environment variables page. The correct selector is: `#test-environment-variables`

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2021-10-27 15:53:57 +00:00
Bruce Rodrigues
8316b8df43
Removing duplicated instead word (#30442)
Just removing the duplicated use of `instead` on `next.config.js/rewrites`  doc
2021-10-27 15:29:54 +00:00
Steven
3bdf80dde5
Fix PerformanceObserver usage for older browsers and CI (#30387)
Browsers older than 2017 don't have PerformanceObserver https://caniuse.com/mdn-api_performanceobserver


- Fixes https://github.com/vercel/next.js/issues/30322
- Fixes https://twitter.com/fmgordillo/status/1453037730141716492
2021-10-27 00:37:19 +00:00
Matt Wood
7e9f801b47
Fix typo currentFeatures to concurrentFeatures (#30356)
* Fix `currentFeatures` to `concurrentFeatures`

Small typo fix in docs

* Apply suggestions from code review

Co-authored-by: Shu Ding <g@shud.in>

Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Shu Ding <g@shud.in>
2021-10-26 14:16:29 -05:00
Rich Haines
a4a77595de
Added warning about trusted domains (#30348) 2021-10-26 20:55:21 +02:00
JJ Kasper
c7e4c85436
Fix lint on react-18 docs (#30354) 2021-10-26 20:54:38 +02:00
Leo Gaskin
d92e75cb30
Add missing closing quote (#30336) 2021-10-26 13:54:56 -04:00
JJ Kasper
4edc874ee5
Add React 18 docs (#30325)
This re-adds https://github.com/vercel/next.js/pull/30324 

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2021-10-26 16:30:45 +00:00
Tim Neutkens
c217900fa0
Update manifest.json 2021-10-26 18:03:53 +02:00
Lee Robinson
3466b740ae
Add more docs (#30320)
Co-authored-by: Steven <steven@ceriously.com>
2021-10-26 11:07:32 -04:00
Steven
4782cacecf
Add warning when LCP image is missing priority prop (#30221) 2021-10-25 17:59:00 -04:00
Kara
2fe5d011e6
Add "priority" section to Image Optimization doc (#30218)
This change addresses some feedback that some users don't realize
that the `priority` attribute exists and is critical for managing
LCP when using the next/image component. It adds a dedicated
section to the Image Optimization doc that explains how and when
to use the attribute.

Fixes #29624

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2021-10-25 21:04:00 +00:00
Tim Neutkens
f5b7baca53
Add note about improved CSS parser for styled-jsx to upgrading guide (#30280)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2021-10-25 20:29:08 +00:00
matamatanot
25716a249d
Fix typo of upgrading (#30276)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2021-10-25 19:18:45 +00:00
Tim Neutkens
dfb280b4a9
Add minimum Node.js version to upgrading guide (#30274)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2021-10-25 18:38:48 +00:00
Tim Neutkens
3f22451545
Update upgrade docs (#30265)
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Steven <steven@ceriously.com>
2021-10-25 20:20:11 +02:00
Tobias Koppers
04e1e01f18
test, fix and document all possible import types for URL imports (#30165)
resolve absolute URLs in CSS when using urlImports
remove `[path]` from static static image output path
replace file-loader with asset module, remove file-loader
2021-10-25 01:54:16 +02:00
JJ Kasper
9d4e7b45dc
Add initial documentation for output file tracing (#30199)
* Add initial documentation for output file tracing

* Apply suggestions from code review

Co-authored-by: Steven <steven@ceriously.com>

Co-authored-by: Steven <steven@ceriously.com>
2021-10-24 10:39:22 -05:00
Steven
ca65fd8f87
Change AVIF to opt-in via configuration (#30180)
AVIF (shown in purple) is generally slower to encode than WebP (shown in yellow) so it is probably not a good default for on-demand Image Optimization.

Instead, we'll let users opt-in via `formats` configuration.

![performance](https://user-images.githubusercontent.com/229881/138511198-b987d307-17c2-47c2-816f-766a43d77efd.png)
2021-10-22 21:08:03 +00:00
Steven
6f3e9470a6
Ensure error message prints next.config.mjs (#30152)
This PR ensures we print the correct error message for either `next.config.js` or `next.config.mjs`, whichever was detected.
2021-10-21 23:04:40 +00:00
Tobias Koppers
d07107f2c6
add experimental.urlImports option (#30079)
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Rich Haines <hello@richardhaines.dev>
2021-10-21 13:14:57 +02:00
Steven
dda14e7f4b
Add image example with background color using blurDataURL (#30111)
Demo: https://nextjs-examples-image-component-igy6n5cs1.vercel.sh/
2021-10-20 19:05:54 +00:00
Steven
f2cf092ee6
Print error when images.loader is assigned but images.path is not (#30080)
Fixes #29744
2021-10-20 00:17:24 +00:00
Tim Barley
b794c171f2
Update eslint.md with instructions for installing Prettier plugin dependency (#29764)
Added install instructions for eslint-config-prettier before adding Prettier to the ESLint config.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [X] Make sure the linting passes
2021-10-18 22:35:46 +00:00
Steven
1a0c1e8a5b
Fix next/image when parent is <p> (#30041)
- Fixes #29717 
- Fixes #21433 
- Closes #21475
2021-10-18 21:29:19 +00:00
kimizuy
cf5eededc9
docs: Remove invalid link "Glamor" (#29982)
Remove an invalid link.
`with-glamor` example does not exist.

## Documentation / Examples

- [x] Make sure the linting passes
2021-10-17 15:15:05 +00:00
matamatanot
067075ca07
Update minimum Node version in Getting Started (#29952)
Follow up to #29949 

## Documentation / Examples

- [x] Make sure the linting passes
2021-10-15 21:48:13 +00:00
JJ Kasper
c2b5f15c93
Update typo in response helpers doc (#29899)
Fixes typo per https://github.com/vercel/next.js/pull/29462#discussion_r728604242

## Documentation / Examples

- [x] Make sure the linting passes
2021-10-14 04:23:47 +00:00
Steven
fcc8380642
Update docs for image caching behavior (#29895)
Revises docs to explain that the maximum of the header and config is used.
2021-10-14 00:01:17 +00:00
Angelo P
541259d992
Update testing based on Failed to parse src "test-file-stub" on `next… (#29039)
…/image` Error

While learning how to test next.js applications I came across this error when testing components using next/image with an image import

eg: 
```
// /quiz-hero
import Image from 'next/image';
import quizImage from '../../public/undraw-quiz.svg';

// In render 
<Image
              height='91'
              width='198'
              layout='fixed'
              src={quizImage}
              alt='QuizImage'
            />
```

### Error -> 
Failed to parse src "test-file-stub" on `next/image`, if using relative image it must start with a leading slash "/" or be an absolute URL (http:// or https://)

This is fixed by adding a "/" to the beginning of your file-stub module export string. 

This is not an error when you're awaiting an image using async waitFor, But comes up as an error when you're testing a component that holds another component with a "next/image" import.
eg: 
```
// quizHero.test.tsx works like this without change.
const image = await waitFor(() => screen.findByAltText('QuizImage')); 

// but index.test.tsx fails rendering the homepage without the change.
render(<Home />); // Error: Failed to parse src "test-file-stub" on `next/image`...

// with change to __mocks__/fileMock
quizHero.test.tsx //test pass
index.test.tsx //test pass
```
<!--
Thanks for opening a PR! Your contribution is much appreciated.
In order 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 that you're making:
-->

## Bug

possibly related to -> #26749

## Feature

- [X] Documentation added

## Documentation / Examples

- [X] Make sure the linting passes
2021-10-13 15:13:24 +00:00
Rich Haines
eed43115ec
Added more examples to Response Helpers page (#29462)
## Bug

- [x] Related issues linked using Fixes: https://github.com/vercel/front/issues/11154
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes
2021-10-13 14:58:18 +00:00
Phattarapol L
5d992a6a28
Add Scss variables section to Built-in CSS Support document (#29822)
## Feature

- [x] Documentation added

## Documentation / Examples

- [x] Make sure the linting passes
2021-10-12 14:33:12 +00:00
Max Schmitt
ca062db2a4
docs(testing): added Playwright guide (#29832)
Blocked by https://github.com/vercel/next.js/pull/29426
2021-10-12 14:21:54 +00:00
Steven
cc1f3b8a38
Add support for AVIF to next/image (#29683)
Add support for AVIF to `next/image`

- Fixes #27882 
- Closes #27432 

## Feature

- [x] Implements an existing feature request
- [x] Related issues linked
- [x] Integration tests added
- [x] Documentation added
- [x] Update manifest output
- [x] Warn when `sharp` is outdated
- [x] Errors & Warnings have helpful link attached
- [ ] Remove `image-size` in favor of `squoosh`/`sharp` (optional, need to benchmark)
2021-10-11 23:17:47 +00:00
Kristopher Wuollett
049e17566b
Fix test running command in testing.md (#29778)
* The previous `npm run jest` command did not match up with the testing script added to the example `package.json`
* Fixes #29777



## Bug

- [x] Related issues linked using `fixes #number`
- [N/A] Integration tests added
- [N/A] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes
2021-10-10 14:09:35 +00:00
Igor Agapov
bdfc4c2e9c
Fixed method for removing class (#29735)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes
2021-10-08 15:17:41 +00:00
Henry Blevins
8b485e161d
Fix typo in image optimization documentation (#29685)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-10-06 18:57:33 -05:00
Aryan Beezadhur
c70931bc19
Grammatical fixes (#29676) 2021-10-06 18:59:47 +00:00
Steven
e29b44b368
Fix debugging docs markdown lang (#29674)
Fixes an error rendering docs:

```
Markdown to HTML error: Error: Unknown language: `shellsession` is not registered
```
2021-10-06 17:41:56 +00:00
Kai Malcolm
9c0578519d
Document i18n routing with dynamic routes (#29632)
* Document i18n routing with dynamic routes

* Update i18n-routing.md

* lint-fix

* Fix i18n Routing Typo

* Update i18n-routing.md

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-10-05 18:36:16 -05:00
Alex Castle
5d7b68f15e
Overhaul image component documentation (#29186)
This PR contains an overhaul of the image component documentation for next (both the [primary usage doc](https://nextjs.org/docs/basic-features/image-optimization) and the [API reference](https://nextjs.org/docs/api-reference/next/image)). This PR does not change the filepath/URL for either of those documents, but that may still be warranted as right now Google searches for "next.js image component" and the like return the API document as the first result, which is not optimal.

The changes to the docs are based on feedback from the community and with input from @leerob. I'm marking this PR a draft because we will likely want to have a round of revisions before merging, but in general I consider this PR "read to go," contingent on buy-in from other stakeholders.

The basic goal of the changes are as follows:
1. Simplify the getting started page by moving extraneous detail to the API documentation.
2. Refocus the getting started page on practical usage information
3. Add additional content to address issues that have come up as common pain-points around the image component, such as image sizing and styling.

Fixes #21786 

CC: @styfle @timneutkens @kara @spanicker
2021-10-05 21:38:48 +00:00
Arthur Denner
1c1929b3a5
docs: remove this usage from function component (#29596)
Fix a small error in the `next/script` docs.

Let me know if you'd like a `useState` for the sake of a complete example.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes
2021-10-04 12:02:57 +00:00
Ty Mick
c06a3c1731
docs: Clarify locale properties on context object in data-fetching (#29566)
Until I started looking into the source code to verify, I thought that `locale`, `locales`, and `defaultLocale` were being parsed from the [`Accept-Language`][1] header somehow. This'll help other people like me who are reading the [Data Fetching](https://nextjs.org/docs/basic-features/data-fetching) page but weren't already aware of Next.js's [Internationalized Routing](https://nextjs.org/docs/advanced-features/i18n-routing) features.

[1]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language



## Documentation / Examples

- [x] Make sure the linting passes
2021-10-04 09:25:38 +00:00
Tim Neutkens
9581658b8a
Use npx create-next-app@latest instead of the version that is installed (#29595) 2021-10-04 11:13:45 +02:00
JJ Kasper
a9ad8cbbd9
Update permanent redirect field documentation (#29557)
This explains what the permanent field does a bit more for redirects. 

## Documentation / Examples

- [x] Make sure the linting passes

x-ref: https://github.com/vercel/next.js/discussions/29556
2021-10-04 08:28:35 +00:00
Ty Mick
667ddad6aa
docs: Link to getInitialProps on Custom App page (#29567)
`getInitialProps` is already being referenced on the [Custom `App`][1] page, since it's the only supported data-fetching method for custom `App` components, but folks who started using Next.js after the advent of `getStaticProps` and `getServerSideProps` may not be familiar with the `getInitialProps` API.

[1]: https://nextjs.org/docs/advanced-features/custom-app



## Documentation / Examples

- [x] Make sure the linting passes
2021-10-02 21:39:08 +00:00
Vitor Balocco
2f26fb440f
Update getServerSideProps docs with req.cookie note (#29457)
## Documentation / Examples

Add a note to the `getServerSideProps` docs that `context.req` [contains](c27e3a41dc/packages/next/types/index.d.ts (L148-L150)) a `context.req.cookies` attribute.

I based the copy off of the one from https://nextjs.org/docs/api-routes/api-middlewares.

Checklist:
- [x] Make sure the linting passes
2021-09-30 15:34:03 +00:00
Kyle Holmberg
e5960dc6d6
Add Stitches example to CSS-in-JS docs (#29498)
CC @peduarte
2021-09-29 16:50:41 +00:00
Lee Robinson
7f99895076
Update imperative routing docs to have better a11y (#29382)
We should recommend using a `button` instead of a `span` 👍
2021-09-27 02:04:58 +00:00
Casper
9343b67c11
feat: allow setting custom tsconfig file (#28104)
Ability to provide a custom tsconfig file. 

**Example Usage:**

```js
// next.config.js
module.exports = {
	typescript: {
		tsconfigPath: "myconfig.json"
	}
}
```


## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [x] Related issues linked using [`fixes #23972 (discussion)`](https://github.com/vercel/next.js/discussions/23972)
- [x] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes
2021-09-23 22:52:05 +00:00
JJ Kasper
f8e283c7ba
Ensure href/as behavior points to correct docs (#29270)
Adds an additional note about `href`/`as` behavior so that users understand which docs should be looked at for how they are using it. 


## Documentation / Examples

- [x] Make sure the linting passes


x-ref: https://github.com/vercel/next.js/issues/26169#issuecomment-924206396
2021-09-22 19:07:07 +00:00
Lee Robinson
638e6ccfde
Update Gatsby migration guide to use image imports. (#29178)
* Update Gatsby migration guide to use image imports.

* Update docs/migrating/from-gatsby.md

* Update docs/migrating/from-gatsby.md

Co-authored-by: Steven <steven@ceriously.com>

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-09-19 00:12:31 -05:00
Konstantin Popov
2333f7c1b8
Fix minor typos (#29188)
Fix minor typos:

typescript -> TypeScript
2021-09-17 23:00:20 +00:00
x4th
37c66dcd84
Update router.prefetch section to clarify it supports dynamic routes (#29070)
* Update router.prefetch section to clarify it supports dynamic routes

* Apply suggestions from code review

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-09-17 11:18:02 -05:00
Colin Sidoti
713a5aa701
Use new @clerk/nextjs package in with-clerk example, update Next.js authentication docs (#28906)
* Update headings to clarify that we're describing. Add heading for Authentication API Routes

* Start adding API route examples

* Start adding API route examples

* Start adding API route examples

* Start adding API route examples

* auth: Replace clerk packages with @clerk/nextjs

* Add API authentication example to with-clerk

* Fix footer links

* Proofread, ensure consistency

* Update example's props to use new version

* Update example links

* Add rel tag to _blank link

* Obscure the authentication provider in the example

* Replace example

* Reset authentication docs, list Clerk as vendor

* Re-fix typo

* Change sample to example

* Add the example

* Update examples/with-clerk/package.json

Co-authored-by: Lee Robinson <me@leerob.io>

Co-authored-by: Peter Perlepes <p.perlepes@gmail.com>
Co-authored-by: Lee Robinson <me@leerob.io>
2021-09-17 10:54:34 -05:00
JJ Kasper
cefd9cf283
Add crawler blocking for fallback: true (#29121)
* Add crawler blocking for fallback: true

* update test

* Update check

* Add note to docs

* use browser agent for non-crawler test
2021-09-16 11:01:28 -05:00
Ty Mick
c7e187f893
Add client-side debugging instructions (#28815)
Fixes #16442

The current instructions on the Debugging page currently only work for server-side code, and furthermore, the page doesn't actually _say_ that they only work for server-side code.

This update adds instructions for debugging client-side code in both VS Code and Chrome DevTools. It also improves the suggested VS Code launch configurations to take advantages of some relatively recent features in VS Code's [built-in JavaScript debugger][1]. Using the `node-terminal` and `pwa-chrome` launch types removes the need to manually pass an `--inspect` flag to the underlying Node.js process.

[1]: https://github.com/microsoft/vscode-js-debug

Let me know if there are any edge cases I didn't consider with these VS Code launch configs!



## Documentation / Examples

- [x] Make sure the linting passes
2021-09-16 07:07:56 +00:00
Lee Robinson
a5bc3f2f8c
Add note about using Sharp for next/image to deployment docs. (#29067)
I also removed the custom server link here, because I think it's making too strong of a correlation between custom server and Node.js server using `next start`, which aren't the same.
2021-09-13 20:31:04 +00:00
volcareso
48b37ede23
Add more examples of static generation to docs page. (#29052)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes
2021-09-13 13:18:31 +00:00
volcareso
e09b7a5827
Fixed typo (#28989)
Added () outside *demo"



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes
2021-09-10 12:18:43 +00:00
Nwachukwu Daniel (DONSN)
248c6fc88d
Fixed issue with grammar (#28964)
Changed - function component to - functional component in the heading and sentence below:

If the child of `Link` is a functional component, in addition to using `passHref`, you must wrap the component



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes
2021-09-09 14:24:01 +00:00
scottrepreneur
ee71f9d863
name should be key (#28917)
Small fix on parameter expecting to be de-duped
2021-09-08 14:00:34 +00:00
Lee Robinson
1fcd8c2e4d
Update next/link API docs to mention a11y and ESLint rule. (#28841)
Based on feedback from Twitter. 

https://twitter.com/marcysutton/status/1431432062506917890
2021-09-07 15:10:27 +00:00
Alex Vilchis
2425f4703c
(docs) Add permanent property in redirect object (#28852)
I found that an example for a redirect rule in the documentation doesn't have the required property `permanent`. I noticed this because I tried to use that same rule but building fails with the following message:

```
`permanent` is not set to `true` or `false` for route {"source":"/:path((?!another-page$).*)","has":[{"type":"host","value":"example.com"}],"destination":"/another-page"}


Error: Invalid redirect found
```

My PR simply adds the missing `permanent` property as false to be consistent with the rest.

## Documentation / Examples

- [x] Make sure the linting passes
2021-09-06 23:20:15 +00:00
Alex Vilchis
947db315cf
(docs) Remove duplicate comma (#28850)
- [X] Make sure the linting passes
2021-09-06 18:31:31 +00:00
Woosik Kim
970f85e40c
doc: fix typo (#28817)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-09-06 13:42:18 +02:00
Lee Robinson
602b26b4b9
Add note to Gatsby migration guide about using next/image with custom loaders. (#28805)
Feedback from this article: https://blog.whereisthemouse.com/image-optimization-for-static-nextjs-sites
2021-09-06 11:34:22 +00:00
Houssein Djirdeh
4141aaefa5
[ESLint] Support single-file linting in next lint (necessary for lint-staged) (#28042)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-09-06 13:05:40 +02:00
Steven
801e48eae9
Update docs to clarify that image imports are static (#28744)
This PR clarifies the usage for static image imports.
2021-09-02 18:51:30 +00:00
Alex Castle
c9efbe1818
Update image styling doc (#28724)
In talking to partners, I've seen a lot of confusion about the number of wrapping `<div>`s around the image element rendered by `next/image`. There's always just one single wrapper--this PR updates the docs to make that a little more explicit.
2021-09-02 05:48:55 +00:00
Aleksa Cukovic
501bfe6969
Update docs about exposing env vars to the browser (#28673)
Current docs on exposing environment variables to the browser are slightly misleading as they say that variables loaded from `.env.local` are only available in node by default, but this is the case for all environment variables not just those loaded from `.env.local`.

## Documentation

- [x] Make sure the linting passes
2021-08-31 21:18:22 +00:00
Kara
9be387c7f4
getServerSideProps should support props value as Promise (#28607)
Previous to this change, getServerSideProps could only return plain objects
for props, e.g.:

```javascript
export async function getServerSideProps() {
  return {
    props: {
      text: 'some value',
    }
  }
}
```

With this commit, the props object can also be a Promise, e.g.

```javascript
export async function getServerSideProps() {
  return {
    props: (async function () {
      return {
        text: 'promise value',
      }
    })(),
  }
}
```

For now, the framework simply waits for the results of the props Promise to resolve,
but this small change sets the groundwork for later allowing props to be streamed (cc @devknoll).

## Feature

- [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. -- *This is part of @devknoll's ongoing work to support streaming.*
- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not. *not sure if this applies here*
- [ ] Errors have helpful link attached, see `contributing.md`
2021-08-30 19:52:15 +00:00
Mike Hedman
d209435724
Small grammar fixes (#28590)
"exclusive of" implies that it doesn't pertain to `export` https://www.merriam-webster.com/dictionary/exclusive%20of  "Exclusive to" implies that it's only relevant to `export`.  
Also changed "can not" to "cannot".



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes
2021-08-28 21:56:32 +00:00
Scotty Waggoner
04cc37f763
Add docs for using pageExtensions to colocate other files with page components (#22740)
Feel free to edit this/suggest changes as you see fit to match the style of your docs or how you want this feature represented.

There seemed to be many issues regarding colocating non-page files with page components in  the `pages` directory where `pageExtensions` was finally suggested as a solution. I think it would be great to document it better since it seems to be a often requested workflow to colocate test, generated files, styles, and other files needed by page components in the `pages` directory. The note that exists in the docs currently alludes to the ability to do this but it doesn't contain much context that would help make it more discoverable.

Relevant issues:
https://github.com/vercel/next.js/discussions/11113#discussioncomment-427139
https://github.com/vercel/next.js/issues/8454#issuecomment-560432659
https://github.com/vercel/next.js/issues/8617#issuecomment-790030032
https://github.com/vercel/next.js/issues/3728#issuecomment-523789071
2021-08-27 22:58:56 +00:00
Delba de Oliveira
27c2937cc7
Update with-jest packages and docs (#28209)
This PR updates the with-jest example to the latest version of Jest and adds a note about the Jest and RTL testing environments (related to this [discussion](https://github.com/vercel/next.js/discussions/28337)). Also adds minor tweaks to the testing docs. 


## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes
2021-08-26 16:18:22 +00:00
Hunter Tunnicliff
877f982924
Use recommended pattern in testing example (#28404)
* Use recommended pattern in testing example

Since the official linter for testing library, `eslint-plugin-testing-library` recommends using `screen` to write queries, this MR updates the testing library example to follow the pattern recommended by the linter.

> DOM Testing Library (and other Testing Library frameworks built on top of it) exports a screen object which has every query (and a debug method). This works better with autocomplete and makes each test a little simpler to write and maintain.

> This rule aims to force writing tests using built-in queries directly from screen object rather than destructuring them from render result. Given the screen component does not expose utility methods such as rerender() or the container property, it is correct to use the render returned value in those scenarios.

See the `prefer-screen-queries` rules docs for more info: https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/prefer-screen-queries.md

* Update devDependencies

* Install and configure test linting

* Use recommended pattern in test

* Update test names for consistency

* Update docs

* Set jest environment in each file

* Use root true in `with-jest` eslint config

* Ensure nested .eslintrcs are not loaded for repo lint

Co-authored-by: jj@jjsweb.site <jj@jjsweb.site>
2021-08-25 12:33:57 -05:00
JJ Kasper
f21685549a
Update i18n locales limit to warning (#28429)
* Update i18n locales limit to warning

* update version -> versions

* bump

* Use Log.warn instead

* Apply suggestions from code review

Co-authored-by: Lee Robinson <me@leerob.io>


Co-authored-by: Lee Robinson <me@leerob.io>
2021-08-25 08:54:38 -05:00
Steven
cb6290adf3
Update docs for sharp usage to mention Vercel (#28476)
There was some confusion in [this tweet](https://twitter.com/mtliendo/status/1430269174459338759) so I revised the docs around `sharp` usage.
2021-08-24 22:51:28 +00:00
Robbie Averill
57965770b9
Minor docs edit: cors -> CORS (#28472)
## Documentation / Examples

- [x] Make sure the linting passes
2021-08-24 17:23:40 +00:00
Houssein Djirdeh
80921b6a54
enables eslint caching by default (#28349)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-08-23 12:56:21 -05:00
Lee Robinson
8afa24fca5
Improved next/image docs around layouts. (#28345)
There's been community feedback the `layouts` section of `next/image` docs could be improved. Thanks to this great article (https://blog.eyas.sh/2021/08/gatsby-to-next-js/), I've added a helpful table here giving a high-level overview, as well as re-organized the `layout` section to be more helpful.
2021-08-23 17:39:19 +00:00
Kornel Dubieniecki
d143d9879f
docs: update font-optimization.md (#28397)
Adding display property to the examples as just copying them shows a 'Display parameter is missing.' warning.
Also added a link to the docs.

## Documentation / Examples

- [ ] Make sure the linting passes
2021-08-23 16:07:54 +00:00
Behzad Mehrabi
d6e82484f4
fix link to global stylesheet in from-create-react-app.md (#28327) 2021-08-20 12:18:27 +00:00
Aryan Beezadhur
864a1893c3
Update supported-browsers-features.md (#28326) 2021-08-20 11:52:20 +00:00
stefanprobst
da4203d032
Add eslint rule for id attribute on inline next/script (#27853)
This adds a new ESLint rule to `eslint-plugin-next` to check that `next/script` components with inline content have the required `id` attribute.

Also adjusted the code example for inline scripts in the `next/script` docs, which were actually missing an `id` attribute.
And also updated the `next/scripts` integration test to also have the required `id` attribute.

Unsure about the required heading levels in the errors .md document (other examples have h1 and h4??)

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [x] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes
2021-08-19 20:08:04 +00:00
Brody McKee
0d3fb75cb6
Add docs for ESLint plugin settings and rule options (#28059)
This PR adds documentation for the new `rootDir` setting (#27918), and for `next/no-html-link-for-pages`.

## Documentation / Examples

- [x] Make sure the linting passes
2021-08-19 09:07:30 +00:00
Jiachi Liu
7ea7c23866
Document usage of suspense option of next/dynamic (#28210)
## Documentation / Examples

- [x] Make sure the linting passes
- [x] Errors have helpful link attached, see `contributing.md` (for #28165, #27611)
- [x] Update test case
2021-08-18 01:21:22 +00:00
Kevin Old
fe246bae36
docs: Add link to Cypress GitHub Actions Guide to Testing docs (#28207)
@leerob 

This pull request points to our [Cypress GitHub Actions Guide](https://on.cypress.io/github-actions) in the Cypress Documentation site.  It contains a guided walkthrough of using GitHub Actions with Cypress in text and our [recently released videos](https://on.cypress.io/ci-gha-playlist) in context. 

## Documentation / Examples

- [x] Make sure the linting passes
2021-08-17 17:55:24 +00:00
Urko Pineda
5d4d8802b8
Update testing.md (#28190)
Removed "`" with "'".



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes
2021-08-17 14:06:21 +00:00
Rahul Gaba
da4d65252f
ESLint Plugin: Prefer next script component when using the inline script for Google Analytics. (#25147)
* Add a lint rule for using next script component when using inline script for Google Analytics.

* Apply suggestions from code review

Co-authored-by: JJ Kasper <jj@jjsweb.site>

* Update errors/next-script-for-ga.md

Co-authored-by: JJ Kasper <jj@jjsweb.site>

* Apply suggestions from code review

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-08-16 13:55:07 -05:00
Shun Tedokon
385ac94afd
docs: corrected the link to the example (#28175)
## Documentation

- Corrected the link in the **Next.js Testing Docs** to the correct one.
2021-08-16 17:15:21 +00:00
Oscar Fuentes
639b4d7d1f
doc: fix typo (#28146)
Given the context of the surrounding sentence, I believe the intention here was to use the word `increasing`. 



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes
2021-08-16 02:51:06 +00:00
Lee Robinson
d5dc968134
Improve React Strict Mode documentation. (#28139)
The current text linked wasn't obvious. Plus, the best description of what Strict Mode is was at the bottom of the document.
2021-08-15 17:44:00 +00:00
Sam Poder
d57d9a5173
Add a Styling Section to next/image component docs (#28055)
## Feature

- [x] Documentation added

## Documentation / Examples

- [x] Make sure the linting passes

It seems that people currently struggle to style their image: https://twitter.com/achrlswrth/status/1425695122029744128, this clarifies that you can use className to do this (something I just learnt!). At the moment, this is kind of hidden in "other props" I think this makes it more clear for people

Thanks,

Sam
2021-08-14 03:56:33 +00:00
Gustav Pursche
22dbf275fe
Docs: Mention 3rd option 'blocking' for fallback (#28077)
* Docs: Mention 3rd option 'blocking' for fallback

* Update docs/basic-features/data-fetching.md

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-08-13 22:48:41 -05:00
Delba de Oliveira
04794776d8
[DOCS] Update testing docs (#28064)
This PR adds a recommendation to test production code with Cypress and re-orders the page information. 

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes
2021-08-13 12:01:12 +00:00
Delba de Oliveira
40f85f6d95
[Docs] Add testing docs (#27965)
Add a new doc showing how to configure Jest and Cypress with Next.js

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples
- [x] Make sure the linting passes
2021-08-11 20:47:12 +00:00
Sam Ko
b881d65c12
Adding a missing a period (#27928)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [X] Documentation updated
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes
2021-08-10 18:37:34 +00:00
ahmed osama
0cc4a98041
Little typo (#27911)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes
2021-08-10 12:01:14 +00:00