Commit graph

1107 commits

Author SHA1 Message Date
Faris Masad
63651a63de
Add note about using the /_error page directly to custom error page article (#39671)
See https://github.com/vercel/next.js/issues/39144

It's not completely clear that `/_error` should not be used as a normal page. Added a note under `Caveats` in the custom error page article
2022-08-22 02:30:18 +00:00
greeble
1ebd6a1d94
Update next.js.configs line number (#39802) 2022-08-21 22:16:23 +00:00
Steven
5b6631a5c9
Add section to next/future/image docs about Known Browser Bugs (#39759)
This PR adds section to `next/future/image` docs about Known Browser Bugs. This also includes workarounds that might vary depending on the image and how the user plans to use it.
2022-08-20 00:21:00 +00:00
Delba de Oliveira
ee134ee338
Change the React Server Components CTA to the router/layout RFC (#39724) 2022-08-18 14:23:10 +00:00
Muhammad Musa
f743aa1833
Update strategies count to 4 (#39610)
## 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 by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-15 18:37:19 +00:00
Andrew Cherniavskii
d9a1c4315e
[docs] Avoid next config validation warning (#39554)
[docs] avoid next config validation warning
2022-08-12 10:54:57 -05:00
Bennett Dams
9d1980d086
docs: Rename API middlewares title in sidebar (#39534)
Based on the PR #39407, the sidebar title for API middlewares is changed from "API Middlewares" to "Request Helpers".




## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm lint`
- [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-12 13:55:39 +00:00
Noel Kim (김민혁)
40f0eb126b
feat(next-swc/modularize_imports): Add Kebab case (#38583)
* Feat: Add Kebab case

* Add document

* Feat: Add Kebab case

* Add document

* Add Test cases
2022-08-10 22:51:05 -05:00
Maedah Batool
bd61406e54
Improve next/future/image Migration docs (#39421)
The [comparison table for migration](https://nextjs.org/docs/api-reference/next/future/image#migration) to `next/future/image` looks odd layout-wise. The issue was brought up via this [Slack thread](https://vercel.slack.com/archives/C02F56A54LU/p1660040275310949).

This PR makes this improvement.

### New implementation

<img width="1216" alt="image" src="https://user-images.githubusercontent.com/12712988/183631902-6850836b-cb4e-44ea-909f-ba353725be15.png">

## 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 by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)


Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2022-08-10 20:40:53 +00:00
Jono Hewitt
7d59da97ac
Update router.prefetch documentation to include locale option (#39442)
* Update `router.prefetch` documentation

Include documentation for setting the locale as an option within `router.prefetch`.

* apply suggestions

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-08-09 21:02:55 -05:00
Alex Castle
e2119c068f
Add component wrapper in sizes documentation code snippet (#39437)
* Wrap sizes code snippets in component

* Don't remove docs import statement
2022-08-09 15:43:25 -05:00
Alex Castle
b2d93e8a84
Enhance sizes documentation for next/image (#39301)
This PR updates the documentation for the `sizes` proper in next/image to make it more clear what this prop does and why it's (very) important to use it. After feedback, I'll update this PR to also modify the future image component docs.


Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-08-09 19:30:49 +00:00
fediev
d3bbfea117
Improve description of context.query in getServerSideProps() (#39422)
Improve description of `query`

`query` is not just representing of the query string. It has the same values as `router.query`.
2022-08-09 10:23:54 -05:00
Lee Robinson
5d93753bc3
API Routes Request Helpers docs. (#39407)
Renames Middleware to Request Helpers to be both more accurate and also less confusing since Middleware is a separate feature of Next.js now.
2022-08-09 02:02:14 +00:00
Sanjaiyan Parthipan
1cc6e47abe
Update script.md (#39400)
Adding `strategy="lazyOnload"` for prevent minor confusion.

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-08-08 18:03:23 +00:00
sumiren
9f8713fae4
docs: update When section of getStaticProps page (#39393)
getStaticProps will be called in conjection with fallback.

it's written in following page, but not in concerned page.
https://nextjs.org/docs/basic-features/data-fetching/get-static-paths
2022-08-08 10:20:12 -05:00
Lucas Rosa
a5029e9fd4
Allow custom path for preview mode cookies (#38313)
* Allow custom path for preview mode cookies

* update params order and tests

* update tests

* fix tests and update docs

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-08-07 20:45:30 -05:00
Cupid Valentine
6b49d4744c
docs: add missing dot (#39314)
Co-authored-by: spcma <46758907+spcma@users.noreply.github.com>



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

- [x] Make sure the linting passes by running `pnpm lint`
- [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-04 02:38:03 +00:00
Alex Castle
2f49a4f930
Remove default setting for object-fit on future fill images (#39297)
This PR removes the default styling of `object-fit:"contain"` for images using the future image component. This means images will get the default `object-fit` behavior of `"fill"`.

The main reason for this change is that an inline style will take precedence over external CSS, making this default behavior difficult to override with some styling strategies.


Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2022-08-03 19:22:27 +00:00
hiro
498d1e939a
fix typo: docs/advanced-features/react-18/streaming.md (#39293)
fix typo document.
2022-08-03 18:18:25 +00:00
Josh Parnham
a1895424c5
[docs] Clarify polyfill support (#39272)
Currently next.js polyfills a [subset](https://github.com/vercel/next.js/blob/canary/packages/next-polyfill-nomodule/src/index.js) of APIs for `nomodule` browsers (such as IE 11), however it's not immediately clear to developers which APIs are transparently polyfilled.

For example, currently `Object.entries` is polyfilled and thus is usable in IE 11, but [it was decided](https://github.com/vercel/next.js/pull/15772#discussion_r463984612) that `Object.fromEntries` should not be polyfilled. As a developer, this is a confusing situation until you end up finding the `next-polyfill-nomodule` list of polyfills that are included.

This PR attempts to improve the Supported Browser Features page by:
- linking to the list of polyfills
- clarifying that custom polyfills are required for IE11 (and other old browser) compatibility
- moving the section on Sever-Side polyfills further down the page so all browser polyfill sections are better grouped together

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm lint`
- [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-03 16:26:52 +00:00
Steven
213c42f446
Add section about migrating from next/image to next/future/image (#39270)
This expands on the previous PR #38978 with a section on migrating
2022-08-02 23:23:10 +00:00
Matt DuLeone
0e5a0ec4e0
Clear up rewrites documentation (#39238)
## Documentation / Examples

This PR specifically calls out in more clear language how the rewrites function behaves. This tripped me up recently as I recently came looking for more information, and the documentation left me with more questions than answers. This is an attempt to clear up the confusion I walked away with for anyone who comes in after me.

- [x] Make sure the linting passes by running `pnpm lint`
- [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-02 02:18:21 +00:00
Alex Castle
cbaaaeb076
Add "fill" mode to next/future/image (#38855)
This PR adds a `fill` attribute to the future image component, that behave similarly to the fill mode on the existing image component.

Functionally, it mainly adds `position: "absolute"` and `object-fit: "contain"` to the image element, along with `height: "100%"` and `width: "100%"` to preserve the image aspect ratio. All of these can be overwritten by the user, except for `position: "absolute"`, which will throw an error. This is because changing that property without height and width is likely to cause layout shift.

Because we no longer have the wrapper element, this new version of `fill` requires that the user set `overflow: "hidden"` on the parent element themself, if they want that behavior.

This PR also includes several runtime checks to catch instances where the fill mode may provide unexpected results. These runtime checks warn if:
* The image doesn't have the `sizes` attribute and loads much smaller than the viewport
* The containing element does not have `position: "relative"`
* The image height value is 0

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2022-08-01 18:21:36 +00:00
NikhilNama18
f0df2c274d
Replaces getStaticProps with getStaticPaths (#39218)
In `Generating paths on-demand` section 
It was mentioned that `getStaticProps` allows you to control which pages are generated during the build. 
But `getStaticPaths` will allows us to control which pages are generated during the build.



## 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 by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-01 12:48:06 +00:00
Santi Dalmasso
de6fc1cf35
fix: Update testing.md (#39195)
Update `e2e/example.spec.ts` ([/docs/testing](https://nextjs.org/docs/testing#creating-your-first-playwright-end-to-end-test) page) to fix the failed test. Fixes: #39194
## 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
- [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

- [ ] Make sure the linting passes by running pnpm lint
- [ ]  The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md?rgh-link-date=2022-07-13T09%3A09%3A13Z#adding-examples)
2022-07-31 15:30:38 +00:00
JJ Kasper
cf729edc9d
Add caveat note about shallow routing with middleware (#39154) 2022-07-28 21:28:34 -05:00
Houssein Djirdeh
a8186065b8
[Script] Adds onReady prop to next/script (#38849)
Closes: #30962

This PR adds a new `onReady` prop to `next/script` to handle shortcomings of the current `onLoad` prop. Some third-party providers and widgets require initialization code to run after the script's `load` event and every time the component is mounted. The `onReady` should solve that use case.

For more details, refer to the discussion in #30962.

CC @janicklas-ralph

## Bug

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


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-07-28 20:42:52 +00:00
Lee Robinson
c3fd9e4eec
Add note to next/future/image about default styles. (#38978) 2022-07-25 02:53:39 +00:00
Didi Keke
413d35b75e
docs: update typescript.md (#38717)
"You [SHOULD NOT](https://datatracker.ietf.org/doc/html/rfc2119#section-4) remove ~n~or edit it" in place of "You cannot remove it or edit it".
Rational:
- It is a strong recommendation; not a weak possibility.
- ~Both actions have a negative connotation; as such, it is appropriate to use "nor"~.



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

- [x] Make sure the linting passes by running `pnpm lint`
- [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)


Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2022-07-25 01:39:46 +00:00
Michael Carr
8365bf62df
Docs: Fix grammatical typo (#38962)
Fixes grammatical typo found on line 73 of `docs/basic-features/data-fetching/get-static-paths`



## 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 by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-07-24 03:12:10 +00:00
Lee Robinson
8b721227cf
Add section about building getStaticPaths on-demand. (#38943)
Based on feedback from here: https://twitter.com/leeerob/status/1550617876188520452

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-07-23 05:16:16 +00:00
Michael Squitieri
98f4bdd12d
Remove next-page-tester from testing.md (#38920)
Next Page Tester has officially been deprecated.
2022-07-22 10:22:24 -05:00
Jiachi Liu
f086283e38
Remove the next/streaming endpoint and experimental refresh api (#38837)
Drop the `next/streaming` endpoint. Currently it only holds the only one experimental api and we'd like to deprecate it in favor of oher future APIs for app dir
2022-07-20 22:41:48 +00:00
Balázs Orbán
9416e00bb1
docs: improve wording on pathname and asPath (#38835)
* Update router.md

* Update router.md
2022-07-20 10:30:06 -05:00
Houssein Djirdeh
81c3cd682b
[ESLint] Make src/ a default linting directory (#38810)
Fixes #38533 by including `src/` as a default linting directory where all files within are linted

## Bug

- [X] Related issues linked using `fixes #number`
- [X] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
2022-07-19 20:58:13 +00:00
Isaac Martin
b9791bf999
update fallback docs (#38659)
* update fallback docs

* minor update

* Apply suggestions from code review

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-07-18 13:19:29 -05:00
Dorian
7280c3ced1
Update get-static-props.md (#38703)
Update the file name in the import statement in the "write server-side code directly" section in the documentation
2022-07-16 04:05:33 +00:00
You Nguyen
bbbbe20c99
Add bundlejs site (#38677)
Add [bundlejs](https://bundlejs.com/) site - an online tool to quickly bundle & minify your projects, while viewing the compressed gzip/brotli bundle size, all running locally on your browser.

The lowercase name is intentional.
2022-07-15 16:06:54 +00:00
Lee Robinson
b1bb3d94c6
Add documentation on accessibility. (#38522)
This PR outlines the built-in features of Next.js that help make your application accessible, and will also include some resources for testing/improving accessibility in your app.

Related: https://github.com/vercel/next.js/pull/20428
2022-07-14 13:05:39 +00:00
Balázs Orbán
b0d64d647a
docs: clarify that matcher needs to be constant values (#38597)
Ref: #38461, #37346

As [introduced](https://github.com/vercel/next.js/pull/37177/files#diff-7ec7f47987bd890b5b47f6cf101398cd22fa37f874348d70036f85309a040c92
) in #37177, we statically analyze the `matcher` values, so we should make it clear.


## 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 by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-07-13 14:36:10 +00:00
Myeonghwan Cho
9664c8d054
Add missing closing curly bracket in compiler option example (#38586)
This PR adds a missing closing curly bracket in the compiler option example of the [Styled Components](https://nextjs.org/docs/advanced-features/compiler#styled-components).

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

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-07-13 14:16:00 +00:00
Steven
11825da7ed
Update docs for next/future/image with browser support (#38563)
* Update docs for `next/future/image` with browser support

* Mention blur constraints
2022-07-12 13:25:11 -05:00
Steven Tey
38a0276d28
[DOCS]: Middleware doesn't execute for on-demand ISR (#38562)
Updated docs to reflect that



## 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 by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)


Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2022-07-12 17:06:43 +00:00
Daniel Cavanagh
3075c3ff71
Note about manually passing props from custom app (#37329)
I've wasted a couple of hours trying to work out why my static build wasn't passing through the props automatically as the docs say it should

Turns out it's the default app doing that and a custom app has to manually passed the props through

It wasn't obvious to me to look in the custom app doc where it's mentioned, so I've added a small note to the `getStaticProps` doc about this that points to the custom app doc

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-07-11 22:26:12 +00:00
JJ Kasper
1c1fbeb4de
Add note about standalone + runtimeConfig caveat (#38532)
## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)

x-ref: https://github.com/vercel/next.js/issues/38119
2022-07-11 21:51:26 +00:00
Cupid Valentine
7e47b861d5
Update api-middlewares.md (#38499)
## 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

- [x] Make sure the linting passes by running `pnpm lint`
- [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-07-11 11:18:56 +00:00
Houssein Djirdeh
5155a88ab0
[Docs] Adds mention of INP to "Measuring Performance" page (#38464)
* adds mention of inp to measuring performance docs

* lint-fix

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-07-08 15:00:01 -05:00
Lee Robinson
979da91369
Update i18n routing example with Middleware. (#38419)
https://github.com/vercel/next.js/discussions/18419#discussioncomment-3092971

Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
2022-07-08 09:39:44 +00:00
mongolyy
ca0f1da92d
Update building-form sample code (#38437)
I found discrepancy between sample code and description.

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm lint`
- [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-07-08 03:18:59 +00:00