Commit graph

960 commits

Author SHA1 Message Date
Luis Alvarez D
5235b0fe92
Add note about crawlers and fallback: true (#34114)
Added a mention that `fallback: true` behaves like `fallback: 'blocking'` back into docs. It was originally added in https://github.com/vercel/next.js/pull/29121.

## Feature

- [x] Documentation added

## Documentation / Examples

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


Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2022-02-09 00:44:47 +00:00
hackerman
1efa892e97
docs: add Ory vercel example to auth page (#33029)
See also the merged https://github.com/vercel/examples/pull/40

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-02-08 21:59:13 +00:00
Tim Neutkens
c74e4f21ff
Add support for async fn / promise in next.config.js/.mjs (#33662)
- Add support for async function / promise export in next.config.js/.mjs
- Update docs

Adds support for https://twitter.com/timneutkens/status/1486075973204422665

But also the simpler version:

```js
module.exports = async () => {
  return {
    basePath: '/docs'
  }
}
```



## 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.
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Documentation added

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-02-07 08:48:35 +00:00
Jess Telford
8eb6ddc343
[docs] Add env var load order (#32350)
My team & I keep asking the question "What order are env vars _actually_ loaded in?".

This addition surfaces the order in a clear and readable way without having to read and understand the entire "Environment Variables" documentation first.

## Documentation / Examples

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


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-02-06 21:44:19 +00:00
Aman Mittal
80a153cd41
Update multiple docs pages to follow Docs Content style guide (#33855)
This PR addresses minor docs-related styling issues on the Getting Started, Data Fetching (Get Server Side Props), etc pages. It follows the mechanics of the Docs Content Style guide to maintain consistency across all documentation. 

Also fixes some minor issues such as missing period at the end of a sentence on docs pages like as Data Fetching (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

- [x] Make sure the linting passes by running `yarn lint`
2022-02-06 04:21:35 +00:00
fmacherey
560191ab72
Update custom server docs for async methods (#30521)
as handle() returned from app.getRequestHandler() is a Promise, it has to be handled correctly. Simply returning it, works fine.


## Bug
- [x] Related issues linked using fixes #number
- [x] Integration tests added
- [x] 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.
- [x] Related issues linked using fixes #number
- [x] Integration tests added
- [x] Documentation added
- [x] Telemetry added. In case of a feature if it's used or not.
- [x] Errors have helpful link attached, see contributing.md

## Documentation / Examples

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


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-02-06 03:22:02 +00:00
Lance Chen
93fa12921b
Fix redirect url for prefixing the default locale (#33762)
We want to prefix the default locale to the current path (`/path`), not the current href (`http://domain.tld/path`).


## Documentation / Examples

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


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-02-06 02:36:50 +00:00
Eric Howey
6890e3fcf2
(docs): update i18n-routing.md (#33123)
The recommended code for `_middleware.ts` does not work in prod, but does work locally.  You need to use `request.nextUrl.pathname` to properly redirect from what I can tell.  You also need to have a quick helper function to strip off the `/default` locale at the start of the pathname as we are providing `/en` as a fallback locale.

FWIW - I am pretty new to NextJS.  Someone with more experience should probably review this suggestion before merging it.  What I can tell you however is that the code as it is in `_middleware.ts` works locally but breaks in prod.  To test this out use the code and navigate to `https//www.mysite.com` - it will work as expected on the root url, as this matches `nextUrl.href`.  Now try navigating to `https//www.mysite.com/about` and you will be redirected to `https://www.mysite.com/en/https://www.mysite.com/about`.



## Documentation / Examples

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

Closes: https://github.com/vercel/next.js/pull/33762

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-02-06 02:17:36 +00:00
ncphi
7309098283
Add async to middleware docs. (#31356)
* Add `async` to middleware docs. 

I was reading the docs and got nervous. It looked like middleware didn't support async/await. After digging into the examples I found out it is possible. 

Not 100% sure if this is the docs change yahs want, but I thought I'd open a PR just incase.

* Add middleware API note

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-02-05 20:01:18 -06:00
Maedah Batool
6814ca7f23
Improve Form Guide Contents (#33913)
We need to make some quick fixes to the Form guide. The PR changes title and meta description.

## 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`


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-02-05 19:08:18 +00:00
MxA
ca8dc8d011
docs: fix variable name from profileData to data in CSR page (#34018)
Since the variable name is called `data`, I believe checking `profileData` will always be `undefined`.

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-02-05 14:57:02 +00:00
Ismael Rumzan
25d93de9fe
Updated going-to-production with loading performance (#33179)
## Documentation Update
Based on this issue: https://github.com/vercel/next.js/issues/29319

## Documentation / Examples

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


Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-02-04 16:30:55 +00:00
Vincent Voyer
632c9860e0
docs(isr): add missing key prop in jsx loop (#33984)
Copy pasting this example with a default create-next-app leads to an eslint warning. So I thought let's fix this.

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-02-04 14:15:56 +00:00
Jordie
834546a74f
Fix typo in new experimental Relay support docs (#33963)
## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-02-03 23:46:07 +00:00
Lee Robinson
5abd92fb56
Update custom document docs to prepare for React 18. (#33814)
To help prepare for React 18, I've found myself sharing the updated code snippet of `_document` linked in the [React 18 docs](https://nextjs.org/docs/advanced-features/react-18#react-server-components), which uses a function instead of a class.

This PR updates the Custom Document docs to help prepare for this change, by encourage readers to use the new version, and listing more tangible examples of why you would override `_document` (`lang` on `html`, className on `body`). It also reorganizes some of the caveats and warnings related to `getInitialProps` usage to only be in the single section that applies to it.

These overrides and ejections (`getInitialProps` and `renderPage`) only apply to a subset of the people looking to change document. 

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-02-03 18:35:22 +00:00
Lee Robinson
bc223d76e0
Update deployment docs to fix oversized image. (#33934)
We made the images expand to fit the full width of the container, but the deploy button image shouldn't be that large. Also made some slight refactors here to improve on my past documentation changes.
2022-02-03 02:30:15 +00:00
Aman Mittal
ee2725f506
Update info on how to process webhooks by disabling bodyParser (#33909)
Explicitly mention disabling `bodyParser` when processing a webhook request. Uses the "webhook" keyword that becomes searchable in the docs for anyone running a search from the sidebar.

It addresses the issue [here](https://github.com/vercel/documentation/issues/71) and [this discussion](https://github.com/vercel/community/discussions/93).

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-02-02 16:33:35 +00:00
yuta-ike
04ca8dbff3
Update MDX document (#33916)
This PR added about `providerImportSource` option, which we need to specify in `next.config.js` to use `MDXProvider`. 


Related mdx documents: https://mdxjs.com/docs/using-mdx/#mdx-provider

> To solve this, a context can be used in React, Preact, and Vue. Context provides a way to pass data through the component tree without having to pass props down manually at every level. Set it up like so:
> 1.  Install either @mdx-js/react, @mdx-js/preact, or @mdx-js/vue, depending on what framework you’re using
> 1. Configure your MDX integration with options.providerImportSource set to that package, so either '@mdx-js/react', '@mdx-js/preact', or '@mdx-js/vue'
> 1. Import MDXProvider from that package. Use it to wrap your top-most MDX content component and pass it your components instead:

Because my English skills are not high, feel free to improve my sentences.

## 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`


Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2022-02-02 15:27:58 +00:00
Jack Hanford
d432032bbf
Correct pluralization in newly added Relay documentation (#33880)
* Correct pluralization

* Apply suggestions from code review

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-02-01 16:03:16 -06:00
JJ Kasper
3e60c232a8
Relay Support in Rust Compiler (#33702)
Reverts vercel/next.js#33699

This re-opens the support for relay in swc, although we need to narrow in the causes for the build failures in https://github.com/vercel/next.js/runs/4950448889?check_suite_focus=true

Co-authored-by: Andrey Lunyov <102968+alunyov@users.noreply.github.com>
2022-02-01 18:18:55 +00:00
Maedah Batool
af0d082c49
Add Clarity About Downloading and Self-Hosting a Font File (#33760)
Details about downloading and self-hosting font files were missing from our[ Font Optimization docs](https://nextjs.org/docs/basic-features/font-optimization). This PR addresses these changes.

## Bug

- [x] Related issues linked using #33054

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-02-01 17:45:39 +00:00
Maedah Batool
791c356e36
Building web forms with Next.js and Vercel (#32525)
* First commit

* Test Commit

* First draft

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update intro.

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Improve docs in part 5

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Fix Form function in JSX

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update guide contents

* Add different cloud computing companies

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Add details about JavaScript validation

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Improve code for validation without JS

* Improve regex docs

* Add regular expression example

* Explain regex example

* Add regex image

* Add demo videos

* Improve small fixes

* Fix images

* Fix images

* Improve scripts

* Improve scripts

* Add links to example repo

* Test cloudinary images

* Test cloudinary images

* Add resized images

* Test videos

* Remove images folder

* test video

* Fix link

* New video component

* Add images in readme

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Add mdx frontmatter details

* Remove videos from guide

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Update docs/guides/building-forms.md

Co-authored-by: Rich Haines <hello@richardhaines.dev>

* Fix typo for Name

* Fix code changes

* Improve docs

* Improve conclusion

* Improve code syntax

* Add lint tests

* Fix yarn language test

Co-authored-by: Rich Haines <hello@richardhaines.dev>
2022-02-01 15:11:03 +01:00
Aman Mittal
ad79c04d6b
Update Content-Security-Policy header usage explanation (#33833)
This PR improves the Content-Security-Policy header usage explanation in the `next.config.js` file.



## Bug

- [x] Related issues linked using fixes #33598 
- [ ] 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-31 20:30:47 +00:00
Delba de Oliveira
030666b5bf
[Docs] Testing docs: Comment out optional config that points to a file (#33827)
## Documentation / Examples

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

This prevents users who copy and paste the options without creating the associated file from experiencing an error. The option is explained in the Jest Docs and in the `Optional: Extend Jest with custom matchers` section.
2022-01-31 14:49:42 +00:00
Emrin
b72eeae202
[docs] Mention SWC in TypeScript documentation. (#33801)
Update outdated TS/TSX compiler information in the documentation.

## 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`


Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2022-01-30 17:30:02 +00:00
Rich Haines
138361208c
Fixed duplicate data fetching overview page + links (#33774)
This PR removes the duplicate overview link for data fetching, and fixes the corresponding links

## 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>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-01-29 02:52:40 +00:00
JJ Kasper
5ebc6d064f
Move custom server note from middleware doc (#33744)
This moves the note about custom server handling for middleware to the custom server document. 

## Documentation / Examples

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

x-ref: https://github.com/vercel/next.js/pull/33535#discussion_r790110427
2022-01-27 22:58:01 +00:00
Nelson Frank
c2b6d235f2
Correct misspelling in testing documentation #33754 (#33755)
```diff
- Styleheets and images ....

+ Styleheets and images ....
```
closes #33754



## 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-27 22:12:55 +00:00
Rich Haines
8a1c947df1
Changed data fetching file name to overview to fix meta data title (#33232)
* Changed data fetching file name to overview to fix meta data title

* Update docs/api-reference/data-fetching/get-server-side-props.md

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

* Update manifest and check

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-01-27 09:14:14 -06:00
Vienio99
a0275f2750
Update Time to First Byte (TTFB) link (#33715)
The initial link was showing 404 not found



## 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-26 22:49:30 +00:00
MJ
c385d1b8c4
REMOVE: duplicate key in docs/testing.md (#33681)
There is a duplicate key, `testEnvironment` in one of the examples that are located in docs/testing.md.
In my humble opinion, It is not good to have an error in examples.
My suggestion is we have only one key and it is up to developers what options they have for the `testEnvironment`.

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-01-26 17:41:19 +00:00
Jeff
9b98c5a0e0
chore(docs): update security headers specification (#33673)
1. fix details on how next handles security headers

* note: check your HSTS at https://hstspreload.org
* if your using headers in the config you need to add them below like 

![Screen Shot 2022-01-25 at 9 58 30 PM](https://user-images.githubusercontent.com/8095978/151096692-1544e239-6229-4654-bf64-b01bfc13a601.png)



## 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: Steven <229881+styfle@users.noreply.github.com>
2022-01-26 16:38:15 +00:00
JJ Kasper
b5d4564cca
Revert "Relay Support in Rust Compiler" (#33699) 2022-01-26 17:26:32 +01:00
Karl Horky
5c6c385100
Use relative path for example (#33565)
The paths starting with slashes in the ESLint config examples are absolute, which are almost never the correct configuration for a project. Using a relative path is a much more common configuration, and leads to much less debugging why these examples don't work.

## 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-26 12:41:14 +00:00
Terence Bezman
b20eb99a4d
Relay Support in Rust Compiler (#33240)
## Feature

Implements feature requested in https://github.com/vercel/next.js/issues/30805. 

A few people including myself have been looking to use Relay with Next.JS and want to use the new Rust Compiler. This is my stab at an implementation. 

### How it works?
Finds all  `graphql` tagged template experssions and replaces them with `require`s to the file generated by Relay.

### Where I need help
- I've only worked with Rust a handful of times so I would appreciate any feedback on my use of language features.
- Is there any performance overhead to many duplicate usages of `require`? I imagine there's a cache in place but I want to be sure.
- I've added some unit tests & integration tests but I might be missing some use cases. Feel free to comment some use cases I'm not thinking about.

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Documentation added
  - I haven't added any docs since this is an experimental API.

## Documentation / Examples

You're expected to be running the Relay Compiler along side Next.JS when you're developing. This is pretty standard. I wouldn't expect people to have any problem with this.

### Usage
In your `next.config.js`
```js
module.exports = {
  experimental: {
    relay: {
      language: 'typescript', // or 'javascript`
      artifactDirectory: 'path/to/you/artifact/directory' // you can leave this undefined if you did not specify one in the `relay.json`
    }
  }
}
```


Co-authored-by: Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
2022-01-26 08:23:57 +00:00
Choz
d055fee266
Updated docs for getServerSideProps and getStaticProps return values (#33577)
This fixes the documentation for getServerSideProps and getStaticProps which mislead the defined type.

Current screenshot taken from [nextjs doc](https://nextjs.org/docs/api-reference/data-fetching/get-server-side-props)

![image](https://user-images.githubusercontent.com/5223310/150689799-5da3c1b6-61ae-4455-8970-8c96f025474a.png)

However, the declared type for these types are using union type which represents **any of the following** instead of **optional**.

Declared types;
[GetStaticPropsResult](https://github.com/vercel/next.js/blob/canary/packages/next/types/index.d.ts#L107)
![image](https://user-images.githubusercontent.com/5223310/150689919-5f3cf8f8-60d3-48e4-9412-993e2ead0634.png)

[GetServerSidePropsResult](https://github.com/vercel/next.js/blob/canary/packages/next/types/index.d.ts#L160)
![image](https://user-images.githubusercontent.com/5223310/150689931-16fe3bef-eb4e-41cd-b087-98c3282d599d.png)

---

### This PR updates the documentation for their return values;

**Before**: The `...` function should return an object with the following **optional** properties:
**After**: The `...` function should return object with **any one of the following** properties:

---



## Bug

- [x] 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: Vadi Taslim <70912283+vaditaslim@users.noreply.github.com>
2022-01-26 02:27:55 +00:00
11koukou
7452c0bf1b
Add lazyRoot optional property to next/image component (#33290)
* Added 'rootEl' oprional property to next/Image component resembling 'root' option of the Intersection Observer API

* changed 'rootEl' to 'lazyBoundary' and its type as well

* added test, fixed initial root detection

* Update test/integration/image-component/default/test/index.test.js

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

* prop names changed

* added 'lazyroot' prop to the documentation

* removed unused import

* Apply suggestions from code review

* Update docs with lazyRoot added in 12.0.9

Co-authored-by: Steven <steven@ceriously.com>
2022-01-25 14:54:15 +01:00
Katie Byers
eba64c29a4
Clarify headers config option description (#33484)
Reading over this page, it wasn't immediately clear to me if these were headers which would get read off of the incoming request, or headers to be added to the outgoing response.



## Documentation / Examples

- [X] Make sure the linting passes by running `yarn lint`
2022-01-25 03:12:47 +00:00
Lee Robinson
c71465d87a
Clarify next/image usage with next export based on feedback. (#33555)
[See feedback here](https://github.com/vercel/next.js/discussions/19065#discussioncomment-2021147) for how we could improve clarity on these docs.
2022-01-24 18:42:21 +00:00
Lee Robinson
a0e3e14b66
Update next/server documentation for geo (#33609)
Make it clear that `geo` is not populated by the default Next.js server, and requires your hosting platform to integrate with a geolocation service to look up the location based on the request.

If self-hosting, for example, this could be achieved with the [Google Geolocation API](https://developers.google.com/maps/documentation/geolocation/overview).
2022-01-24 17:32:40 +00:00
Luis Alvarez D
72511fce09
Removed unrequired path in docs' manifest (#33579)
Minor change to remove duplicated route in the documentation manifest, this should change the title of https://nextjs.org/docs/basic-features/data-fetching/index from

![image](https://user-images.githubusercontent.com/4278345/150690965-8f3faf8f-715c-44a5-8ccf-3d6c21f8c9ec.png)

To: `Data Fetching: Overview | Next.js`. That's because our routes reducer is matching the parent route which doesn't have a title.
2022-01-23 18:47:48 +00:00
Sævar Berg
f4c1594a6b
Update middleware documentation for custom server (#33535)
Upgrading from 12.0.0 to 12.0.8 results in `[dev] error - Error: To use middleware you must provide a `hostname` and `port` to the Next.js Server` and this requirement did not seem to be documented anywhere. Fixes #33450 which seems to have been erroneously closed.



## Bug

- [X] 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: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-01-21 21:37:15 +00:00
Tharaka Abeyratne
d866121f04
[docs] Update authentication docs to fix iron-session link. (#33483)
Co-authored-by: Vincent Voyer <vincent@codeagain.com>
Co-authored-by: Lee Robinson <me@leerob.io>
2022-01-21 12:21:23 +01:00
Katie Byers
7df38bc56b
fix(docs): Fix typo in Custom Build Id docs (#33515)
Tiny wordsmithing - fixing the tense of a verb and using a slightly more accurate word.
2022-01-21 04:12:53 +00:00
Hannes Bornö
c634d76162
ReferenceError in authentication.md example fixed (#33411)
Before
```jsx
export const getServerSideProps = withSession(async function ({ req, res }) {
  if (!req.session.user) {
    return {
      redirect: {
        destination: '/login',
        permanent: false,
      },
    }
  }

  return {
    props: { user }, // User not defined
  }
})
```
2022-01-17 21:07:53 +00:00
Bashu Naimi-Roy
3dc4b524e7
fix minor typo in SWR (#33378)
Fixes a small typo: "highly recommend" -> "highly recommended"
2022-01-17 04:04:42 +00:00
Martijn Hols
67bc262b69
Update security-headers.md: fix path does not match homepage (#33137)
The filter did not match the intention of the comment as `/(.*)` does not match the homepage as per https://github.com/vercel/next.js/discussions/17991#discussioncomment-1298194.

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-01-15 00:36:27 +00:00
Callum Gare
5748915851
Add onLoad gottcha note to next/script docs (#33097)
Add a note to the onLoad section of the next/script documentation clarifying that onLoad will not run if `strategy="beforeInteractive"`. (That tripped me up for a bit so I thought I'd update the docs to save any one else the hassle :).)

Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2022-01-14 16:22:57 +00:00
Tim Neutkens
ab62a13dfe
Add sections for Remove React Properties and Remove Console to compiler docs (#33311)
Adds docs for some experimental flags that were already shipped to stable.



## 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-14 14:17:32 +00:00
Bennett Dams
5d2730bb26
docs: Mention middleware for getStaticProps (#33273)
Mention middleware to access the request for a page that uses `getStaticProps`, e.g. for authentication purposes.




## 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 17:14:11 +00:00
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