Commit graph

162 commits

Author SHA1 Message Date
Lee Robinson
d4d611119e
Fix YAML parsing issue in ESLint docs. (#23511) 2021-03-29 17:59:51 +02:00
Tim Neutkens
b34a0c98fa
Update err.sh links to use nextjs.org/docs/messages instead (#23353) 2021-03-29 10:25:00 +02:00
matamatanot
5c7475a6e8
Fix typo in eslint doc (#23338)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

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

## Documentation / Examples

- [ ] Make sure the linting passes
2021-03-24 02:03:51 +00:00
Houssein Djirdeh
e5ef60fecb
Add ESLint to Next.js (#22437)
For #22228

This PR:

- Adds ESLint to toolchain
  - Included by default for builds (`next build`)
  - Can be enabled for development (`next dev`)
  - Custom formatter built for output
- Adds appropriate tests
- Adds two documentation pages
2021-03-23 21:32:42 +00:00
Tim
a1b97ac3f8
Added Prepr CMS Examples to docs (#23221)
Following commit 1f5c2c8513

Adding documentation links to example.

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

## Documentation / Examples

- [x ] Make sure the linting passes
2021-03-19 16:10:35 +00:00
Tim Neutkens
70d306e0ac
Add note about multiple requests when using incremental static generation (#23190) 2021-03-18 16:22:29 +01:00
Lee Robinson
f3cbdf0b02
Document how to use basePath with next/image. (#23123)
Supersedes https://github.com/vercel/next.js/pull/23115 for more clarity and a better recommendation.
2021-03-16 19:56:41 +00:00
Shane Rogers
308c2beca2
Add image base path configuration option (#23115)
I similarly [couldn't find this info](https://github.com/vercel/next.js/issues/19711#issuecomment-750414110) in the docs about configuring the image path when using an app `basePath`, so thought I'd add it.
2021-03-16 17:13:24 +00:00
Lee Robinson
9431439c6d
Add note about next/export to Image Optimization docs. (#23088)
https://github.com/vercel/next.js/discussions/19065#discussioncomment-484842
2021-03-16 01:05:14 +00:00
Alex Safian
3063d3b8ff
Update pages.md (#23064)
The `path` variable must be an array of objects which has a `params` key. This code will prevent reader confusion.
2021-03-15 02:44:58 +00:00
Kenneth Lum
2af5a0e47c
it is props: { posts } (#23004)
changing `props: posts` to `props: { posts }`
2021-03-12 08:11:01 +00:00
Kenneth Lum
e7a22afe2f
When there is data already, the props is props: { data } (#23003)
When there is data already, the props is props: { data }
Would be better if the `props: { }` part is `props: { data }`
2021-03-12 08:03:10 +00:00
JJ Kasper
62967fc667
Add note for loading env files during testing (#22982)
This adds a note to the environment variables documentation to mention how the env files can be loaded using the `@next/env` package as this has been brought up a few times. 

x-ref: https://github.com/vercel/next.js/issues/22936#issuecomment-796665303
x-ref: https://github.com/vercel/next.js/issues/17903
2021-03-12 00:47:42 +00: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
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
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
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
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
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
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
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
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
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
Vitor Dino
c3293b730e
Fix docs about the return of getStaticProps on basic-features/pages (#19267) 2020-11-18 14:06:18 +01: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
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
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
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
Abdelrahman Rifai
1bb318c082
docs: fix a typo "concatenated" instead of "concatentated" (#18812) 2020-11-04 18:28:06 -05: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
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
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
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
JJ Kasper
379f4c6574
Expose configured default locale in GS(S)P methods (#18216) 2020-10-27 05:43:15 -04: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