Commit graph

419 commits

Author SHA1 Message Date
Michał Niedziółka
3e8c6f45be
Add missing quote in next/script example (#43196)
It looks like a simple typo.
2022-11-21 19:47:49 +00:00
Lee Robinson
1fd00899c7
Remove unneeded async in docs. (#43161)
https://github.com/vercel/feedback/issues/23545
2022-11-21 03:45:15 +00:00
JJ Kasper
1fa7114a01
Add note in next/link docs about anchor props (#43064)
This ensures we document with the new default `next/link` behavior that
`anchor` properties can be passed as well.

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-11-18 09:48:10 -08:00
Ismael
29f20d30fd
font api updates (#42724)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
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:
-->

Update the next fonts API reference to match the latest changes from
[beta.nextjs.org](https://beta.nextjs.org/docs/api-reference/components/font)

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-11-10 12:11:04 -06:00
Bobby Lee
fcfe914b62
fix typo in api-reference next/sever (#42669)
fix typo ResponseCooies to ResponseCookies
2022-11-09 05:13:49 +00:00
Max Leiter
2e3e56d911
docs/next/link: Mention middleware + dynamic routes changes (#42607)
Documents the next 13 changes requiring `as` and `href` using `next/link` with Dynamic Routes.

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-11-08 00:45:01 +00:00
Lucas Rosa
e480b1d809
Fix Docs API Reference font.md broken link (#42418)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-11-03 10:51:27 -07:00
Alexander Kadyrov
6bb8407bbf
Fix typo in usage of onError in script.md (#42368)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-11-02 18:09:16 +00:00
Aleksa
9f97833b7e
Fix typo: docs/api-reference/next/font.md (#42344)
change typo 'Optmization' to 'Optimization'
2022-11-02 16:09:49 +00:00
Ismael
468f2c48b1
update font optimization page (#42266)
Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2022-11-02 15:25:45 +01:00
JJ Kasper
b7ea0a5abe
Add prompt for ESLint to CNA (#42218)
Following up https://github.com/vercel/next.js/pull/42012 this adds an
additional prompt for include ESLint config/dependencies or not. As
discussed, this also removes the slow down from doing separate
`dependencies` and `devDependencies` installs since this separation is
no longer required now that we have `output: 'standalone'` which ensures
only actual necessary dependency files are used for production builds.

<details>

<summary>Before</summary>


https://user-images.githubusercontent.com/22380829/198953290-116b422d-4359-4aa9-9d82-b3265fde7b3f.mp4


</details>

<details>

<summary>After</summary>




https://user-images.githubusercontent.com/22380829/198953347-20dbf897-92b3-45ea-a9d2-cfb61622251d.mp4



</details>

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-31 08:51:50 -07:00
C. Lewis
389c77f205
feat(create-next-app): JS/TS prompt (with appDir support); enhanced testing (#42012)
Resubmitting this PR following this comment from Tim. This work has been done already and we can build off of it to get this in faster. 

> Just to be clear we're planning to rework create-next-app to give you the option to choose between JavaScript or TypeScript so it'll solve this request. For `app` right now it'll stay TypeScript till that is implemented.
> 
> _Originally posted by @timneutkens in https://github.com/vercel/next.js/discussions/41745#discussioncomment-3985833_

---

I added the `--ts, --typescript` flag to `create-next-app` in https://github.com/vercel/next.js/pull/24655, and since then I have seen it used very frequently, including in recent issues (such as https://github.com/vercel/next.js/issues/33314) and most Next.js tutorials on YouTube. I noticed the template logic added in this PR was also used to add the `appDir` configuration as well.

We discussed a while ago adding the following user flow:

- `create-next-app --js, --javascript` creates a JS project
- `create-next-app --ts, --typescript` creates a TS project
- `create-next-app [name]` (no `--js, --ts`) prompts the user to choose either JS or TS, with TS selected by default.

### Review

Adding support for appDir and refactoring the templates brought the pain-of-review up a bit, but it's not so bad when broken into increments.

The original 8-file diff is here:
1f47d9b0bf

And the PR that brought the diff up to 59 files (mostly owed to `app` template dirs and file structure refactors):
bd3ae4afd3 ([PR link](https://github.com/ctjlewis/next.js/pull/3/files))

### Demo

https://user-images.githubusercontent.com/1657236/198586216-4691ff4c-48d4-4c6c-b7c1-705c38dd0194.mov


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-10-31 05:43:39 +00:00
Jim Cresswell
7ef653c794
docs: clarify env inclusion in bundles (#41950)
Clarify that all next.config.js envs are included in the client-side bundle.

I recently came across an issue where the instructions for specifying environment variables in the next.config.js file and the instructions for specifying them in `.env` files were conflated, and a value was included in the client-side bundle that was not supposed to be there.

## 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/examples/adding-examples.md)
2022-10-28 23:12:06 +00:00
Lorenzo Bloedow
3275eb885e
Fix typo. (#42067) 2022-10-28 10:31:55 -07:00
Steven
9fe18e8844
Add link from next/image docs to example (#42020)
Add link from `next/image` docs to example
2022-10-27 16:53:49 -07:00
Steven Tey
bbe7fddf39
Fix broken link in @next/font docs (#42002)
As per https://twitter.com/pbshgthm/status/1585728924499480576

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a 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/examples/adding-examples.md)
2022-10-27 14:02:27 -07:00
Balázs Orbán
4d20beb7c5
BREAKING CHANGE: feat(edge): split NextCookies to RequestCookies and ResponseCookies (#41526)
Ref: [Slack
thread](https://vercel.slack.com/archives/C035J346QQL/p1666056382299069?thread_ts=1666041444.633059&cid=C035J346QQL),
[docs update](https://github.com/vercel/front/pull/17090)

Spec: https://wicg.github.io/cookie-store/

BREAKING CHANGE:

Ref: https://github.com/vercel/edge-runtime/pull/177,
https://github.com/vercel/edge-runtime/pull/181

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a 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/examples/adding-examples.md)
2022-10-27 00:20:39 -07:00
JJ Kasper
0ab2bed7a3
Fix more incorrect markdown langs (#41939)
## 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/examples/adding-examples.md)

x-ref: https://github.com/vercel/next.js/pull/41926
2022-10-26 22:48:35 -07:00
Lee Robinson
a05a0c7784
Update the documentation. (#41758)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Matt Kane <m@mk.gg>
Co-authored-by: Ismael <ismael.rumzan@gmail.com>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-10-26 14:04:45 -07:00
Steven
7102050ec7
Add support for images.loaderFile config (#41585)
This PR adds a new configure property, `images.loaderFile` that allow
you to define a path to a file with an exported image loader function.

This is useful when migrating from `next/legacy/image` to `next/image`
because it lets you configure the loader for every instance of
`next/image` once, similar to the legacy "built-in loaders".
2022-10-21 12:31:53 -07:00
Steven
6d088205b3
Fix docs typo in next/image sizes using fill prop (#41560)
Fix typo mentioned in
https://github.com/vercel/next.js/pull/41434#issuecomment-1283855509
2022-10-19 09:53:03 -04:00
Steven
17773a1cf3
Fix links to next/legacy/image demo (#41539)
This PR fixes links to `next/legacy/image` (demo, deploy, etc)
2022-10-18 16:09:43 -07:00
Anish Paudel
1e47930d5f
[docs] fix grammatical error #41507 (#41508)
Closes: https://github.com/vercel/next.js/issues/41507
2022-10-18 06:47:34 +00:00
Tim Neutkens
f260328900
BREAKING CHANGE: Enable newNextLinkBehavior (#41459)
- Enable newNextLinkBehavior. See #36436 
- Run next/link codemod on test suite

Note that from when this lands on apps trying canary will need to run
the new-link codemod in order to upgrade.
Ideally we have to detect `<a>` while rendering the new link and warn
for it.

Co-authored-by: Steven <steven@ceriously.com>
2022-10-17 21:20:28 -04:00
Steven
e2f16f96c2
Update next/image docs and examples (#41434)
This PR updates the docs for the following code change:

- #41399

There are a few updates here:

- [x] Update docs
- [x] Update links to docs inside component
- [x] Update examples
- [x] Fix corner cases in codemod
2022-10-17 10:41:35 -04:00
Balázs Orbán
46bdef8137
docs: clarify redirects on client-side navigation (#41362)
Ref: #41344

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a 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/examples/adding-examples.md)
2022-10-12 22:37:56 +00:00
Alex
87026c893b
Update introduction.md (#41226)
Fixed link to phases lines in the documentation



## 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/examples/adding-examples.md)


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-10-06 19:51:05 +00:00
Paulo Augusto Silva
54d70a0f53
Docs: Fix misleading console.log output example (#41096)
The docs have a misleading `console.log` output for the input
`process.env` that doesn't display all the variables on edge runtime.
The example shows an output of a supposed object with all the
environment variables, but it does this when logging a specific
variable.

## 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/examples/adding-examples.md)
2022-10-01 17:58:46 -07:00
sic!kh
c988b99c85
(Docs) getStaticProps & getServerSideProps TS section (#40607) (#40639)
Added examples to `getStaticProps` & `getServerSideProps` explicit and implicit typings for TypeScript.

Related issues: fixes https://github.com/vercel/next.js/issues/40607

Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
2022-10-01 04:20:57 +00:00
Lee Robinson
4f793fd7fa
[docs] Improve documentation around pageExtensions (#40039)
Reverts vercel/next.js#40016.

`pageExtensions` is not frequently used – as is mostly a workaround
until the Layouts RFC lands. Thus, it doesn't make sense to place a note
on the Middleware page and expect readers to need to connect the dots
and understand `pageExtensions`.

Further, the example docs linked could be more specific about Middleware
to prevent this confusion. I will also make that change here.

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-09-30 18:19:32 +02:00
JJ Kasper
8bf6a87303
Rename allowDynamic to unstable_allowDynamic (#40496)
Follow-up to https://github.com/vercel/next.js/pull/39539 as discussed
this renames to `unstable_` prefix initially while we test this out
further.

## 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-09-12 15:32:18 -07:00
Damien Simonin Feugas
97ac344468
feat(edge): allows configuring Dynamic code execution guard (#39539)
### 📖  What's in there?

Dynamic code evaluation (`eval()`, `new Function()`, ...) is not
supported on the edge runtime, hence why we fail the build when
detecting such statement in the middleware or `experimental-edge` routes
at build time.

However, there could be false positives, which static analysis and
tree-shaking can not exclude:
- `qs` through these dependencies (get-intrinsic:
[source](https://github.com/ljharb/get-intrinsic/blob/main/index.js#L12))
- `function-bind`
([source](https://github.com/Raynos/function-bind/blob/master/implementation.js#L42))
- `has`
([source](https://github.com/tarruda/has/blob/master/src/index.js#L5))

This PR leverages the existing `config` export to let user allow some of
their files.
it’s meant for allowing users to import 3rd party modules who embed
dynamic code evaluation, but do not use it (because or code paths), and
can't be tree-shaked.

By default, it’s keeping the existing behavior: warn in dev, fails to
build.
If users allow dynamic code, and that code is reached at runtime, their
app stills breaks.

### 🧪 How to test?

- (existing) integration tests for disallowing dynamic code evaluation:
`pnpm testheadless --testPathPattern=runtime-dynamic`
- (new) integration tests for allowing dynamic code evaluation: `pnpm
testheadless --testPathPattern=runtime-configurable`
- (amended) production tests for validating the new configuration keys:
`pnpm testheadless --testPathPattern=config-validations`

To try it live, you could have an application such as:
```js
// lib/index.js
/* eslint-disable no-eval */
export function hasUnusedDynamic() {
  if ((() => false)()) {
    eval('100')
  }
}

export function hasDynamic() {
  eval('100')
}

// pages/index.jsx
export default function Page({ edgeRoute }) {
  return <p>{edgeRoute}</p>
}

export const getServerSideProps = async (req) => {
  const res = await fetch(`http://localhost:3000/api/route`)
  const data = await res.json()
  return { props: { edgeRoute: data.ok ? `Hi from the edge route` : '' } }
}

// pages/api/route.js
import { hasDynamic } from '../../lib'

export default async function handle() {
  hasDynamic()
  return Response.json({ ok: true })
}

export const config = { 
  runtime: 'experimental-edge' ,
  allowDynamic: '/lib/**'
}
```

Playing with `config.allowDynamic`, you should be able to:
- build the app even if it uses `eval()` (it will obviously fail at
runtime)
- build the app that _imports but does not use_ `eval()`
- run the app in dev, even if it uses `eval()` with no warning

### 🆙 Notes to reviewers

Before adding documentation and telemetry, I'd like to collect comments
on a couple of points:
- the overall design for this feature: is a list of globs useful and
easy enough?
- should the globs be relative to the application root (current
implementation) to to the edge route/middleware file?
- (especially to @sokra) is the implementation idiomatic enough? I've
leverage loaders to read the _entry point_ configuration once, then the
ModuleGraph to get it back during the parsing phase. I couldn't re-use
the existing `getExtractMetadata()` facility since it's happening late
after the parsing.
- there's a glitch with `import { ServerRuntime } from '../../types'` in
`get-page-static-info.ts`
([here](https://github.com/vercel/next.js/pull/39539/files#diff-cb7ac6392c3dd707c5edab159c3144ec114eafea92dad5d98f4eedfc612174d2L12)).
I had to use `next/types` because it was failing during lint. Any clue
why?

### ☑️ Checklist

- [ ] 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
- [x] Telemetry added. In case of a feature if it's used or not.
- [x] Errors have helpful link attached, see `contributing.md`
2022-09-12 15:01:00 -07:00
Balázs Orbán
3851d9065f
docs(middleware): fix broken link 2022-09-12 13:13:09 +02:00
Carl von Buelow
75e5616ce4
Update onLoadingComplete for next/future/image to receive reference to <img> (#40326)
* fixes #18398
* fixes #38864

Co-authored-by: Steven <steven@ceriously.com>
2022-09-08 08:37:41 -07:00
Steven
712d98d3d7
Update docs for remotePatterns image config (#40350)
This updates the docs to favor `remotePatterns` image config (instead of `domains`)
2022-09-08 11:19:55 -04:00
Alex Castle
6cc8dc38df
Change sizes docs to use max-width in media query (#40290)
This PR updates the next/image and `next/future/image` sizes docs to use `max-width` in the `sizes` media query, for code style and consistency reasons.
2022-09-06 23:36:16 +00:00
Alex Castle
815abc5e05
Change image sizes docs to use em instead of px (#40288)
This PR is a minor change to the image docs (`next/image` and `next/future/image`). The example sizes media queries are switched from `em` to `px` for readability.
2022-09-06 22:28:34 +00:00
sumiren
5c2faad36e
docs: update get-static-paths.md (#40205)
I found that `fallback: true` behaves like `fallback: blocking` when client-side page transition, but document doesn't mention the behavior.
I tried following.

* created a SSG page which has getStaticPaths and getStaticProps, and the getStaticProps is too slow(something like `await setTimeout(10000)`)
* `next build && next start`, not `next dev`
* tried page reload and client-side page transition both

getServerSideProps document explains about client-side page transition.
https://nextjs.org/docs/basic-features/data-fetching/get-server-side-props#when-does-getserversideprops-run

On the other hand, getStaticPaths didn't explain this behavior, so I added it.



## 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-09-06 16:16:49 +00:00
Steven
4cc7f11da2
Update to stable: next/future/image, remotePatterns, unoptimized (#40142)
This PR updates a few features from experimental to stable status:

- `next/future/image` component
- `remotePatterns` configuration
- `unoptimized` configuration
2022-08-31 22:44:17 +00:00
Steven
abddee7413
Change alt to required in next/future/image (#40136)
This `alt` attribute is required by `<img>` according to the HTML spec, so we should also make it required for `next/future/image`. In the cases where it is not needed, it can be set to the empty string.

https://html.spec.whatwg.org/multipage/images.html#alt
2022-08-31 19:10:19 +00:00
Dueen Eduarda
b760c8dd0a
docs(image): Use hook inside of function component (#40096)
The example broke the [Rules of Hooks](https://reactjs.org/warnings/invalid-hook-call-warning.html#:~:text=Hooks%20can%20only%20be%20called%20inside%20the%20body%20of%20a%20function%20component.) by calling the hook outside of the function component.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-08-30 10:22:55 -05:00
Adil Amanat
e5997dce72
Update image.md (#39984)
Update the cache behavior with the correct Header name. Updated header name from `x-nextjs-cache` to `x-vercel-cache`

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-08-26 15:26:47 -05:00
Lee Robinson
d267c300fa
[docs] Update UTM params of some links (#39951)
Noticed a few outdated links, plus some that have since had redirects added, so took this opportunity to make the UTM params consistent 👍
2022-08-25 21:15:37 +00:00
Mosaad
9a7a8acc64
fix hash-link (#39929) 2022-08-25 15:42:45 +00:00
Steven
7e9f9bfbef
Fix onError handling in next/future/image (#39824)
This PR fixes a race condition where the `onError` handler was never called because the error happened before react attached the error handler.
2022-08-22 21:37:16 +00:00
Steven
b6bbbc813f
Update docs next/future/image with details about computed aspect ratio (#39829)
The browser support for this feature was added to caniuse so we can link there instead of linking to each browser bug tracker.
2022-08-22 17:31:57 +00:00
Adrian Bienias
8f023992a2
Update links to point to more accurate docs (#39818)
Initial links were pointing to basic features which don't describe redirections.
2022-08-22 14:01:14 +00:00
Maedah Batool
e307096e2f
Add clarity in docs for using exportPathMap with getStaticPaths (#39813)
This PR adds a warning note for using the exportPathMap function with getStaticPaths. Any routes defined with EPM will get overridden if that page uses GSP.
Bug

 Related issues linked using #534
 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
2022-08-22 08:50:56 -05: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