Skip to content

Commit f15a3f4

Browse files
devjiwonchoihuozhi
andauthored
chore(next-codemod): move app-dir-runtime-config-experimental-edge to 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 <[email protected]>
1 parent 61f5b95 commit f15a3f4

File tree

2 files changed

+32
-30
lines changed

2 files changed

+32
-30
lines changed

docs/02-app/01-building-your-application/11-upgrading/01-codemods.mdx

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,6 @@ Replacing `<transform>` and `<path>` with appropriate values.
2626

2727
### 15.0
2828

29-
#### Transform App Router Route Segment Config `runtime` value from `experimental-edge` to `edge`
30-
31-
##### `app-dir-runtime-config-experimental-edge`
32-
33-
> **Note**: This codemod is App Router specific.
34-
35-
```bash filename="Terminal"
36-
npx @next/codemod@latest app-dir-runtime-config-experimental-edge .
37-
```
38-
39-
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`.
40-
41-
For example:
42-
43-
```ts
44-
export const runtime = 'experimental-edge'
45-
```
46-
47-
Transforms into:
48-
49-
```ts
50-
export const runtime = 'edge'
51-
```
52-
5329
#### Migrate to async Dynamic APIs
5430

5531
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).
@@ -311,6 +287,32 @@ Transforms into:
311287
import { Inter } from 'next/font/google'
312288
```
313289

290+
### 13.1.2
291+
292+
#### Transform App Router Route Segment Config `runtime` value from `experimental-edge` to `edge`
293+
294+
##### `app-dir-runtime-config-experimental-edge`
295+
296+
> **Note**: This codemod is App Router specific.
297+
298+
```bash filename="Terminal"
299+
npx @next/codemod@latest app-dir-runtime-config-experimental-edge .
300+
```
301+
302+
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`.
303+
304+
For example:
305+
306+
```ts
307+
export const runtime = 'experimental-edge'
308+
```
309+
310+
Transforms into:
311+
312+
```ts
313+
export const runtime = 'edge'
314+
```
315+
314316
### 13.0
315317

316318
#### Rename Next Image Imports

packages/next-codemod/lib/utils.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ export const TRANSFORMER_INQUIRER_CHOICES = [
8282
value: 'next-image-to-legacy-image',
8383
version: '13.0',
8484
},
85+
{
86+
title:
87+
'Transform App Router Route Segment Config `runtime` value from `experimental-edge` to `edge`',
88+
value: 'app-dir-runtime-config-experimental-edge',
89+
version: '13.1.2',
90+
},
8591
{
8692
title: 'Uninstall `@next/font` and transform imports to `next/font`',
8793
value: 'built-in-next-font',
@@ -116,10 +122,4 @@ export const TRANSFORMER_INQUIRER_CHOICES = [
116122
value: 'next-async-request-api',
117123
version: '15.0.0-canary.171',
118124
},
119-
{
120-
title:
121-
'Transform App Router Route Segment Config `runtime` value from `experimental-edge` to `edge`',
122-
value: 'app-dir-runtime-config-experimental-edge',
123-
version: '15.0.0-canary.179',
124-
},
125125
]

0 commit comments

Comments
 (0)