Commit graph

628 commits

Author SHA1 Message Date
Steven
8151a7e0dc
Add minimumCacheTTL config for Image Optimization (#27200)
- Closes #23328  
- Related to #19914 
- Related to #22319 


## Feature

- [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [x] Errors have helpful link attached, see `contributing.md`
2021-07-15 19:55:12 +00:00
Tomas Jansson
d29a95ad63
Change pure functions to functions (#27192)
The right terminology should be used so we don't learn new developers wrong facts.

Using pure function here is plain wrong, the definition of a pure functions is as follows:

> The function return values are identical for identical arguments. The function application has no side effects. 

What you have here both have side effects, the calls to `res.setXXX`, and it isn't identical for identical arguments since you have `Date.now()`.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes
2021-07-15 14:12:58 +00:00
Steven
52a2022da4
Revert "Update data-fetching.md" (#27148)
Reverts vercel/next.js#27018 per comment https://github.com/vercel/next.js/pull/27018#issuecomment-877548891
2021-07-13 19:53:45 +00:00
Lee Robinson
1a9492d51f
Update Going to Production docs to use quote. (#27131)
Will make it look a little nicer 😄
2021-07-12 23:13:52 +00:00
Lee Robinson
a93f8b6393
Fix code block in Layouts docs. (#27130)
<img width="885" alt="CleanShot 2021-07-12 at 17 58 23@2x" src="https://user-images.githubusercontent.com/9113740/125365933-c2c17a00-e33a-11eb-9d24-5970b5437a21.png">
2021-07-12 23:04:06 +00:00
Steven
3b9786925d
Add jsdoc types to docs snippets (#27125)
This PR adds the JSDoc types so that VS Code and other tools can use autocompletion when editing `next.config.js`
2021-07-12 20:57:38 +00:00
Lee Robinson
26f4794944
[docs] Layouts & Going to Production (#27021)
- Helps clear up customer confusion about how to share React state with layouts, including nested layouts
- Provides guidance on best practices before shipping your application to production

Open to any feedback!
2021-07-12 19:04:43 +00:00
Tim Neutkens
5520dd3fd9
Mention customization of next.config.js to import images (#27104)
Fixes #27094



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes
2021-07-12 13:16:13 +00:00
Karl Sander
13a4d29bf1
Docs/Typo: Replace triple dot character with real dots (#27030)
This was probably automatically inserted without the original author noticing. It causes some headache when copy&pasting the filename.
2021-07-08 21:52:59 +00:00
Steven
1a8ad14089
Rename next/image dangerously-unoptimized to custom and warn when applicable (#26998)
Since we are no longer accepting new built-in loaders, users may wish to use a different cloud provider.

So this PR renames `dangerously-unoptimized` to `custom` to handle this case as well as the intention of `next export`.

If the user doesn't add a `loader` prop, we throw an error.
If the user adds a `loader` prop but it doesn't return the width, we print a warning.

- Follow up to #26847 
- Fixes #21079 
- Fixes #19612 
- Related to #26850
2021-07-08 19:35:19 +00:00
Jaime Rios
1c2b171322
Update data-fetching.md (#27018)
Improve typing for use with Typescript example

<!--
Thanks for opening a PR! Your contribution is much appreciated.
In order to make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below.
Choose the right checklist for the change that you're making:

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [X] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [X] Make sure the linting passes
2021-07-08 17:50:06 +00:00
Darsh Patel
226e81c733
Add dangerously-unoptimized loader for next/image (#26847)
* add support for static loader

* update existing test

* add test

* add prettier-ignore

* update docs

* apply suggestions from review

* remove un-needed normalize

* Apply suggestions from code review

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

* update test

Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Steven <steven@ceriously.com>
2021-07-07 15:20:16 -05:00
Lee Robinson
c139f2566a
Reorder docs manifest and rename to Script Optimization. (#26874)
So there's _conformance_ between the other docs / optimizations.
2021-07-02 15:33:46 +00:00
Paul van den Dool
9039afe75b
Update to environment-variable.md (#26863)
## 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
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [ ] Make sure the linting passes

## Why the change
I lost quite a few hours figuring out why my environment variable was `undefined` in the browser.
I read about the built-in support and was like: "Oh nice" and didn't read much further. I missed the part about how you need to prefix your variables with `NEXT_PUBLIC_` in order to expose them to the browser.
I think a hint to this in the anchor link to that section will make it more discoverable as it's then mentioned near the top and will save people who are like me some time and a headache.
2021-07-02 10:35:53 +00:00
Steven
93f625428b
Add onLoadingComplete() prop to Image component (#26824)
This adds a new prop, `onLoadingComplete()`, to handle the most common use case of `ref`.

I also added docs and a warning when using `ref` so we recommend the new prop instead.
 
- Fixes #18398 
- Fixes #22482
2021-07-01 18:51:20 +00:00
Tim Neutkens
5b9ad8da90
Move next-server directory files to server directory (#26756)
* Move next-server directory files to server directory

* Update tests

* Update paths in other places
2021-06-30 13:44:40 +02:00
Lee Robinson
e8a9bd1996
Update next/image docs for relative parent with layout=fill. (#26615)
https://github.com/vercel/next.js/discussions/18739#discussioncomment-435925
2021-06-25 18:50:10 +00:00
Peter Mekhaeil
22d1771c29
Enable Alex documentation linting for docs (#26598) 2021-06-25 11:40:50 -05:00
Jiachi Liu
650ebed77e
doc: prettify docs for next script (#26572)
x-ref: https://github.com/vercel/next.js/pull/26518#issuecomment-867566010

## Documentation / Examples

- [x] Make sure the linting passes
2021-06-24 13:41:55 +00:00
Joshua Byrd
2c3624269a
Update SWR example to include fetcher function. (#26520)
* Previous example doesn't work

* Apply suggestions from code review

* Update docs/basic-features/data-fetching.md

* lint-fix

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-06-23 23:41:15 -05:00
JJ Kasper
1012630bad
Add note about adding additional types (#26545)
* Add note about adding additional types

* Update to bold edit also

* Apply suggestions from code review

Co-authored-by: Steven <steven@ceriously.com>
2021-06-23 15:06:25 -05:00
JJ Kasper
1dd9c4b8d9
Update next-env note in docs (#26536)
This ensures we don't recommend editing the `next-env` file since we need to be able to tweak it to accept future types we add in Next.js


## Documentation / Examples

- [x] Make sure the linting passes

Closes: https://github.com/vercel/next.js/issues/26533
2021-06-23 16:20:28 +00:00
Vitaly Baev
cb95c59ad5
docs: updated minimum Node.js version (#26528)
## Documentation / Examples

- [x] Make sure the linting passes


According to new requirements in `package.json` minimum Node.js version for now is 12.0
2021-06-23 16:05:25 +00:00
JJ Kasper
c9119f845c
Update i18n fields in docs (#26492)
Closes: https://github.com/vercel/next.js/issues/24991

## Documentation / Examples

- [x] Make sure the linting passes
2021-06-22 17:52:26 +00:00
Sam Robbins
fc67fc737c
Add module.exports to security headers documentation (#26466)
Without `module.exports`, the provided code won't work if just pasted into `next.config.js`

## Documentation / Examples

- [x] Make sure the linting passes
2021-06-22 08:54:53 +00:00
JJ Kasper
2b761a9e47
docs(router.md) Add note about page state and navigation (#26320)
This adds a note to the router doc explaining that page state is not reset by default when updating the URL but staying on the same page as this has come up in a few issues. 


## Documentation / Examples

- [x] Make sure the linting passes

x-ref: https://github.com/vercel/next.js/issues/26270
2021-06-21 09:09:50 +00:00
Guilherme Araújo
2a5db0b58c
Docs: Add Prettier section on ESLint page (#26347)
## 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

- [x] Make sure the linting passes
2021-06-20 21:00:57 +00:00
Akash Patel
d88f484e89
add missing closing bracket (#26375)
## 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-06-20 17:30:09 +00:00
Lee Robinson
afa86cc5bb
Improve the next/script documentation. (#26325)
* Improve the `next/script` documentation.

* lint-fix

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-06-18 15:36:51 -05:00
Lee Robinson
ffaa4813b6
Add docs on adding HTTP security headers. (#25833) 2021-06-18 12:34:32 -05:00
Joe Bell
98acfaf8cc
Extend disclaimer for dynamic image imports (#26241)
* docs: extend disclaimer for dynamic image imports

* docs: extend guidance on blurDataURL

* Update docs/api-reference/next/image.md

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2021-06-18 16:21:12 +02:00
Luke Ingalls
67f5830acc
docs: fixed typo (#26311) 2021-06-18 15:20:37 +02:00
neb
8a76cad98f
Fix closing tag in Script docs (#26276)
## 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-06-17 18:13:21 +00:00
Michael McQuade
2a9e29f635
Correct Next.js 9 upgrade instructions (#26271)
The upgrade instructions from version 9 to version 10 still had the `@latest` tag. This PR changes it to use `@10`
2021-06-17 17:35:12 +00:00
Choi Sumin
ab4ac8ad5c
docs: remove duplicated --ts, --typescript from Options (#26252)
## Documentation / Examples
https://nextjs.org/docs/api-reference/create-next-app#options
In Options, `--ts, --typescript` is duplicated! so i removed it 😃

- [x] Make sure the linting passes
2021-06-17 17:28:58 +00:00
Tim Neutkens
72743bcea8
Update next/script docs to clear up confusion around next/head and client-side JS (#26253) 2021-06-17 15:46:55 +02:00
Tim Neutkens
947ee9dd93
Update note in script doc (#26214) 2021-06-16 21:14:46 +02:00
Tim Neutkens
2967fe1df3
Update docs on static image imports (#26211)
Incorporates some of the feedback we've had about this doc.

## 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-06-16 18:46:01 +00:00
Steven
a3c31b6773
Update next/image docs and example with shimmer animation (#26183)
It was mentioned in Issue #18858 that we might add a `placeholder="skeleton"` but that didn't ship with Next.js 11 because it would likely need to handle additional config such as light mode / dark mode, speed, duration, etc.

So this PR adds an example of `blurDataURL` usage with a nice shimmer animation (sometimes called a skeleton).
2021-06-16 14:54:25 +00:00
Steven
4c5e9eb26a
Fix next/image docs version history (#26192)
Fixes version history in the `next/image` component [docs](
https://nextjs.org/docs/api-reference/next/image).

- [before.png](https://user-images.githubusercontent.com/229881/122237698-8874d200-ce8d-11eb-8b6b-6dad8ebfd13b.png)
- [after.png](https://user-images.githubusercontent.com/229881/122237708-8ad72c00-ce8d-11eb-891b-31f87847113c.png)
2021-06-16 14:48:42 +00:00
Wiktoria Mielcarek
7c8b504252
add missing step of installing next@latest (#26141)
- Step for installing the latest next version was missing
- Turned "Upgrade React version to latest" to an h3 heading



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

## Documentation / Examples

- [ ] Make sure the linting passes
2021-06-16 11:42:12 +00:00
Lachlan Campbell
5ec2f981bc
docs(next/script): Improve formatting of docs (#26149)
Noticed a few things off in the Script docs—for example, the "before" variant should show using a non-React Component `<script>` tag, & the capitalization was inconsistent in a few places.

## Documentation / Examples

- [x] Make sure the linting passes
2021-06-16 07:07:56 +00:00
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
JJ Kasper
225b784393
Ensure all errors are added in manifest (#26129)
* Ensure all errors are added in manifest

* Add script doc to manifest
2021-06-15 13:36:25 -05:00
Herman Nygaard
6bd68bdb9f
docs(image): fix image import path (#26142) 2021-06-15 18:32:46 +00:00
Alex Castle
8873374963
Update image documentation for static image (#25949)
* Update image documentation for static image

Adds documentation for static image and blurry placeholder functionality

* Update docs/api-reference/next/image.md

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

* Update docs/api-reference/next/image.md

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

* Update docs/api-reference/next/image.md

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

* Update docs/api-reference/next/image.md

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

* Version history and placeholder revisions

* Apply suggestions from code review

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

* lint-fix

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-06-15 09:40:37 -05: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
Joe Cohen
86ab7531b2
Update learn path in getting started and from cra docs (#26104)
This PR updates the Learn path in the getting started and from Create React App docs. 

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

- [x] Make sure the linting passes
2021-06-15 00:49:35 +00:00
Houssein Djirdeh
ef97d9b73e
adds section to docs for migrating existing eslint configurations (#26101) 2021-06-14 18:15:12 -05:00
Tim Neutkens
cb84bc5daf
Remove deprecated features and enable future flag (#26066)
- Enables excludeDefaultMomentLocales by default
- Adds distDir cleaning (See RFC #6009)
- Adds support for `PORT`
- Removes `router.events` from the server-side router as it should not be used server-side (long-standing todo that is potentially breaking). Note that it's still available as `Router.events` (import Router from 'next/router') and with `useRouter` in `useEffect`. Using it with `useEffect` is the correct way and I've updated the upgrading guide to reflect that
- Added webpack 5 to the upgrading guide
- Removed `Head.rewind` as it's been a no-op since Next.js 9.5 and can now be safely removed from user code

Fixes #11408 
Fixes #10338
Fixes #5554



## Bug

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

## Feature

- [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [ ] Make sure the linting passes
2021-06-14 14:20:34 +00: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
JJ Kasper
2cff809001
Add experimental CRA transform to docs (#25989)
This mentions the experimental create react app transform to the codemods doc including the feedback link while it is experimental. 

## Documentation / Examples

- [x] Make sure the linting passes
2021-06-10 16:44:11 +00:00
Sam Robbins
d72225eef0
Add changing the hostname to the cli doc (#25971)
## Documentation / Examples

- [x] Make sure the linting passes
2021-06-10 09:14:36 +00:00
Marco Valsecchi
7f25ec4bc4
Fix loader url composition on image/next doc (#25893)
Remove the extra slash to avoid double slashes on returned url (the image src prop needs to start with a slash)
2021-06-10 04:34:48 +00:00
John Jago
c6ba29da00
docs: use descriptive links instead of "click here" (#25897)
* docs: use descriptive links instead of "click here"

Linking text such as "here" or "click here" is not accessible (and
doesn't look that great either). The best example of why it's better to
use link text that provides context is that some screen readers allow
navigation by links alone. If all links say "click here", then how does
the user know which one to go to?

I tried to make the minimal change necessary to make the link text
descriptive but had to reword a few sentences that didn't read well.

* Apply suggestions from code review

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-06-09 13:23:16 -05: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
Yuki Takemoto
3b76d3371a
Fix command in upgrade guide (#25879)
This PR fixed command in upgrade guide.
2021-06-08 02:31:58 +00:00
Tim Neutkens
5be354ede6
Add note to upgrading guide about React version (#25849)
Co-authored-by: Gerald Monaco <gbmonaco@google.com>
2021-06-07 17:46:32 +02:00
Abdullah Mzaien
f9fc8bcc59
Adding --typescript option (#25831)
## 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
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [ ] Make sure the linting passes
2021-06-07 10:58:48 +00: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
Tim Neutkens
ed3e8f7125
Remove deprecated features (#25446)
* Remove deprecated features

In the next major version we'll want to merge this PR that removes some of the long-time deprecated features, it'll have a positive effect on bundle size.

* Update tests

* Update tests

* Change unsized to layout=fill in test

* Update sizes

* Update rotation test

* Update size limit test

* Update test

* Update test

* Update test
2021-06-02 10:11:03 -05:00
Hussain Fakhruddin
9752cb85d8
Fix rewrite example for fallback site (#25508)
Rewrite document fix based on the following article.

https://nextjs.org/docs/migrating/incremental-adoption

## Documentation / Examples

- [ x] Make sure the linting passes
2021-05-27 23:28:15 +00:00
Thomas Boyt
327488dacb
Improve documentation of CDN asset paths (#25531)
I've been working on adding CDN support to my Next.js app and was very surprised to find that the `assetPrefix` did not turn `/_next/static/chunks/sha.js` into `$assetPrefix/chunks/sha.js`, but instead `$assetPrefix/_next/static/chunks/sha.js`. Hopefully this change to the documentation will make this behavior much more clear to future users.

I've also incorporated a warning against uploading the entire `.next` folder to a CDN, as I saw @timneutkens note in a discussion here: https://github.com/vercel/next.js/discussions/11622#discussioncomment-3779

## Documentation / Examples

- [ ] Make sure the linting passes
2021-05-27 23:23:12 +00:00
Lee Robinson
28501c6af4
Update Authentication docs to be an examples list. (#25497)
Replaces https://github.com/vercel/next.js/pull/25485.
2021-05-26 19:06:47 +00:00
vmod
2e5fac7976
docs: typo in rewrites page (#25377) 2021-05-23 15:19:38 +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
Tim Neutkens
b9b35d406c
Remove snippet that is not recommended. (#25220)
In general this means you did something wrong in your application (importing tests for example), so this should be fixed in the app, not using custom config.
2021-05-19 11:56:53 +02: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
Julien Birgand
1ab90c142c
docs(image.md): update layout property part (#25149)
When I first read the documentation about the `layout` property, I wondered how to apply the `object-fit` css property to the `Image` component. I think it makes sense to mention its `objectFit` property at this point.
## Documentation / Examples

- [x] Make sure the linting passes
2021-05-16 17:59:50 +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
JJ Kasper
22e3f8c2e7
docs(rewrites.md): update beforeFiles note (#25113)
This updates the beforeFiles rewrites note to mention the rewrites can affect `_next` files which are required for loading pages client-side. 

## Documentation / Examples

- [x] Make sure the linting passes
2021-05-13 18:32:46 +00:00
Tim Neutkens
a1e16dc944
Update rewrites doc to mention they are applied to client-side routing (#25099)
Updates an old message in the docs that caused some confusion here: https://github.com/vercel/next.js/issues/24904#issuecomment-837086983

## 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-13 14:14:42 +00:00
Marcos Taron
1cb83c1b35
update create-next-app documentation (#25079)
Update `create-next-app` documentation based in #25010 issue. 


## Documentation / Examples

- [X] Make sure the linting passes
2021-05-13 10:39:21 +00:00
JJ Kasper
4443d6f3d3
Update has redirect examples (#25003)
This fixes an infinite redirect in the `has` redirect examples by ensuring not to match the redirect destination itself

## Documentation / Examples

- [x] Make sure the linting passes
2021-05-11 17:29:53 +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
C. Lewis
9c77cda6c5
feat(create-next-app): add --ts, --typescript support (#24655)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-05-07 10:08:16 +02: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
Tom Scott
73e1fb4da4
Add version note for has property (#24836)
The guides for `next.config.js` never specify that the `has: { }` syntax is only available for v10.1, and not for v10.0. Add a note that indicates these features are only available in the latest version.

## Documentation / Examples

- [x] Make sure the linting passes
2021-05-06 09:28:29 +00: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
Erfan Mirzapour
cc41a191fe
docs(config intro): Fix github link hash (#24838)
Doc page: https://nextjs.org/docs/api-reference/next.config.js/introduction

[`config-sahred.ts`](https://github.com/vercel/next.js/blob/canary/packages/next/next-server/server/config-shared.ts) file has been updated and the link here now is pointing to the random line!
2021-05-05 22:20:23 +00:00
Erfan Mirzapour
2251658c35
docs(next/router): Update router.push api (#24833)
Documentation page: https://nextjs.org/docs/api-reference/next/router#routerpush

Add `locale`  as supported options in `route.push()` (#17898)
2021-05-05 19:49:40 +00:00
Erfan Mirzapour
192d42bcac
docs(response-helpers): Update res.json definition (#24782) 2021-05-05 15:54:36 +02:00
Lee Robinson
3e6ce9071b
Update font optimization docs to mention opting out. (#24756) 2021-05-03 18:35:10 +00:00
Bart Nagel
a77f3845f6
Clarify whether router.pathname includes basePath (#24675)
The docs were vague on this -- `router.asPath` mentions that it doesn't include `basePath` but `router.pathname` didn't say either way.

## Documentation / Examples

- [ ] Make sure the linting passes: I haven't checked; I presume you have a CI bot for this.
2021-05-01 15:56:30 +00:00
Lee Robinson
9721374440
Add documentation on Font Optimization. (#24572) 2021-04-28 22:11:05 +00:00
JJ Kasper
f3d518385c
Remove experimental note for has routes (#24529)
This removes the warnings/notes for the `has` custom-routes feature being experimental

## Documentation / Examples

- [x] Make sure the linting passes
2021-04-28 09:08:38 +00:00
Rishabh Poddar
41efb824f2
Docs update: Adds supertokens to 'Bring Your Own Database' section as well + improvements to code structure in example (#23779)
- Since SuperTokens is a self hosted solution, it can be added to 'Bring Your Own Database' as well (in https://nextjs.org/docs/authentication#supertokens)
- Improvements to code structure in the with-supertokens example
2021-04-20 17:23:32 +00:00
Victor Garcia
efb2b8b06c
docs(deployment): prune non-production deps (#23056)
added the following line, to remove the size of the `runner` (production) image. This will remove the `devDependencies` from the container after `next build` completes.

```
yarn install --production --ignore-scripts --prefer-offline
```

For the typescript starter, this is the change in size

| before <br/>proposed change<br/>size in bytes | after <br/> proposed change <br/> size in bytes|
|----|---|
|  347MB    | 176MB |
2021-04-20 15:51:36 +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
JJ Kasper
d51fe0540e
Add note for exportPathMap query and prerender pages (#24266)
* Add note for exportPathMap query and prerender pages

* Update docs skip
2021-04-20 09:11:14 -05:00
Tom Greuter
213db224f3
Update Preview Mode docs with note on local dev (#22906) 2021-04-19 22:19:32 -05:00
Martin Janeček
1f54ba6559
docs: reduce image size in sample Dockerfile (#24108) 2021-04-19 22:00:56 -05:00
Gaël Haméon
cb6b4798f6
Clarify dynamic imports documentation (#24168) 2021-04-19 21:53:00 -05:00
Jan Amann
6eabef68cd
Add next-intl example (#21447)
I've recently built an i18n library that is tailored to usage in Next.js: [next-intl](https://github.com/amannn/next-intl). It complements the internationalized routing capabilities of Next.js by managing translations and providing them to components, as well as handling date and time formatting. It's a bit young, but I'm using it in two production apps now and I'm quite confident in the library.

Would you want to include an example and link to it?
2021-04-19 19:58:36 +00:00
Jasper Moelker
76184ab0ca
docs: fix a11y router examples (#23031)
Non-interactive elements such as a `<span>` should not have event bindings as they are not accessible by everyone.
This fix solves this issue by replacing it with a `<button>` which is suitable for interaction.
Since a button defaults to `type="submit"` the button also explicitly has a `type="button"` to prevent accidental form submits (all examples aim to navigate, not to submit a form).

[More background on this a11y best practice](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/no-static-element-interactions.md)
2021-04-19 19:42:52 +00:00
JJ Kasper
d2b0d43eb9
Update incremental adoption in rewrites doc (#24186)
This updates the incremental adoption section in the rewrites docs to mention the new fallback rewrites instead of the no-op rewrite and also points to the incrementally adopting Next.js doc. 

## Documentation / Examples

- [x] Make sure the linting passes

Closes: https://github.com/vercel/next.js/pull/23700
Closes: https://github.com/vercel/next.js/issues/23699
2021-04-18 08:26:08 +00:00
Julien Benchetrit
646a881183
Docs update: Redirect paths with parentheses (#24062)
It took me quite a while to understand that in order to redirect from `/english(default)/:path` to `/en-us/:path`, I have to escape the parentheses in the source with double backslashes so I thought I'd suggest it as a small doc update.


## Documentation / Examples

- [x] Make sure the linting passes
2021-04-17 19:40:35 +00:00