Commit graph

184 commits

Author SHA1 Message Date
Steven
e4eed61a31
Update next/image docs and examples (#26150)
This updates the `next/image` docs and examples to add missing information.
2021-06-16 01:26:53 +00:00
Janicklas Ralph
353bfaa0f7
Script component docs (#25471)
* Script component docs

* Update docs with examples and feedback changes

* Fix typo

* Add example

* Update text

* Apply suggestions from code review

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-06-15 09:20:29 -05:00
Houssein Djirdeh
ef97d9b73e
adds section to docs for migrating existing eslint configurations (#26101) 2021-06-14 18:15:12 -05:00
C. Lewis
eddf5e0de9
docs: advise users of create-next-app --ts, --typescript (#25349)
Since #24655 landed in 10.2.1, I wanted to update the documentation, especially for the top Google results for "next typescript", so that users know how to create a TS project.

Please feel free to change anything you feel is appropriate.
2021-06-11 02:48:06 +00:00
Houssein Djirdeh
50a36eecd3
ESLint Updates (#25895)
* lots of eslint updates

* adds eslint: dirs flag to next.config.js

* update lint command in docs

* update per review comments

* re-add --no-lint command for build

* Apply suggestions from code review

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-06-08 17:46:00 -05:00
Lee Robinson
5d38d065ec
Update ESLint docs. (#25816)
Some slight tweaks based on my review of the docs. A few outstanding questions left 😄 

https://github.com/vercel/next.js/pull/25064#pullrequestreview-676799292
2021-06-05 18:34:28 +00:00
Hiram
73995f6385
doc: update TS version for --incremental (#25736)
1. Stable version of TypeScript 4.3 just released, replaced beta version tag with stable version v4.3.2.
2. Add reference article explaining about the performance improvement.

## Documentation / Examples

- [x] Make sure the linting passes
2021-06-03 12:54:11 +00:00
Houssein Djirdeh
bbc28ccae0
next lint + ESLint in Create Next App (#25064)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-06-03 14:01:24 +02:00
Alex Brazier
14cedc755b
Update docs to show how to typecheck next.config.js (#25240)
## Documentation

Partially resolves #5318

- [x] Make sure the linting passes
2021-05-20 12:00:09 +00:00
JJ Kasper
ece07f6012
doc(typescript.md) Mention incremental type checking (#25268)
* doc(typescript.md) Mention incremental type checking

* Apply suggestions from code review

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2021-05-19 14:56:46 -05:00
JJ Kasper
fb7342ac7c
Add default revalidate value to docs (#25238)
This makes sure to mention the default revalidate value is `false` or to not revalidate since it previously only mentions it's optional. 

## Documentation / Examples

- [x] Make sure the linting passes
2021-05-18 21:57:28 +00:00
Marius Craciunoiu
64a709db6c
Update docs to reflect page props are optional (#25142)
This PR changes the `GetServerSidePropsResult` type to require that it returns a `props` object. The docs mention it's required even for a redirect/notFound, and it throws and error if it's not returned.

From the docs:

> props - A required object with the props that will be received by the page component. It should be a serializable object

## 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-05-14 16:59:24 +00:00
Lee Robinson
f6c60946a3
Clarify rewrites and other docs cleanup. (#24890)
Based on user feedback, this clarifies the difference between rewrites and redirects, as well as follows the new pattern for showing version history with a collapsible table.
2021-05-07 13:09:15 +00:00
Tim Neutkens
81cc1c5852
Remove old docs sections (#24853)
Co-authored-by: Lee Robinson <me@leerob.io>
2021-05-06 14:17:00 +02:00
JJ Kasper
802af5ff5b
Land - Font optimizations - Adobe Fonts / Typekit support (#24834)
This updates this initial PR here https://github.com/vercel/next.js/pull/18146 to resolve merge conflicts and updates tests since we aren't able to update that PR itself.

## 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`
- [x] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.

Closes: https://github.com/vercel/next.js/pull/18146
2021-05-06 04:02:07 +00:00
Lee Robinson
3e6ce9071b
Update font optimization docs to mention opting out. (#24756) 2021-05-03 18:35:10 +00:00
Lee Robinson
9721374440
Add documentation on Font Optimization. (#24572) 2021-04-28 22:11:05 +00:00
Vass Bence
6bb70b9771
Mention notFound cache purging use-case (#21234)
As far as I know `notFound` supports use cases like a post getting permanently removed from CMS (thus should not exist on the webpage anymore) without a redeploy. 

If the above statement is correct I believe this should be mentioned in the docs as it seems like a common use case and quite a few questions about this are floating around in the GitHub Discussions too.
2021-04-20 14:17:20 +00:00
Lee Robinson
279e105279
Update .now.sh to .vercel.app. (#22359) 2021-04-14 09:46:06 -05:00
Angel Gomez
9a548b649f
Add missing import in CSS docs (#24007)
This is a one-line commit, which adds the missing import for VisuallyHidden component, from Reach UI, to the CSS documentation in the Dialog component example.
2021-04-13 08:49:55 +00:00
Turadg Aleahmad
7f6a74a8e2
docs: Update built-in-css-support.md with Linaria example (#23333)
add link to Linaria example
2021-04-07 23:20:03 +00:00
Joe Haddad
eecc3342cb
Temporarily remove experimental ESLint integration (#23521)
This pull request **temporarily** removes ESLint, as it was not landed in accordance with our standard experimental policies. We are fully committed to landing this change again.

This is being reverted because:

- Next.js has very strict goals for its install size. This feature resulted in adding over 17MB, or a 43.6% increase.
- The feature was not first landed under the `experimental` key in `next.config.js`, rather, it was added under the stable namespace (top-level)
- Using the feature doesn't do a "guided setup" like TypeScript, it should ask you to "bring your own" dependencies for ESLint
- It uses a undesirable ESLint plugin name: `plugin:@next/next/recommended`. This should read out as strictly `next`, or as short as we can get it.
- Does not provide actionable warnings (missing link to resolve issue)
- Does not follow appropriate console output styling. We need to revisit how these are presented.

To re-land this, we need to ensure the following minimums are met:
- Very minor change in install size
- Fully experimental (i.e. flagged) with warnings
- Finalized package name and configuration shape, preferably so we can do ` { extends: 'next' } `.
2021-03-30 08:26:35 +00:00
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