Skip to content

Commit

Permalink
chore(next-codemod): move app-dir-runtime-config-experimental-edge to…
Browse files Browse the repository at this point in the history
… 13.1.2 (#71081)

### Why?

Although the breaking change for `export runtime = 'experimental-edge'`
for App Router was recent at
#70480, we did move from
experimental to `edge` at #44045,
and added log at #44563 (release
[v13.1.2](https://github.com/vercel/next.js/releases/tag/v13.1.2))

Therefore we lower the target codemod version to 13.1.2.

---------

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
  • Loading branch information
2 people authored and eps1lon committed Oct 11, 2024
1 parent efa2719 commit f2ba4c0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,6 @@ Replacing `<transform>` and `<path>` with appropriate values.

### 15.0

#### Transform App Router Route Segment Config `runtime` value from `experimental-edge` to `edge`

##### `app-dir-runtime-config-experimental-edge`

> **Note**: This codemod is App Router specific.
```bash filename="Terminal"
npx @next/codemod@latest app-dir-runtime-config-experimental-edge .
```

This codemod transforms [Route Segment Config `runtime`](https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#runtime) value `experimental-edge` to `edge`.

For example:

```ts
export const runtime = 'experimental-edge'
```

Transforms into:

```ts
export const runtime = 'edge'
```

#### Migrate to async Dynamic APIs

APIs that opted into dynamic rendering that previously supported synchronous access are now asynchronous. You can read more about this breaking change in the [upgrade guide](/docs/app/building-your-application/upgrading/version-15).
Expand Down Expand Up @@ -311,6 +287,32 @@ Transforms into:
import { Inter } from 'next/font/google'
```

### 13.1.2

#### Transform App Router Route Segment Config `runtime` value from `experimental-edge` to `edge`

##### `app-dir-runtime-config-experimental-edge`

> **Note**: This codemod is App Router specific.
```bash filename="Terminal"
npx @next/codemod@latest app-dir-runtime-config-experimental-edge .
```

This codemod transforms [Route Segment Config `runtime`](https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#runtime) value `experimental-edge` to `edge`.

For example:

```ts
export const runtime = 'experimental-edge'
```

Transforms into:

```ts
export const runtime = 'edge'
```

### 13.0

#### Rename Next Image Imports
Expand Down
12 changes: 6 additions & 6 deletions packages/next-codemod/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ export const TRANSFORMER_INQUIRER_CHOICES = [
value: 'next-image-to-legacy-image',
version: '13.0',
},
{
title:
'Transform App Router Route Segment Config `runtime` value from `experimental-edge` to `edge`',
value: 'app-dir-runtime-config-experimental-edge',
version: '13.1.2',
},
{
title: 'Uninstall `@next/font` and transform imports to `next/font`',
value: 'built-in-next-font',
Expand Down Expand Up @@ -116,10 +122,4 @@ export const TRANSFORMER_INQUIRER_CHOICES = [
value: 'next-async-request-api',
version: '15.0.0-canary.171',
},
{
title:
'Transform App Router Route Segment Config `runtime` value from `experimental-edge` to `edge`',
value: 'app-dir-runtime-config-experimental-edge',
version: '15.0.0-canary.179',
},
]

0 comments on commit f2ba4c0

Please sign in to comment.