Skip to content

feat(rsc): support inline "use cache" exports in file-level "use server" modules and vice versa - #1415

Merged
hi-ogawa merged 10 commits into
mainfrom
fix/issue-1394
Aug 7, 2026
Merged

feat(rsc): support inline "use cache" exports in file-level "use server" modules and vice versa#1415
hi-ogawa merged 10 commits into
mainfrom
fix/issue-1394

Conversation

@hi-ogawa

@hi-ogawa hi-ogawa commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

This PR loosens server reference claim overlap mechanism so it can support file/inline directive mixing of following with Next.js like semantics. It also adjusted use cache transform plugin in the example to take into account the same source can include use server.

'use server'

import { state } from './state'

// not cached
export async function defaultAction(_key: string) {
}

// cached
export async function overrideAction(_key: string) {
  'use cache'
}
'use cache'

import { state } from './state'

// cached
export async function defaultAction() {
}

// not cached
export async function overrideAction() {
  'use server'
}

hi-ogawa and others added 2 commits August 7, 2026 15:18
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
@hi-ogawa hi-ogawa changed the title test(rsc): cover mixed server and cache directives test(rsc): characterize mixed directives and reachability Aug 7, 2026
hi-ogawa and others added 3 commits August 7, 2026 15:31
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
@hi-ogawa hi-ogawa changed the title test(rsc): characterize mixed directives and reachability feat(rsc): compose cache and server reference claims Aug 7, 2026
hi-ogawa and others added 3 commits August 7, 2026 15:47
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
@hi-ogawa hi-ogawa changed the title feat(rsc): compose cache and server reference claims feat(rsc): support inline "use cache" exports in file-level "use server" modules and vice versa Aug 7, 2026
hi-ogawa and others added 2 commits August 7, 2026 15:58
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
@hi-ogawa
hi-ogawa marked this pull request as ready for review August 7, 2026 07:07
@hi-ogawa
hi-ogawa merged commit 5626b31 into main Aug 7, 2026
22 of 23 checks passed
@hi-ogawa
hi-ogawa deleted the fix/issue-1394 branch August 7, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support inline "use cache" exports in file-level "use server" modules and vice versa

1 participant