Commit Graph

3801 Commits

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