Commit graph

619 commits

Author SHA1 Message Date
Mike Jerome
1c3ac0e3eb
Document scroll option for router.push (#22275)
Clarify in the docs that scroll is an option for router.push() and it defaults to true.
2021-02-17 16:02:18 +00:00
JJ Kasper
958bd6cabb
Update server output path in static optimization docs (#21910) 2021-02-05 21:00:03 -06:00
Flavio Wuensche
ee184a11d8
Add example for headers and link in the docs (#21821) 2021-02-05 09:07:22 -06:00
Joe Haddad
cef4b4b153
Revert "Fix docs for sample query parameters" (#21881)
This reverts commit 9a3a0da319.
2021-02-04 20:35:09 -05:00
Sam Holmes
9a3a0da319
Fix docs for sample query parameters (#21879) 2021-02-05 01:17:26 +00:00
Aryan Beezadhur
40065135a5
Docs: delete extra bracket [introduction.md] (#21715) 2021-02-01 06:24:10 +00:00
Lachlan Campbell
e2001db016
Fix “it’s” typo in CRA migration doc (#21678) 2021-01-29 20:58:11 -06:00
Lee Robinson
232209b513
Remove note about Yarn 2 support. (#21665)
My addition of the Yarn 2 caveat was more nuanced than I thought. Apologies. @merceyz has been adding extensive e2e tests for Yarn 2 support. We plan to support Yarn 2 compat.

Reverts https://github.com/vercel/next.js/pull/21657.
2021-01-29 19:09:17 +00:00
Lee Robinson
843252b821
Add note about Yarn 2 support. (#21657)
As we saw some confusion with users trying out Yarn 2 and hitting roadblocks in their app. Yarn 2 is supported on a best-effort basis.
2021-01-29 14:38:19 +00:00
Lee Robinson
5a73859fe8
Update docs and Create Next App to use API Middlewares by default. (#21639) 2021-01-28 23:34:03 +00:00
Ondřej Chrastina
7aa397f32e
Add Kontent example to preview section (#21542)
Kontent example also contains the implementation of the preview capabilities in the example.

Including the example as it is [Data fetching section](https://nextjs.org/docs/basic-features/data-fetching).
2021-01-26 15:00:29 +00:00
mcha
c619f41f92
Doc: pageExtensions - note regarding affected files (#21326)
#21279 

This is just a comment explaining that changing `pageExtensions` not only applies to `pages/*` but other files as well.
2021-01-26 11:49:36 +00:00
Lee Robinson
d82672c397
Add Next.js Analytics to documentation. (#21527) 2021-01-25 19:12:33 +00:00
Faizan Virani
6c51ad96ac
Added Typescript example for withRouter (#18116)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-01-25 14:48:28 +01:00
Justin Smith
8d92010979
Update headers.md to clarify Cache-Control gets overwritten in prod (#19967)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-01-24 17:14:19 +01:00
Dylan R. Johnston
5baedf5567
Update data-fetching.md to use async file loading (#17518)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-01-23 17:28:33 +01:00
Tim Neutkens
d991e3c957
Update manifest.json 2021-01-21 15:06:53 +01:00
David Spiessens
0fc46d0b70
Add Note to i18n-routing Docs for Subdomains for Locale Domains (#21387) 2021-01-20 17:08:55 +00:00
Joe Haddad
cfae5c6c32
fix: lint 2021-01-19 00:26:53 -05:00
Lee Robinson
5d98874e8f
Add guide "Migrating from Create React App" (#21212) 2021-01-18 17:37:32 -06:00
Tim Neutkens
c5b5c43e3d
Add codemod for files that do not support the new React JSX transform (#21281)
Previously our automatic React injection approach injected `import React from 'react'` automatically whenever JSX was detected. The new official JSX transform solves this by enforcing importing `React` when it is used.

This codemod automatically converted files that are using a "global React variable" to use `import React from 'react'`
2021-01-18 15:17:10 +00:00
Lee Robinson
dc87a8436b
Update redirected or broken Vercel docs links. (#21119) 2021-01-14 15:37:21 +00:00
Volodymyr Klymenko
334ce64cd7
Add missing word to Data Fetching docs (#21018)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-01-13 15:35:32 +01:00
Lalit
a6ff7bd661
Update a link (#20999)
Update link from https://swr.now.sh to https://swr.vercel.app
2021-01-13 14:22:29 +00:00
Baheya Khalifa
f9b7a391b7
Fix teeny tiny typo (#21005) 2021-01-12 15:05:32 +00:00
Lee Robinson
e30c5a8eb8
Add "Migrating from React Router" docs. (#20982)
Please let me know if anything is missing from this document 😄
2021-01-12 01:44:14 +00:00
Lachlan Campbell
4d282f929f
Add note on destructuring to Env Variables docs (#20869)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-01-11 11:13:24 +01:00
Daniel Stumme
d49c47427b
Adding small note to ENV documentation (#20860)
This single sentence addition would have saved me about a day of troubleshooting. This doc doesn't mention how the inline occurs. The only place I could eventually find that mentions this is the server & public runtime config pages.
2021-01-07 16:54:15 +00:00
Luc Leray
8eaabe2fb0
Fix deploy buttons URLs (#20834)
Fix all deploy button URLs in the Next.js repo to follow the following format:
```
https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/<EXAMPLE_NAME>&project-name=<EXAMPLE_NAME>&repository-name=<EXAMPLE_NAME>
```

The detailed docs for the Deploy Button can be found here: https://vercel.com/docs/more/deploy-button.

Also updates legacy Vercel import flow URLs (starting with vercel.com/import or with vercel.com/new/project), to use the new vercel.com/new URLs.

---

For example, for the `hello-world` example:

The URL is https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/hello-world&project-name=hello-world&repository-name=hello-world

And the deploy button looks like this:
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/hello-world&project-name=hello-world&repository-name=hello-world)

---

For reference, I used the following regexes to search for the incorrect URLs

```
\(https://vercel.com/import/git\?s=https://github.com/vercel/next.js/tree/canary/examples/(.*)\)
\(https://vercel.com/import/git\?c=1&s=https://github.com/vercel/next.js/tree/canary/examples/([^&]*)(.*)\)
\(https://vercel.com/import/project\?template=https://github.com/vercel/next.js/tree/canary/examples/(.*)\)
https://vercel.com/import/git
https://vercel.com/import/select-scope
https://vercel.com/import
https://vercel.com/new/project
```
2021-01-07 01:40:29 +00:00
Shu Uesugi
817cffdcbe
Use vercel.app for blog starter URL (#20820)
Rename https://next-blog-starter.now.sh to https://next-blog-starter.vercel.app (@lfades renamed the domain name)
2021-01-06 18:13:40 +00:00
Tim Neutkens
fb9ca49401
Update static file serving doc to mention Next.js 10 (#20815)
Fixes #20403
2021-01-06 15:21:34 +00:00
Lee Robinson
9afc0f58c4
Add docs for custom image loaders. (#20788)
Docs for https://github.com/vercel/next.js/pull/20216/.
2021-01-06 02:16:09 +00:00
JJ Kasper
f8e44b9425
Add documentation for rewrite params query passing behavior (#20757)
Closes: https://github.com/vercel/next.js/issues/20197
2021-01-05 14:47:08 +00:00
Tim Neutkens
a1a4af2d32 Bring back indicator documentation with a note that the feature has been removed 2021-01-05 12:47:52 +01:00
Jesse Jafa
0d98f370aa
Clarify ctx.query type on getServerSideProps (#20327)
Closes https://github.com/vercel/next.js/issues/19481

The current text implies `query` is a string. IMO it would be better if it clarified that `query` is an object containing the query string's keys and values

Edit:
Relevant docs url: https://nextjs.org/docs/basic-features/data-fetching#getserversideprops-server-side-rendering
2021-01-04 21:58:56 +00:00
Tim Neutkens
74166ea7e8
Remove outdated documentation (#20714)
Fixes #20487
2021-01-04 10:45:57 +01:00
Leo Lamprecht
9a0d704f76
Clarify how to use Environment Variables on Vercel (#20708)
Updates the env documentation to mention `.vercelignore` when using the Vercel CLI. Also clears up parts of the other paragraphs and updates the links as these topics now have dedicated pages in the Vercel docs.
2021-01-04 09:42:57 +00:00
Frédéric Montet
98752eb0f1
Update link.md (#20435)
Added the `locale` prop in the Link documentation. At the moment it is only stated in the i18n doc.
2021-01-03 14:48:54 +00:00
JJ Kasper
fad3256091
Update docs for basePath: false rewrite (#20663) 2021-01-01 12:40:25 -05:00
JJ Kasper
3a9d18b549
Add isReady field on router (#20628)
Adds an `isReady` field on `next/router` specifying whether the router fields are updated client-side and ready for use. Should only be used inside of `useEffect` methods and not for conditionally rendering on the server.

Closes: https://github.com/vercel/next.js/issues/8259
Closes: https://github.com/vercel/next.js/pull/9370
2020-12-31 16:54:32 +00:00
Lee Robinson
380afbfba2
Add docs on authentication patterns. (#16277)
Building off [this Slack conversation](https://vercel.slack.com/archives/CGD3XGSD7/p1597329727013900), this PR adds a top-level section to the documentation on authentication patterns.

Please provide any and all comments! A few open thoughts I have:

- ~Should this include code snippets from the related providers or stay very high-level? At what point do we delegate to the examples folder?~ Keep things high level and delegate to examples folder 
- ~Should this include any related cards at the bottom?~ Added to the bottom
- ~Should other places in the documentation link back to here?~ Added link from routing
- Should it be a top-level route, or be underneath advanced?
2020-12-31 08:28:11 +00:00
Joe Haddad
74693810d0
docs: update image docs for consistency (#20621) 2020-12-30 16:33:21 -05:00
Joe Haddad
45b87aa23a
feat(next/image): preload priority images (#20615)
The HTML Living Standard explicitly says `href` should be omitted to prevent the loading of an incorrectly sized image:
https://html.spec.whatwg.org/multipage/semantics.html#attr-link-imagesrcset

![image](https://user-images.githubusercontent.com/616428/103378205-8a013800-4aaf-11eb-9085-10f547263fed.png)

Since it's in the spec, I assume this is valid-enough HTML.

This also dedupes preloads which the old implementation did not.

---

Fixes #18756
x-ref #19118
Fixes #18720
2020-12-30 21:10:28 +00:00
Lee Robinson
a03f1f3847
Add version history for API changes to documentation. (#20604)
Closes https://github.com/vercel/next.js/issues/20036.
2020-12-30 15:06:34 +00:00
matamatanot
d33d1dd00a
Ignore domains option when loader is set (#18447)
```
images: {
    domains: ['example.com'],
    path: 'https://example.com/myaccount/',
},
```
Those `domains` and `path` look a lot alike for me and so, I was confused. I found out that the domains are ignored if the Loader is set, which makes sense.
2020-12-30 01:35:37 +00:00
Daniel Yefet
69ff649999
Remove "priority" prop from Image docs (#20471)
I don't think the docs should still mention the `priority` prop because the feature no longer exists since this was merged -  https://github.com/vercel/next.js/pull/19118

It certainly caught me out! 😬 https://github.com/vercel/next.js/issues/20438
2020-12-29 00:29:32 +00:00
Joe Bernard
d434f1dde1
Docs typo fix (#20498)
* Docs typo fix

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

Co-authored-by: Lachlan Campbell <lachlanjc@hey.com>

Co-authored-by: Joe Haddad <timer150@gmail.com>
Co-authored-by: Lachlan Campbell <lachlanjc@hey.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-12-28 14:21:26 -05:00
Max Romanyuta
c8837dcbda
Upgrade all http links to https (#20402)
Upgraded all `http` links to `https` that support the `https` protocol.

Llinks
-----
- https://github.com/
- https://koajs.com
- https://ant.design
- https://www.carbondesignsystem.com/components/overview
- https://themes.carbondesignsystem.com
- https://knexjs.org
- https://jxnblk.com/rebass
- https://i.imgur.com/JCxtWSj.gif
- https://react.semantic-ui.com
- https://stomp.github.io
- https://videojs.com
2020-12-22 21:41:27 +00:00
Lee Robinson
9c917ab263
Add note to deployment docs about handling new versions. (#20373)
Co-authored-by: Luis Alvarez D. <luis@vercel.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-12-22 13:59:27 +01:00
Rob
c86757bcc7
changed ref from 'master' to 'main' branch (#20390)
Changed reference from 'master' to 'main' branch under DPS section in line with GitHub's recent switch from master to main branch as base repo branch names.
2020-12-22 12:36:50 +00:00
Vitor Barbosa
7e20231643
Fix source map config description (#20279)
This should fix  source map config description text.
2020-12-17 20:34:28 +00:00
Tim Neutkens
72fae8bed4
Move productionBrowserSourceMaps out of experimental (#20267)
Makes https://www.npmjs.com/package/@zeit/next-source-maps a built-in feature so that it can be deprecated.
2020-12-17 15:04:17 +00:00
Leo Toneff
25cb43a73b
Added flag to identify shallow router events (#19802)
This PR is an implementation of RFC #13276 (more specifically @banerjeesouvik's [suggestion](https://github.com/vercel/next.js/discussions/13276#discussioncomment-17874)) which solves #3322 by adding an extra parameter to the router events that'll allow you to see whether or not the route is shallow.

This is a recreation of PR #13243.
2020-12-17 09:14:50 +00:00
Tuan Nguyen
977b3ed769
Correct a typo (#20183) 2020-12-14 21:43:12 +00:00
Dmitry Belyaev
a442841517
Update Link documentation (#19980)
Mention onClick property for next/link wrapping custom components
2020-12-14 10:02:10 +00:00
Joi Glifberg
ac89474303
Add dynamic and import note. (#20145)
Add note about import required to be explicit and dynamic required to be top-level module.
2020-12-14 09:42:53 +00:00
Craig Johnson
114f4801df
Update introduction.md (#20129)
Grammar correction.
2020-12-14 09:55:52 +01:00
Bruno Antunes
8340e6d345
[Image Component] image sizes property becomes 100vw by default (#20067)
Currently if sizes is not defined, Next.js is setting sizes as:
```
(max-width: 640px) 640px, (max-width: 750px) 750px, (max-width: 828px) 828px, (max-width: 1080px) 1080px, (max-width: 1200px) 1200px, (max-width: 1920px) 1920px, (max-width: 2048px) 2048px, 3840px'
```

This pull request will make sizes be `100vw` by default, which will allow us to download "smaller" images than what's currently happening. 

In a demo app I have, the difference is between downloading 488KB vs 1.4MB (in images)
2020-12-10 21:29:37 +00:00
JJ Kasper
782537dd2d
Add NEXT_LOCALE cookie note to docs (#20045)
Closes: https://github.com/vercel/next.js/issues/20044
2020-12-09 22:45:05 +00:00
JJ Kasper
e6c1aa6483
Add locale: false custom route prefix note (#19765)
This makes sure to note how custom-routes need to be prefixed when `locale: false` is used for routes to be matched correctly. 

Closes: https://github.com/vercel/next.js/issues/19703
2020-12-04 13:32:50 +00:00
Michael McQuade
3924b00478
docs/Remove extra word (#19754)
Remove extra word "the"
2020-12-02 18:09:54 +00:00
Lee Robinson
8c2cb4640a
Clarify data fetching documentation on calling API routes. (#19748)
We've received some feedback that the current note about calling API routes inside gSP/gSSP is confusing. This updates the wording to make it clear you can still use `fetch` in your application, and also to not say you "import" an API route. You import the _logic_ inside the route.
2020-12-02 16:23:42 +00:00
Vyacheslav Matyukhin
7e387f0fce
Avoid misleading inline comments in .env example (#19708)
dotenv currently doesn't support inline comments (see https://github.com/motdotla/dotenv/issues/484), so it's misleading to use inline comments in documentation examples.
2020-12-01 17:34:05 +00:00
Tim Neutkens
ad8999356d Move note about next export and i18n 2020-11-30 11:15:32 +01:00
Wesley Tian
1231ddb001
Fix typo in image-optimization.md (#19670)
Either use `avoid` or `prevent` as verb, but not both.
2020-11-30 02:00:38 +00:00
Curt Siffert
f4bf8a4696
Update getInitialProps.md (#19506)
To clarify what I've noticed as a common source of confusion in discussions online. Fixes https://github.com/vercel/next.js/issues/19426 

If you wish to know whether the code is running as part of a client-side page transition, in either `getInitialProps` or `getServerSideProps`, you can check to see if `context.req.url` starts with `/_next/data`.
2020-11-25 11:23:04 +00:00
Luis Alvarez D
86a0c7b0f7
Remove mention of the Next.js site repo from docs (#19504)
Fixes https://github.com/vercel/next.js/issues/19503
2020-11-25 01:21:51 +00:00
Luis Alvarez D
0ed8152858
Update documentation links (#19502)
- Updated some links in docs that don't have the `.md` extension. Not required for our live docs but useful for the GitHub view.
- Updated links that go to https://nextjs.org/docs to a relative path, that way they'll work for versioned docs
- Updated the `Regex Path Matching` example to be consistent with the paragraph above and with the official example in /examples.
2020-11-25 00:00:06 +00:00
Balázs Orbán
532a5bcc75
Fix grammar in API routes: Introduction (#19385)
For an API route to work, you need to `export as default a function` (a.k.a **request handler**), which then receives the following parameters:
For an API route to work, you need to `export a function as default` (a.k.a **request handler**), which then receives the following parameters:


I might be wrong though (not a native English speaker), it just sounds strange to my ears.
2020-11-24 21:26:02 +00:00
Luis Alvarez D
af5b8ceb7a
Update next export docs to mention i18n caveat (#19491)
Fixes https://github.com/vercel/next.js/issues/19486
2020-11-24 19:23:39 +00:00
Shihabudheen US
fc9fa10618
Add note about disabling prefetching (#19299)
Added the line _Prefetch can be disabled by passing `prefetch={false}`._
2020-11-20 14:44:29 +00:00
JJ Kasper
13f8732f86
Add note to docs for i18n and next export (#19321)
This adds a note about current `i18n` support and `next export` since it is not currently supported as was mentioned in the [initial RFC](https://github.com/vercel/next.js/discussions/17078)

x-ref: https://github.com/vercel/next.js/issues/18318
2020-11-19 17:04:18 +00:00
Lee Robinson
d47d83d88d
Update incremental adoption documentation. (#19286)
Some slight tweaks to match the corresponding blog post.
2020-11-19 00:10:12 +00:00
Vitor Dino
c3293b730e
Fix docs about the return of getStaticProps on basic-features/pages (#19267) 2020-11-18 14:06:18 +01:00
Luis Alvarez D
b955268dbb
Update next/link docs to not include example without href (#19247)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-11-18 13:39:35 +01:00
Lee Robinson
6826ddf9d7
Add docs on incrementally adopting Next.js. (#19226)
Building off the "Migrating to Next.js" section started, this doc provides information on using `rewrites`, `redirects`, and micro-frontends to incrementally adopt Next.js in your codebase.
2020-11-17 12:51:12 +00:00
GH Lee
23111ca057
Update fast-refresh.md (#18047)
ref. https://github.com/vercel/next.js/pull/14519, https://github.com/vercel/next.js/pull/15062
Add limitation for Anonymous arrow functions.
2020-11-16 22:46:43 +00:00
Luis Alvarez D
43e7561240
Update multi zones example (#16281)
~Updated the `with-zones` example and docs to use `@vercel/next` instead of `@now/next` and also updated the readme instructions with better steps.~

~Related to https://github.com/vercel/next.js/issues/12317 - Looks like there may be an issue with the example but it continues to work as expected to me, moving away from `@now/next` may help.~

Fixes https://github.com/vercel/next.js/issues/12317
Closes https://github.com/vercel/next.js/issues/12317

Moved the example to use [Vercel Monorepos](https://vercel.com/blog/monorepos). Locally it switches to `next dev` instead of `vercel dev`.
2020-11-16 16:21:13 +00:00
Amr Saber
c8a29235b5
Update response-helpers.md (#19189)
Update the mentioned redirection status message.
2020-11-16 13:48:30 +01:00
JJ Kasper
1e61b69e31
Add locale: false for custom-routes + i18n (#19164)
This mirrors the `basePath: false` behavior for custom-routes with `locale: false` to allow users to configure the locales manually (`locale: false`) or have the locales be handled automatically for custom-routes. 

Fixes: https://github.com/vercel/next.js/issues/18927
Fixes: https://github.com/vercel/next.js/issues/18795
2020-11-14 03:35:42 +00:00
Steven
84716ae60d
Add next/image docs for omitted props (#19158)
This will make it clear which properties are not allowed
2020-11-14 00:07:47 +00:00
Steven
7aa8c2c7ec
Update docs to use <Image> instead of <img> (#19160)
This unifies the docs to always use `<Image>` instead of `<img>` so we can set readers up for success.
2020-11-13 23:43:05 +00:00
Steven
20ab35128c
Add missing sizes prop on image component (#19128)
- Fixes #19120
- Closes #18413 
- Related to #19041
2020-11-13 04:30:41 +00:00
Tuan Nguyen
c64bbfeacd
Propose some sentence changes (#19121) 2020-11-12 20:08:31 +00:00
JJ Kasper
6c282a3df4
Add note about changing basePath config (#19111) 2020-11-12 12:48:37 -05:00
Tim Neutkens
feb0cb497b
Add upgrading guide from Next.js 9 to 10 (#19101)
There are no breaking changes but we're seeing some reports of confusion because there's no section for 9 to 10, so this adds it.
2020-11-12 15:22:59 +00:00
Steven
917d594ca8
Print error during next export with default image loader (#19032)
Fixes #18356
2020-11-11 15:46:48 +00:00
Michael McQuade
9e59a6b57a
Add type keyword to API Routes examples (#18234)
The other examples are using the typescript `import type` style, which gets stripped during the build, so I added it to the API Routes example too.
2020-11-09 03:24:02 +00:00
Luis Alvarez D
38a24a9b91
Add docs for fallback: 'blocking' (#18568)
Notes:

- I use "blank page" to refer to that state where a new tab is waiting for the initial HTML. Lmk if there are better words to describe that.
- I did not add an usage example because it's the same thing of `fallback: true` and `fallback: false`, but with a config change. It's also explained below them and mentions the similarity with `fallback: true`

---

Fixes #18468
2020-11-09 02:38:04 +00:00
Luis Alvarez D
d87bc3de98
Update docs for notFound and redirect (#18870)
Note that the indentation of the code samples and notes is important so it uses the same indentation of the items in the list.

Fixes https://github.com/vercel/next.js/issues/18869
2020-11-06 03:15:08 +00:00
Steven
b684b110e4
Add props objectFit and objectPosition to Image component (#18849)
Fixes #18794
2020-11-05 19:42:55 +00:00
JJ Kasper
6fbe5b439d
Add note about domain locales (#18845) 2020-11-05 10:35:22 -06:00
Alex Vilchis
907888c70a
(docs) Add format to notFound for consistency (#18363)
The previous props are in bold, but `notFound` is not.
2020-11-05 16:09:31 +00:00
Willian Justen
afe475d3d4
Fix typo on api-reference/image (#18818) 2020-11-04 18:28:18 -05:00
Abdelrahman Rifai
1bb318c082
docs: fix a typo "concatenated" instead of "concatentated" (#18812) 2020-11-04 18:28:06 -05:00
JJ Kasper
cdaf837f7c
Update asPath to mention basePath/locale stripping (#18807)
Tweak `asPath` docs to mention `basePath` and `locale` will not be included in the value. 

Closes: https://github.com/vercel/next.js/issues/18782
2020-11-04 19:44:57 +00:00
Joris W
5e9d1aae3d
Update exportPathMap.md (#18483)
This page claims that `exportPathMap` is only used by `next export`. This is somewhat misleading, as the mapping is also detected and applied during `yarn develop`. I welcome any other suggestions to make this clearer than I did in this PR.
2020-11-04 18:53:31 +00:00
Steven
35f8f521a2
Update Image docs with links to examples (#18770)
This revises the docs to add headings and also links to layout examples.

Fixes #18554
2020-11-04 17:24:14 +00:00
Steven
d4a92d92ba
Update example for Image Component (#18762) 2020-11-03 15:40:53 -05:00
Lee Robinson
4620dcc759
Update Gatsby migration guide to include next/image. (#18741)
Updates https://nextjs.org/docs/migrating/from-gatsby to mention the new `next/image` component released in Next.js 10.
2020-11-03 14:44:12 +00:00
Steven
2b94b1eea6
Update default widths configuration to handle 2x/3x DPI (#18717)
- Update default `deviceSizes`
- Add default `imageSizes`
- Use `layout` value to determine which `srcset` to use

Fixes #18420 
Closes #18714
2020-11-03 02:12:46 +00:00
JJ Kasper
c8d26edf57
Allow passing statusCode for GS(S)P redirect (#18422)
This adds support for passing `statusCode` in a `redirect` from `getServerSideProps` or `getStaticProps` which matches the `redirect` shape allowed to be returned for `redirects` in `next.config.js`

Closes: https://github.com/vercel/next.js/issues/18350
2020-11-02 21:47:59 +00:00
JJ Kasper
d07b25a963
Add documentation for localeDetection: false (#18696)
Closes: https://github.com/vercel/next.js/issues/18694
2020-11-02 21:26:01 +00:00
JJ Kasper
ee6b7cab4e
Update redirect and notFound GS(S)P documentation (#18690)
This updates the documentation with the new `redirect` and `notFound` return values adding `redirect` to the `getStaticProps` section and adding a new section describing the return values allowed for `getServerSideProps`

Closes: https://github.com/vercel/next.js/pull/18626
Closes: https://github.com/vercel/next.js/issues/18691
2020-11-02 16:58:13 +00:00
Carmelo Scandaliato
197d46ddb9
Remove the static optimization indicator (#18629)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-11-02 09:27:36 +01:00
Joe Haddad
9569f5a31a
Deprecate Image unsized property and add layout="fill" (#18562)
This PR deprecates the `unsized` property from NextImage because the property did not accomplish the desired effect.

Users should rely on one of the new layouts instead:

- `<Image layout="fixed" />`
- `<Image layout="intrinsic" />`
- `<Image layout="responsive" />`
- `<Image layout="fill" />`

The `unsized` property will continue to work as-is in production but is deprecated and will throw in dev.

---

### TODO:
- [x] test `layout=fill` in typescript types
- [x] test `layout=fill` render behavior
- [x] test that `unsized` switches to `layout=fill`
- [x] test `next dev` erroring on `unsized`
- [ ] layout docs (tracked in issue #18554)
- [ ] both `layout=fill` and `layout=responsive` use all deviceWidths in the srcset

---

Fixes #18541 

Co-authored-by: Steven <steven@ceriously.com>
2020-10-31 18:34:06 -04:00
Steven
afa04d22db
Add layout prop to Image component (#18491)
This PR introduces a new `layout` property.

This allows 3 possible values (`fixed`, `intrinsic`, or `responsive`) which solve many use cases we have seen since 10.0.0 and will hopefully avoid usage of `unsized`.

Fixes #18351 

Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-10-30 10:33:34 -04:00
yokinist
bb96fefa80
docs: Add description to i18n-routing (#18438)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2020-10-29 11:57:52 +01:00
Steven
44fe971e6b
Update image optimization docs to include blog details (#18401)
This PR documents some details that are mentioned in the blog post https://nextjs.org/blog/next-10
2020-10-28 17:29:42 +00:00
Steven
79314ef5d8
Update docs with details for cached images (#18399)
This PR explains the caching algorithm for the default loader.
2020-10-28 12:40:40 -04:00
Steven
3195de65d1
Fix docs default config values (#18319)
Missed one rename from #18294
2020-10-27 18:53:37 +00:00
Steven
ab0b0a8a4d
Update docs - add default config for images property (#18296)
- Explain how defaults work and what the default values are.
- Mention quality on the basic page
2020-10-27 14:07:33 +00:00
Steven
f773a1a44a
Rename iconSizes to imageSizes, remove size limitation (#18294)
This does two things:

- Rename `iconSizes` to `imageSizes`.
- Give priority to `imageSizes` regardless of `deviceSizes` as a means to opt-out of the srcset behavior.
2020-10-27 13:19:23 +00:00
Jesse Jafa
774286fcc3
update @now/next to @vercel/next (#18246) 2020-10-27 13:45:52 +01:00
Yuki Takemoto
a9984e4026
Update example link text (#18286)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-10-27 12:50:41 +01:00
Joe Haddad
080b91f986
Adjust default image quality to 75 (#18292) 2020-10-27 11:14:42 +00:00
JJ Kasper
379f4c6574
Expose configured default locale in GS(S)P methods (#18216) 2020-10-27 05:43:15 -04:00
Sam Robbins
046deab685
Add absolute import example (#17342)
Might be easier for some users to see a whole app set up with it
2020-10-27 07:36:42 +00:00
JJ Kasper
3c9da075ff
Add i18n routing docs to manifest (#18264)
Follow-up to https://github.com/vercel/next.js/pull/18067 this adds the manifest item for the new docs
2020-10-27 07:12:27 +00:00
Steven
3a169fbbf0
Separate config into deviceSizes and iconSizes (#18267)
This separates the `next.config.js` property `images.sizes` into to properties: `images.deviceSizes` and `images.iconSizes`.

The purpose is for images that are not intended to take up the majority of the viewport.


Related to #18122
2020-10-26 20:07:52 +00:00
Tim Neutkens
557a0001db
Update image-optimization.md 2020-10-26 18:17:26 +01:00
Tim Neutkens
c381a35247
Update image-optimization.md 2020-10-26 18:13:21 +01:00
Tim Neutkens
8db23295d3
Update image-optimization.md 2020-10-26 18:12:40 +01:00
Tim Neutkens
129fb85da4
Update image-optimization.md 2020-10-26 18:07:23 +01:00
Steven
ce38e4f6fe
FIx image optimization docs (#18254)
Add missing links in the documentation
2020-10-26 12:51:11 -04:00
Steven
3c6f421d99
Add docs for Image Optimization (#18107)
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2020-10-24 14:53:28 +02:00
JJ Kasper
d4397d8ab5
Add initial i18n documentation (#18067)
* Add initial i18n documentation

* Apply suggestions from code review

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

* Apply suggestions from code review

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

* Apply more suggestions

* rephrase a bit more

* Update doc

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2020-10-23 10:42:52 -05:00
Francisco Baio Dias
58edd0998c
Fix typo in headers docs example (#18012) 2020-10-19 11:38:55 +00:00
Luis Alvarez D
e05f3a9112
Capitalize Data Fetching title in docs (#18001)
Noticed that most of our mentions to Data Fetching are capitalized in both words, but the page itself wasn't. And it's not consistent with the titles in other sections
2020-10-19 01:31:40 +00:00
Greg Rickaby
5b1be2bb98
(docs) Fixes for "Migrating from Gatsby" doc (#17858)
Noticed there's an extra backslash in the example which causes an error. 

**EDIT:**

Also the promise needs to be resolved using `.toString()` before it can be returned as `content` in props.
2020-10-14 03:01:38 +00:00
José Antonio Chio
7f798215b5
Add use-npm CLI flag docs (#17803)
Related issue: https://github.com/vercel/next.js/issues/10647#issuecomment-623703149

Sometimes we have both Yarn and NPM installed and want to explicitly bootstrap an app with the CLI using NPM. Having this flag documented could help people understand the package manager behavior and select NPM if that's their preference.
2020-10-13 19:40:29 +00:00
GP
f1b3818dad
docs: Clarify use of getStaticProps / getServerSideProps with app / document (#17839)
Fixes https://github.com/vercel/next.js/issues/17828.

This change adds a caveat to both the "Custom `App`" and "Custom `Document`" pages about how both `getStaticProps` and `getServerSideProps` aren't supported.
2020-10-13 19:17:47 +00:00
Amir Ali
d73b34c3fd
Fix higherOrderComponent causing broken layout (#17812)
`higherOrderComponent(WrappedComponent)` causing the layout broken in mobile screen. 
* refer to screenshots below.


![image](https://user-images.githubusercontent.com/43801058/95730641-faaa6c80-0c97-11eb-9951-2a47b61cefad.png)
![image](https://user-images.githubusercontent.com/43801058/95730661-0138e400-0c98-11eb-9f02-b4d0676fd21b.png)

if we could make it `HOC(WrappedComponent)` it will not break the layout in mobile screen
![image](https://user-images.githubusercontent.com/43801058/95730673-04cc6b00-0c98-11eb-8782-2fa1f760f8fd.png)
2020-10-13 18:55:21 +00:00
SaintMalik
22f91bb355
Fix broken url caused in docs (#17789)
### Description

Easy navigation and easy reading for others.
2020-10-11 11:02:33 +00:00
Adebiyi Adedotun
ee97bc1b20
Fix grammatical typo in docs (#17779)
A URL is correct, not An URL
2020-10-11 06:41:40 +00:00
Jashn Maloo
7dec91175c
change anonymous functions to named in docs examples (#17510)
Fixes #17200
2020-10-05 21:16:47 +00:00
Lee Robinson
1659e4da61
Update migrating from Gatsby docs. (#17636)
Addresses remaining comments from https://github.com/vercel/next.js/pull/17491.
2020-10-05 20:20:26 +00:00
Lee Robinson
06a8b1ad67
Add docs on how to migrate from Gatsby. (#17491)
Addresses https://github.com/vercel/next.js/issues/17453.
2020-10-05 17:39:00 +00:00
Joris W
f8aeaa479e
Add missing introductory exportPathMap purpose description (#17444)
The page describing exportPathMap goes straight into an example without explaining what the config is for.
2020-10-03 14:50:37 +00:00
Yann Pringault
75a0ef9cc2
[docs] Fix typo Next.js -> TypeScript (#17561) 2020-10-02 10:27:38 -05:00
JJ Kasper
05fb9df06d
Add note about priority to rewrites docs (#17535)
This adds a note about public files and pages taking higher priority over rewrites causing them to not be able to be rewritten unless the files are renamed first since this has been asked a few times. 

x-ref: https://github.com/vercel/next.js/discussions/17513
x-ref: https://github.com/vercel/next.js/discussions/9081#discussioncomment-22077
x-ref: https://github.com/vercel/next.js/discussions/9081#discussioncomment-21995
2020-10-02 07:37:46 +00:00
Lee Robinson
fa244ef833
Mention favicon.ico in static file serving docs. (#17540) 2020-10-01 21:14:14 +00:00
Luis Alvarez D
816798569a
Mention required version for global CSS imports in node_modules (#17506)
Fixes https://github.com/vercel/next.js/issues/17505
2020-10-01 08:58:22 +00:00
Sam Robbins
c45497e1c3
Remove reference to now env example (#17341)
The example has been emptied as it is no longer the recommended way to do it so it shouldn't be linked to
2020-09-24 18:30:39 +00:00
Gergo Tolnai
8fdb93d76f
Docs(api-middlewares): use typings for serialize options from @types/cookie (#17285) 2020-09-22 18:52:29 +00:00
Luis Alvarez D
beeeba099b
Rename exportTrailingSlash to trailingSlash in docs (#17268) 2020-09-22 12:10:10 +02:00
GH Lee
92b20c8a1e
Update cdn-support-with-asset-prefix.md (#17237)
Modified paths to absolute paths.
- Deploying to Vercel
- Base path
2020-09-20 21:33:02 -05:00
Daniel Lauzon
571f8bedf7
Update trailingSlash parameter name (#17228)
Reflect the change in `trailingSlash` parameter name.

I found this because of the great warning on the build!
```
Warning: The "exportTrailingSlash" option has been renamed to "trailingSlash". Please update your next.config.js.
```
2020-09-19 19:13:26 +00:00
Dan Laugharn
5f16e063a6
Adds note about public directory (#17203)
This comes up a lot in discussions/as an issue, so added a small comment about uploading files to the public directory. I'm not sure if it is worth a deeper technical explanation as well.
2020-09-18 15:02:37 +00:00
Luis Alvarez D
4ba768e22c
Add missing comma in docs example (#17129)
Including prettier changes that were done automatically after the code sample became valid.
2020-09-16 01:04:58 +00:00
JJ Kasper
d3f4a4cb2a
Provide resolvedUrl to getServerSideProps (#17082)
This continues off of https://github.com/vercel/next.js/pull/17081 and provides this normalized `asPath` value in the context provided to `getServerSideProps` to provide the consistent value since the request URL can vary between direct visit and client transition and the alternative requires building the URL each time manually. 

Kept this change separate from https://github.com/vercel/next.js/pull/17081 since this is addressing a separate issue and allows discussion separately. 

Closes: https://github.com/vercel/next.js/issues/16407
2020-09-14 21:01:04 +00:00
Vincent Voyer
71c5ab629e
docs(babelrc): precise usage without configuring plugins (#16779) 2020-09-12 01:16:24 -04:00
Vahid Hallaji
d4a8d4fc88
fix gtag syntax in measuring docs (#16933) 2020-09-12 01:15:40 -04:00
Jonathan Svenheden
6659334930
Update build time env variable link in the runtime config section (#17017)
Since [the current link](https://nextjs.org/docs/api-reference/next.config.js/environment-variables) for the build-time environment variables docs recommends the approach outlined in [this section](https://nextjs.org/docs/basic-features/environment-variables), I think the link should point there instead.
2020-09-12 04:29:18 +00:00
Joe Haddad
6ecb740415
Improve Asset Prefix Docs (#16998)
Fixes #16444
2020-09-10 13:46:37 -04:00
Joe Haddad
fa9523c063
Document CSS Grid Better (#16996)
Fixes #10508
2020-09-10 13:46:14 -04:00
Joe Haddad
1ea6745106
Importing CSS from Third Party React Components (#16993) 2020-09-10 13:45:30 -04:00
Turcan Vladimir
b227691942
Fix align documentation with the code (#16843) 2020-09-08 12:29:42 -04:00
Luis Alvarez D
ea2df6c0c2
Update link docs to reflect changes on dynamic routing (#16634)
Closes https://github.com/vercel/next.js/issues/16633

- The docs and examples that use `as` have been updated to show how `href` can be used to get the same results
- Added new examples and provided more details on current examples for more details on how `href` can be used.

**Note:** With this change the usage of `as` becomes completely unrequired as I failed to find a good use case for it. Therefore documentation for `as` now includes: `Used for dynamic routes before Next.js 9.5.3`. But that should link to somewhere, either to a blog post or to the Upgrade Guide in our docs.
2020-09-07 16:35:30 +00:00
Luis Alvarez D
b5cf3e4c94
Update dynamic-import docs (#16803)
Goals of this PR:

- Explain `import()` first without mentioning `next/dynamic`, because `next/dynamic` in our API and **Dynamic Import** is a ES feature. This should avoid a common confusion in our users thinking that one can't be used without the other.
- Mention how `next/dynamic` can be used with **Dynamic Imports** to load react components.
- Updated example to include fuzzy search using a dynamic import.

Potential change: Leave the page to be about `import()` and move `next/dynamic` to the API reference (alongside `next/link`, `next/router`, etc.)

Closes https://github.com/vercel/next.js/pull/16299
Closes https://github.com/vercel/next.js/issues/15711
2020-09-05 23:45:30 +00:00
Yichi Zhang
9e4bb5a129
Add Fast Refresh Demo (#16576)
Closes #16538 

Basically reverts #16497 and some minor changes. Also adds a link in the docs.

This reverts commit ec281df70b.
2020-09-01 23:27:57 +00:00
Luis Alvarez D
f1c4cb8b3b
Update preview mode docs to include API Routes (#16705)
Fixes https://github.com/vercel/next.js/issues/16661
2020-08-31 03:02:24 +00:00
Balázs Orbán
d6188a8e33
Clarify sending to Google Analytics in reportWebVitals (#16664)
Clarifies #16662

Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-08-29 22:31:57 -04:00
Sam Robbins
8217597848
Add activeClassName to Link examples (#16658)
Allows people to more easily find how to style active links if they are wanting to
2020-08-28 19:03:40 +00:00
Rich Paret
5bda90f87b
Include yarn instructions (#16565)
* Include yarn instructions

Yarn seems like it's encouraged elsewhere (such as in create-next-app docs), so adding this to clarify it's supported here.

* Added to a similar case

Co-authored-by: Luis Alvarez D <luis@vercel.com>
2020-08-27 21:27:34 -05:00
Christian Pena Valerio
fc5f26b556
Fix github docs links (#16540)
Take care of the other links that aren't working while browsing github. Related to: #16505
2020-08-25 04:31:48 +00:00
Ondřej Chrastina
a856097402
Add Kontent example (#16034)
Hello everyone!

I would like to add the example using [Kentico Kontent](https://kontent.ai) as a data source for your example.
I have tried to be consistent with the other examples and showcase the preview as well.

I have tried to keep up with [Contribution guidelines](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples).

Thank you.
2020-08-24 22:58:53 +00:00
Christian Pena Valerio
c9ad33bd59
Update fast-refresh.md to fix 404 link (#16505) 2020-08-24 09:58:13 -05:00
Luis Alvarez D
333a9ea8ab
Documentation updates (#16503)
Fixes https://github.com/vercel/next.js/issues/16502

Check the issue for more details.
2020-08-24 02:23:12 +00:00
sharils
120b41ec8a
Document req and res (#16432)
* Document req and res

* lint fix

Co-authored-by: Luis Alvarez <luis@vercel.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-08-22 16:29:01 -05:00
JJ Kasper
4d0d09ba9d
Add version note to path aliases docs (#16479)
* Add version note to path aliases docs

* Update docs/advanced-features/module-path-aliases.md

Co-authored-by: Luis Alvarez D <luis@vercel.com>
2020-08-22 16:28:47 -05:00
JJ Kasper
c2a42e4350
Update build CLI docs with new flag (#16419) 2020-08-21 15:12:27 +02:00
Louis Juliendo
24f056c9b3
Fix typo in fast-refresh.md (#16292)
Just correcting a simple typo `fash` to `fast`
2020-08-18 13:15:39 +00:00
Rounak Agarwal
512782ee29
Update docs for server-side code in GS(S)P props (#16198)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-08-18 01:14:26 -04:00
Tuan Nguyen
2cb05b539e
Correct a couple of small grammar errors. (#16221)
Just noticed a couple of tiny grammar errors.
2020-08-15 21:51:33 +00:00
JJ Kasper
ceeb6c3fce
Mention header overriding behavior (#16089)
Closes: https://github.com/vercel/next.js/issues/16088
2020-08-12 04:27:31 +00:00
Tim Neutkens
16345f631e
Add codemod documentation (#16067)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-08-11 15:12:00 +02:00
Tim Neutkens
b8662d5766
Fix link to create-next-app docs (#16069)
Fixes #16066
2020-08-11 12:08:43 +02:00
Caleb Fetzer
79bab9771c
DOCS: Typo fixes - data-fetching (#16004)
Few typos, missing spaces, some small cleanup on grammar.
2020-08-08 15:33:34 +00:00
Arsalan Khattak
ebd1434a84
Add PWA Example (#15433)
Co-authored-by: Luis Alvarez D. <luis@vercel.com>
2020-08-06 13:14:35 -04:00
Eric Piacentini
e18f74fe2d
Update Fast Refresh doc (#15923)
Co-authored-by: Luis Alvarez D <luis@vercel.com>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-08-06 12:34:05 -04:00
Joe Haddad
c86466f4ee
Add variable expansion note (#15917)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-08-05 23:39:32 -04:00
Robin Tom
5218e76818
Example for Redirects (Custom routes) (#15411)
This PR adds example for #15073 
> - [ ] `redirects` For [docs/api-reference/next.config.js/redirects.md](https://github.com/vercel/next.js/blob/canary/docs/api-reference/next.config.js/redirects.md)
2020-08-05 22:20:49 +00:00
Sigurður Gunnar Njálsson
abf6e74e8d
Remove outdated docs on serverless builds and runtime configs (#15907)
Fixes https://github.com/vercel/next.js/issues/15906

This should solve https://github.com/vercel/next.js/issues/15906. It simply removes a block that states runtime configuration for serverless builds are not supported.
2020-08-05 16:11:01 +00:00
Rounak Agarwal
f419ec198b
Update next build docs to include the --profile argument (#15766)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-08-05 15:15:12 +02:00
Joe Haddad
e0d0c2ebb5
Explain Sass Extensions in CSS Docs (#15830)
Fixes #15737
2020-08-03 23:50:46 -04:00
Mehedi Hassan
e89bcf7e39
Add docs page for Create Next App (#15454)
Following up from #14830, this PR adds a new page to the docs for Create Next App. The content is identical to the README created as part of #14830. 

Also added a link on the main `getting-started` page to the new docs for Create Next App to help users find more info on Create Next App if needed. 

I'm unsure as to whether the content for the documentation needs to be different from the one I wrote for the README. Please let me know if that's the case, and I will be happy to tweak the structure.
2020-08-03 13:43:16 +00:00
Sam Robbins
d0c57cf6b3
Add clarification of routing to a dynamic route (#15771)
While it is mentioned in the [link documentation](https://nextjs.org/docs/api-reference/next/link), I think it is useful to also explain in the dynamic route documentation that you need to include the as parameter when routing to a dynamic route/
2020-08-01 12:12:17 +00:00
Luis Alvarez D
01662f1c79
[Docs] Add upgrade notes for Next.js 9.5 (#15703)
Fixes https://github.com/vercel/next.js/issues/15719
2020-07-31 03:40:40 +00:00
JJ Kasper
766fef2271
Document regex support for custom routes (#15714)
This adds an example of using regex matching for custom routes

Fixes https://github.com/vercel/next.js/issues/15712
2020-07-30 21:15:29 +00:00
matamatanot
9d68a363b6
Docs smart-cdn link is dead. (#15707)
You have been redirected to the`/home` page.
I'm not sure if that's correct, but it's been fixed to move the link to the document.

https://vercel.com/smart-cdn
https://vercel.com/docs/v2/edge-network/overview
2020-07-30 19:14:27 +00:00
Luis Alvarez D
17d7f03f2b
[Docs] Use next dev for the getting started page (#15705) 2020-07-30 18:44:44 +00:00
Luis Alvarez D
925384c1cf
Added docs for Incremental Static Regeneration (#15663) 2020-07-29 22:35:25 -04:00
Luis Alvarez D
63ea2d8297
Add CSS Modules examples to docs (#15601)
Fixes https://github.com/vercel/next.js/issues/15595

- Updated the tailwindcss and tailwindcss-emotion examples to the latest version of tailwindcss
- Added a new `with-styled-jsx` example
- Updated the `basic-css` example to use CSS Modules instead of styled-jsx
- Added the examples to the documentation page for built-in css support
2020-07-29 14:43:48 +00:00
JJ Kasper
571e2a7cff
Add note about statusCode config for redirects (#15615)
This adds a note to our documentation about the `statusCode` config to match the note from the redirects documentation for [`vercel.json`](https://vercel.com/docs/configuration#project/redirects)
2020-07-29 09:23:23 +00:00
yokinist
1e8271ebe7
Update multi-zone example link from relative to absolute (#15618) 2020-07-29 09:12:52 +02:00
Luis Alvarez D
4dcf94e5c4
[Docs] Performance time is in milliseconds (#15544) 2020-07-28 10:19:09 +02:00
Luis Alvarez D
bf1af6880a
[Docs] Update links that should point to Vercel repos (#15547)
From feedback, we still have some links that go to zeit repos instead of vercel
2020-07-28 04:16:31 +00:00
Christopher Robert Van Wiemeersch
193ffe7616
fix typo in custom-webpack-config docs (#15533) 2020-07-27 19:24:29 +00:00
Tim Neutkens
a3eec3bf03
Update custom webpack config docs to mention existing features (#15517) 2020-07-27 11:46:17 +02:00
Tim Neutkens
f98e38c9b6
Add static tweet link (#15493) 2020-07-26 16:51:11 +02:00
Kaic Bastidas
d3955cdf51
TypeScript documentation for _document.tsx (#15386)
- Update the [Custom Document page](https://nextjs.org/docs/advanced-features/custom-document) to include an example using `DocumentContext`.
2020-07-26 01:36:36 +00:00
Robin Tom
1a34b237b6
Example for Rewrites (Custom routes) (#15403)
This PR adds example for #15073  
> - [ ] `rewrites` For [docs/api-reference/next.config.js/rewrites.md](https://github.com/vercel/next.js/blob/canary/docs/api-reference/next.config.js/rewrites.md)
2020-07-25 02:38:58 +00:00
Luis Alvarez D
eea25fc5dc
[Docs] Remove false caveat in custom document docs (#15355)
The statement is not true, we provide mocks for `req` and `res`.
2020-07-21 04:00:21 +00:00
Jan Potoms
7dd61b47a2
Fix basepath router events (#14848)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-07-20 16:03:49 -04:00
Joe Haddad
a11d99390a
Stabilize Trailing Slash API (#15331)
Closes #15330
2020-07-20 16:16:59 +00:00
Bruno Bernardino
3bfc25db9f
Clarify optional catch all vs catch all routes (#15290)
Makes the difference between optional catch all routes and catch all routes clearer.

Closes #15229
2020-07-18 20:13:47 +00:00
Jerry Gao
4a136476e7
Fix broken example link in docs for catch all routes (#15295)
Fixes a broken link on https://nextjs.org/docs/routing/dynamic-routes

This path was updated from `pages/docs/[...slug].js` to `pages/docs/[[...slug]].js`, so I've updated the link and moved that example down to the "Optional catch all routes" section.
2020-07-18 19:54:40 +00:00
Mario Beltrán Alarcón
56d62a52fd
docs: include test env in default env vars (#13708)
[Current Environment Variables doc](https://nextjs.org/docs/basic-features/environment-variables#default-environment-variables) mentions `development` and `production` env options but nothing about `test`. Test env is a 3rd valid option, and actually has some implications for `.env.local` from [what I can see in load env configs mechanism](https://github.com/vercel/next.js/blob/canary/packages/next/lib/load-env-config.ts#L68).

This PR aims to include corresponding `test` info for environment variables.
2020-07-17 01:36:12 +00:00
Rafael Almeida
59f147387b
Document API Middlewares with TypeScript (#14275)
My attempt to clear things up 😅

cc @Timer
2020-07-16 05:03:48 +00:00
Luis Alvarez D
55137629a7
Documentation improvements from feedback (#14544)
Co-authored-by: Shu Uesugi <shu@chibicode.com>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-07-14 00:15:55 -04:00
JJ Kasper
3a9cb2c5b3
Update docs for basePath custom-routes interop (#15140)
Follow-up to https://github.com/vercel/next.js/pull/15041 this updates the documentation for custom-routes to mention `basePath` handling with them
2020-07-14 01:26:54 +00:00
Tim Neutkens
9b711883cf
Update docs about type checking (#15103)
Related to #14997
2020-07-12 19:44:37 +00:00
Ashik Paul
98dbbcfd9a
Fixed some minor typos (#15080) 2020-07-11 16:57:15 +00:00
Oskar
8cd149c3ff
Update note about CDN in pages documentation (#14982)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-07-09 12:55:04 +02:00
Ben Botvinick
87ce591014
Change default response code to 307 from 302 in docs (#14947) 2020-07-07 21:36:16 -04:00
Ben Botvinick
d19c34353d
Add res.redirect response helper (#14705)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2020-07-07 01:06:16 -04:00
Tim Neutkens
fdc4c1773b
Add custom routes docs (rewrites, redirects, headers) (#14887)
Fixes #14452
2020-07-06 14:01:42 +00:00
Tim Neutkens
6fe1260b5f
Add basePath documentation (#14882)
Fixes #14453
2020-07-06 12:35:51 +00:00
Darsh Patel
e84537f88e
add NextWebVitalsMetric type for reportWebVitals (#14675)
Fixes: #13512
Defined and exported type for `metric`  used in [reportWebVitals](https://nextjs.org/docs/advanced-features/measuring-performance)

```
export function reportWebVitals(metric) {
  if (metric.label === 'custom') {
    console.log(metric) // The metric object ({ id, name, startTime, value, label }) is logged to the console
  }
}
```

One can now do 
```
import { NextWebVitalsMetric } from 'next/app'
export function reportWebVitals(metric: NextWebVitalsMetric ) {
  if (metric.label === 'custom') {
    console.log(metric) // The metric object ({ id, name, startTime, value, label }) is logged to the console
  }
}
```
2020-07-03 03:36:13 +00:00
Joe Haddad
1d0e7a8a9a
Enable Optional Catch-All by Default (#14687)
Closes #14682
2020-06-29 18:50:32 +00:00
Luis Alvarez D
a04fdc8475
Add Environment Variables Example (#14575)
Closes https://github.com/vercel/next.js/issues/14570
Closes https://github.com/vercel/next.js/issues/14576

- The example features everything on the page in our docs while still being quite simple
- Added a link to it in the documentation
- Deprecated the with-now-env example
2020-06-28 11:57:33 +00:00
Luis Alvarez D
0f60377967
Updated exportPathMap docs (#14630)
Closes https://github.com/vercel/next.js/issues/14596
2020-06-27 17:33:49 +00:00
James Bowes
166834e578
Update the passHref link (#14584)
Keeping up with section headers in markdown is fun :)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-06-26 11:08:48 -05:00
Luis Alvarez D
c6dc34e4d7
[Docs] Focus on useRouter (#14515)
[ch4109]

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

Our current docs for `next/router` use examples from both `useRouter` and `import Router from 'next/router'`, with this PR I'm unifying the API into `useRouter` (`withRouter` is still going to be mentioned multiple times as it is the HOC alternative) and no longer mentioning that you can import a global `Router` object from `next/router`, not sure if I should mention it at least once but that didn't seem to be required.

I also did some structural changes to the docs for `next/router`, now every method starts with a description, then the implementation and explanation of the parameters of the method, and then the usage example, because every method uses the same `Usage` title the hash for them would be something like `#usage`, `#usage-1`, `#usage-2`, e.t.c, so I'm not very happy with this but it looks good.

Feedback wanted 🙏
2020-06-25 23:35:28 +00:00
Jan Potoms
2142b76e6b
Normalize trailing slashes (#13333)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2020-06-23 13:38:49 +02:00
stefanprobst
279ae19c7e
docs: update links to docs site (#14305)
this updates some links to the docs site to their new location
2020-06-18 09:54:07 +00:00
Balázs Orbán
e87b739f33
fix typo in fast refresh documentation (#14296) 2020-06-18 01:11:07 +00:00
Joe Haddad
0426694ce0
Add Fast Refresh Documentation (#14273)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-06-17 14:57:57 -04:00
Bowen
da65f5e409
Update preview-mode.md (#14210)
It is an English grammar fix for the sentence, so that the user can better understand the documentation.
2020-06-17 04:24:35 +00:00
Jesse
d3704a66f8
added graphcms (#14026)
* added graphcms

* Updated readme and environment variables

* Removed gitignore

* Updated tailwind config

* Some fixes in pages

* Updated api endpoints

* lint fix

* Updated readme

* Updated og image

* Updated cms examples to include this one

* Added example to docs

* Added preview demo link

* Updated step

Co-authored-by: Luis Alvarez <luis@vercel.com>
2020-06-15 12:03:34 -05:00
Luis Alvarez D
0b4c32c2aa
[Docs] Update custom server docs (#14147)
[ch3235]
2020-06-13 08:47:13 +00:00
Shu Uesugi
30f30af320
Storyblok CMS Example (#13993)
[ch2842]

- Demo: https://next-blog-storyblok.now.sh/
- Preview Mode: https://next-blog-storyblok.now.sh/api/preview?secret=5nnybHTKlbzkOa6r&slug=draft-post-test
2020-06-10 22:23:28 +00:00
Jason Merino
0defd53564
Small grammar fix. (#14043) 2020-06-10 21:42:17 +00:00
Shu Uesugi
dea4c2cbf4
ButterCMS Example (#13908)
[ch2580]

**Demo:** https://next-blog-buttercms.now.sh/
**Preview Mode:** https://next-blog-buttercms.now.sh/api/preview?secret=CdEAKMRT4tAwzqiD&slug=draft-post-test
2020-06-10 17:13:10 +00:00
Rafael Almeida
a89afc2ec6
Add FAQ section to Built-in CSS Support (#13846)
I added a FAQ section to answer questions I see frequently. Motivation: https://github.com/vercel/next.js/discussions/13625#discussioncomment-23186
2020-06-06 22:40:04 +00:00
Rafael Almeida
813b1e62c5
Add App.getInitialProps example to the TypeScript page (#13785)
I added the commented code with the `AppContext` type to match the example from the [Custom App](https://nextjs.org/docs/advanced-features/custom-app) page. But since this is the TS page I think we could remove these comments and use a clean example, what do you think? 🤔
2020-06-05 18:03:31 +00:00
Shu Uesugi
4e6c326a56
Docs: Fix links to Agility CMS Examples (#13794)
 `cms-agility-cms`
 `cms-agilitycms`

See: https://github.com/vercel/next.js/tree/canary/examples/cms-agilitycms
2020-06-05 09:14:43 +00:00
Jan Potoms
1c8f1b50e3
Add a note about optional catch-all and rootmost route (#13791)
Fixes https://github.com/vercel/next.js/issues/13467
2020-06-05 06:19:01 +00:00
Jazib Sawar
6ce7a0378e
CMS Cosmic Example (#13499)
* Add Cosmic CMS Example

* with native .env support, this file isn't needed anymore

* FIX use path alias

* Add cosmicjs package

* Fix alias import in pages/api/preview

* Added: react-imgix & lazysizes package

* Load lazysizes in layout

* Used imgix image with lazyloading

* Added avatar imgix optimizations

* EDITED: steps to install content, preview

* EDITED: demo link

* EDITED: Install step

* EDITED: preview link steps

* Edited: demo link

* FIXED: object_slug

* Screenshots

* Fixed object_slug link

* Update README.md

* Fix: formatting issue

* Updated readme and renamed .env to env.local

* Sanity checks

* Handle fallback data when expected

* Added link to the example in other examples

* Updated demo deployment

* Added example to docs

* minor lint fix

* Remove manual download step

* use vercel.json

Co-authored-by: Tony Spiro <tspiro@tonyspiro.com>
Co-authored-by: Luis Alvarez <luis@vercel.com>
2020-06-04 15:18:11 -05:00
Joe Haddad
7d9b331775
docs: adjust custom polyfill suggestion (#13766)
The current [with-polyfills](https://github.com/vercel/next.js/blob/canary/examples/with-polyfills/) example is not the suggested way to add polyfills and is known to cause issues with bundling.

The proper way to load polyfills is to include them as the first line in `pages/_app.js`, which I've updated the docs to say.
2020-06-04 16:49:37 +00:00
Timothy
d1c16124b5
Update instances of Now to Vercel where applicable (#13760)
This pull request renames various instances of `now` to `vercel` etc. in order to match content that's being updated on the Vercel platform.
2020-06-04 14:57:17 +00:00
Vincent Voyer
33d44238a9
docs(env variables): small wording change (can => have to) (#13757)
When reading
"In order to expose a variable to the browser you can prefix the variable with NEXT_PUBLIC_. For example:"

I thought that I could maybe use something else than NEXT_PUBLIC_. I guess "have to" or similar would be better here, let me know
2020-06-04 13:22:12 +00:00
Shu Uesugi
c02d86ec52
Docs: Add supported browsers and features (#13741)
[ch1981]

Add the “Supported Browsers and Features” page. The content is taken mostly from the blog posts: [9.4](https://nextjs.org/blog/next-9-4), [9.3](https://nextjs.org/blog/next-9-3), and [9.1.7](https://nextjs.org/blog/next-9-1-7).

- This page is added under “Basic Features” on the sidebar.
- It still links to `with-polyfills` example, but [this example was updated recently](04fbe0b756). I simplified the README.
- Removed the FAQ section on supported browsers.
- On ["Customizing Babel Config"](https://nextjs.org/docs/advanced-features/customizing-babel-config), remove the list of presets which were outdated and instead link to [the preset file](https://github.com/vercel/next.js/blob/canary/packages/next/build/babel/preset.ts) so it’s always up to date.
2020-06-04 10:15:34 +00:00
James Mosier
bb6ae2648d
Added React Strict Mode documentation (#13723)
Added new documentation for React Strict mode under the `next.config.js` doc level.

Closes #13713
2020-06-03 17:22:58 +00:00
Joe Haddad
cfa00c9fcd
chore(docs): use proper Jamstack casing (#13697)
`JAMstack` is now `Jamstack`.
2020-06-03 03:02:41 +00:00
Jefferson Bledsoe
9ff29f710d
Docs: Add postcss-preset-env to the warning when customising the PostCSS configuration (#13695)
The [docs for customising the PostCSS config](https://nextjs.org/docs/advanced-features/customizing-postcss-config) warn the user they will need to manually install any dependencies that Next.JS will implicitly use if the config is not overridden. `postcss-preset-env` is missing from the install command.
2020-06-02 23:29:34 +00:00
Luis Alvarez D
ef22a8b7c5
[Examples] Add missing cms links (#13683)
This was a change that I forgot to push into the Agility CMS example PR, adding it now.
2020-06-02 17:36:12 +00:00
Shu Uesugi
d60fada097
CMS Strapi Example (#12701)
* Strapi Example

* Fix og image URL

* Remove next.config.js

* Apply updates

* Remove API_URL

* Bugfixes

* Finish Strapi README

* Deploy Strapi

* Add strapi examples

* now →  vercel [ch1796]

* Use npx

* Minor readme update

* Prettier fix

Co-authored-by: Luis Alvarez <luis@vercel.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-06-01 18:49:43 -05:00
Joe Haddad
f49309a92e
docs([[...rest]]): add experimental banner (#13641)
This feature is still experimental.
2020-06-01 22:51:57 +00:00