-
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: unify comments prefix for dynamic api (#70970)
Co-authored-by: Sebastian "Sebbie" Silbermann <[email protected]>
- Loading branch information
Showing
8 changed files
with
14 additions
and
14 deletions.
There are no files selected for viewing
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
2 changes: 1 addition & 1 deletion
2
...od/transforms/__testfixtures__/next-async-request-api-dynamic-apis/async-api-16.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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { cookies } from "next/headers"; | ||
|
||
function MyComponent() { | ||
callSomething(/* TODO: please manually await this call, if it's a server component, you can turn it to async function */ | ||
callSomething(/* Next.js Dynamic Async API Codemod: Manually await this call, if it's a Server Component */ | ||
cookies()); | ||
} |
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
4 changes: 2 additions & 2 deletions
4
...d/transforms/__testfixtures__/next-async-request-api-dynamic-apis/async-api-21.output.tsx
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
const nextHeaders = /* The APIs under 'next/headers' are async now, need to be manually awaited. */ | ||
const nextHeaders = /* Next.js Dynamic Async API Codemod: The APIs under 'next/headers' are async now, need to be manually awaited. */ | ||
import('next/headers') | ||
|
||
function myFunc() { | ||
nextHeaders.cookies() | ||
} | ||
|
||
const nextHeaders2 = /* The APIs under 'next/headers' are async now, need to be manually awaited. */ import('next/headers') | ||
const nextHeaders2 = /* Next.js Dynamic Async API Codemod: The APIs under 'next/headers' are async now, need to be manually awaited. */ import('next/headers') |
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
4 changes: 2 additions & 2 deletions
4
...ansforms/__testfixtures__/next-async-request-api-dynamic-props/access-props-18.output.tsx
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
export default function Page(props: any) { | ||
callback(/* 'props' is passed as an argument. Any asynchronous properties of 'props' must be awaited when accessed. */ | ||
callback(/* Next.js Dynamic Async API Codemod: 'props' is passed as an argument. Any asynchronous properties of 'props' must be awaited when accessed. */ | ||
props, 1) | ||
} | ||
|
||
export function generateMetadata(props) { | ||
callback2(/* 'props' is passed as an argument. Any asynchronous properties of 'props' must be awaited when accessed. */ | ||
callback2(/* Next.js Dynamic Async API Codemod: 'props' is passed as an argument. Any asynchronous properties of 'props' must be awaited when accessed. */ | ||
props) | ||
} | ||
|
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