Commit graph

385 commits

Author SHA1 Message Date
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