Skip to content

Commit

Permalink
Improve next/future/image Migration docs (#39421)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
MaedahBatool and styfle committed Aug 10, 2022
1 parent 44eea0c commit bd61406
Showing 1 changed file with 9 additions and 41 deletions.
50 changes: 9 additions & 41 deletions docs/api-reference/next/future/image.md
Expand Up @@ -43,19 +43,9 @@ Compared to `next/image`, the new `next/future/image` component has the followin

## Migration

Although `layout` is not available, you can migrate `next/image` to `next/future/image` using a few props. The following is a comparison of the two components:
Although `layout` is not available, you can migrate `next/image` to `next/future/image` using a few props. The following code snippets compare the two components:

<table>
<thead>
<tr>
<th>next/image</th>
<th>next/future/image</th>
</tr>
</thead>
<tbody>

<tr>
<td>
#### before: `next/image`

```jsx
import Image from 'next/image'
Expand All @@ -66,8 +56,7 @@ function Page() {
}
```

</td>
<td>
#### after: `next/future/image`

```jsx
import Image from 'next/future/image'
Expand All @@ -79,11 +68,7 @@ function Page() {
}
```

</td>
</tr>

<tr>
<td>
#### before: `next/image`

```jsx
import Image from 'next/image'
Expand All @@ -94,8 +79,7 @@ function Page() {
}
```

</td>
<td>
#### after: `next/future/image`

```jsx
import Image from 'next/future/image'
Expand All @@ -107,11 +91,7 @@ function Page() {
}
```

</td>
</tr>

<tr>
<td>
#### before: `next/image`

```jsx
import Image from 'next/image'
Expand All @@ -122,8 +102,7 @@ function Page() {
}
```

</td>
<td>
#### after: `next/future/image`

```jsx
import Image from 'next/future/image'
Expand All @@ -134,11 +113,7 @@ function Page() {
}
```

</td>
</tr>

<tr>
<td>
#### before: `next/image`

```jsx
import Image from 'next/image'
Expand All @@ -149,8 +124,7 @@ function Page() {
}
```

</td>
<td>
#### after: `next/future/image`

```jsx
import Image from 'next/future/image'
Expand All @@ -161,12 +135,6 @@ function Page() {
}
```

</td>
</tr>

</tbody>
</table>

You can also use `className` instead of `style`.

## Required Props
Expand Down

0 comments on commit bd61406

Please sign in to comment.