-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the RSC directive transform (#70562)
This PR extends the cache directive to accept an additional type parameter which defaults to `"default"`. Several follow-ups: - Accept different syntaxes (like places of spaces) and typo detection; - Have a limited set of valid options with better errors.
- Loading branch information
Showing
6 changed files
with
171 additions
and
83 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
crates/next-custom-transforms/tests/errors/server-actions/server-graph/7/output.stderr
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
11 changes: 11 additions & 0 deletions
11
crates/next-custom-transforms/tests/fixture/server-actions/server/37/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,11 @@ | ||
'use server' | ||
|
||
async function fn() { | ||
'use cache' | ||
return 'foo' | ||
} | ||
|
||
async function Component() { | ||
const data = await fn() | ||
return <div>{data}</div> | ||
} |
Oops, something went wrong.