docs(next): document workflow discovery and server actions - #2003
docs(next): document workflow discovery and server actions#2003EfeDurmaz16 wants to merge 5 commits into
Conversation
|
|
@EfeDurmaz16 is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
Signed-off-by: EfeDurmaz16 <efebarandurmaz05@gmail.com>
5332b5a to
7bf9024
Compare
Co-authored-by: Peter Wielander <mittgfu@gmail.com> Signed-off-by: Peter Wielander <mittgfu@gmail.com>
….mdx Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com> Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-authored-by: Peter Wielander <mittgfu@gmail.com> Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Note that workflow/step files are discovered transitively through imports and can live anywhere (not just app/pages), and condense the discovery and "use server" sections. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
VaguelySerious
left a comment
There was a problem hiding this comment.
(AI) Approving. Verified the documented behavior against the implementation:
- Entry scanning of App Router
route/page/layoutandpages/src/pagesmatchespackages/nextbuilder config (dirs: ['pages','app','src/pages','src/app']) and the eager builder's entry filter. startis exported fromworkflow/api, and discovery is transitive through the import graph — workflow/step files don't need to live underapp/pages.- The
"use server"incompatibility (synchronous module-init wrapper →Server Actions must be async functions) is accurate.
The two markdown rendering bugs (stray code fence; missing blank line before the Monorepos heading) were already fixed by the code-review commits. I pushed a follow-up that clarifies the transitive-discovery behavior and tightens the prose in both new sections. docs lint:links passes.
Add "Workflow Discovery in Next.js" and "Server Actions and use server" sections to the withWorkflow() reference. Ports the intended additions from #2003 (the lazyDiscovery doc edits are omitted — main already supersedes them). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
start()calls in app/pages entriesstart(), while workflow-imported modules should not carry top-level"use server"Closes #817.
Verification
pnpm installpnpm --filter docs lint:linkspnpm --filter docs build(blocked by existing prerender failure on/en/v5/docs/api-reference/workflow-api/get-hook-by-token:generateDefinition.coderesolved asany; build reached this unrelated docs page after compiling successfully)Notes
The local environment warns that Node v26.0.0 is outside the repo supported engine range (
^18 || ^20 || ^22 || ^24).