-
Notifications
You must be signed in to change notification settings - Fork 27k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
codemod: type cast async api calls in non entry file exports (#71040)
- Loading branch information
Showing
13 changed files
with
57 additions
and
8 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
...nsforms/__testfixtures__/next-async-request-api-dynamic-apis/origin-name-01-util.input.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { cookies } from 'next/headers' | ||
|
||
export default function Foo(): string { | ||
const name = cookies().get('name') | ||
return name | ||
} |
6 changes: 6 additions & 0 deletions
6
...sforms/__testfixtures__/next-async-request-api-dynamic-apis/origin-name-01-util.output.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { cookies, type UnsafeUnwrappedCookies } from 'next/headers'; | ||
|
||
export default function Foo(): string { | ||
const name = (cookies() as unknown as UnsafeUnwrappedCookies).get('name') | ||
return name | ||
} |
6 changes: 6 additions & 0 deletions
6
...nsforms/__testfixtures__/next-async-request-api-dynamic-apis/origin-name-02-util.input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { cookies } from 'next/headers' | ||
|
||
export default function Foo() { | ||
const name = cookies().get('name') | ||
return name | ||
} |
7 changes: 7 additions & 0 deletions
7
...sforms/__testfixtures__/next-async-request-api-dynamic-apis/origin-name-02-util.output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { cookies } from 'next/headers' | ||
|
||
export default function Foo() { | ||
const name = /* Next.js Dynamic Async API Codemod: Manually await this call, if it's a Server Component */ | ||
cookies().get('name') | ||
return name | ||
} |
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
...rms/__testfixtures__/next-async-request-api-dynamic-props/origin-name-03-default.input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function Page({ params }) { | ||
f1(params) | ||
} |
4 changes: 4 additions & 0 deletions
4
...ms/__testfixtures__/next-async-request-api-dynamic-props/origin-name-03-default.output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default async function Page(props) { | ||
const params = await props.params; | ||
f1(params) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters