Skip to content

Commit c27aefd

Browse files
unstubbablestipsan
authored andcommitted
Delete obsolete codemod next-dynamic-access-named-export (vercel#72016)
1 parent 2052e07 commit c27aefd

23 files changed

+5
-254
lines changed

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

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -189,46 +189,6 @@ export function GET(req: NextRequest) {
189189
}
190190
```
191191

192-
#### Transform `next/dynamic` imports accessing named exports to return an object with a `default` property
193-
194-
##### `next-dynamic-access-named-export`
195-
196-
```bash filename="Terminal"
197-
npx @next/codemod@latest next-dynamic-access-named-export .
198-
```
199-
200-
This codemod transforms dynamic imports using `next/dynamic` to ensure they return an object with a `default` property when accessing named exports. This aligns the behavior with `React.lazy` and addresses issues with accessing named exports from client components in server components.
201-
202-
For example:
203-
204-
```js
205-
import dynamic from 'next/dynamic'
206-
207-
const ComponentA = dynamic(() =>
208-
import('../components/a').then((mod) => mod.default)
209-
)
210-
211-
const ComponentB = dynamic(() =>
212-
import('../components/b').then((mod) => mod.ComponentB)
213-
)
214-
```
215-
216-
Transforms into:
217-
218-
```js
219-
import dynamic from 'next/dynamic'
220-
221-
const ComponentA = dynamic(() =>
222-
import('../components/a').then((mod) => ({ default: mod.default }))
223-
)
224-
225-
const ComponentB = dynamic(() =>
226-
import('../components/b').then((mod) => ({ default: mod.ComponentB }))
227-
)
228-
```
229-
230-
> **Good to know**: This codemod only affects dynamic imports using `next/dynamic` and access named exports.
231-
232192
### 14.0
233193

234194
#### Migrate `ImageResponse` imports
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
suggests `next-dynamic-access-named-export` transform
1+
Prompts for React 19 upgrade with a recommendation to do so
2+
Suggests adding `--turbopack` to `next dev` script
3+
Suggests `app-dir-runtime-config-experimental-edge` transform
4+
Suggests `next-async-request-api` transform
5+
Suggests `next-request-geo-ip` transform

packages/next-codemod/bin/__testfixtures__/next-15-canary-43-installed/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/next-codemod/bin/__testfixtures__/next-15-canary-43-installed/package.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

packages/next-codemod/bin/__testfixtures__/next-15-canary-43-installed/pnpm-workspace.yaml

Whitespace-only changes.

packages/next-codemod/bin/__testfixtures__/next-15-canary-44-installed/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/next-codemod/bin/__testfixtures__/next-15-canary-44-installed/package.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

packages/next-codemod/bin/__testfixtures__/next-15-canary-44-installed/pnpm-workspace.yaml

Whitespace-only changes.

packages/next-codemod/lib/utils.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,6 @@ export const TRANSFORMER_INQUIRER_CHOICES = [
9999
value: 'next-og-import',
100100
version: '14.0.0',
101101
},
102-
{
103-
title:
104-
'Transform `next/dynamic` imports accessing named exports to return an object with a `default` property',
105-
value: 'next-dynamic-access-named-export',
106-
version: '15.0.0-canary.44',
107-
},
108102
{
109103
title:
110104
'Install `@vercel/functions` to replace `geo` and `ip` properties on `NextRequest`',

packages/next-codemod/transforms/__testfixtures__/next-dynamic-access-named-export/access-named-export-block-01.input.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)