feat(proto): auto-discover payload-visitor roots from coresdk#2214
feat(proto): auto-discover payload-visitor roots from coresdk#2214cconstable wants to merge 1 commit into
Conversation
Replace the hand-maintained ROOTS list in gen-payload-visitor.ts with automatic discovery: a root is any payload-bearing message under the coresdk namespace that no other reachable message embeds (WorkflowActivation, ActivityTaskCompletion, NexusTask, etc.). Regenerating now picks up new worker-boundary message types without editing the generator. Regenerated payload-visitor.generated.ts.
| const ROOTS = [ | ||
| { type: 'coresdk.workflow_activation.WorkflowActivation', entry: 'walkWorkflowActivation' }, | ||
| { type: 'coresdk.workflow_completion.WorkflowActivationCompletion', entry: 'walkWorkflowActivationCompletion' }, | ||
| ] as const; | ||
| // Namespaces scanned for root messages. | ||
| const ROOT_NAMESPACES = ['coresdk'] as const; |
There was a problem hiding this comment.
Generate everything under coresdk instead of explicit types now
There was a problem hiding this comment.
Are all of the messages that are handled lang side in the coresdk namespace? I think the generated code looks correct for task processing. Unsure whether we'll use the visitor for client calls or not; in Go we used the visitor, in Python we piggy-backed onto the existing encode/decode calls.
| const ROOTS = [ | ||
| { type: 'coresdk.workflow_activation.WorkflowActivation', entry: 'walkWorkflowActivation' }, | ||
| { type: 'coresdk.workflow_completion.WorkflowActivationCompletion', entry: 'walkWorkflowActivationCompletion' }, | ||
| ] as const; | ||
| // Namespaces scanned for root messages. | ||
| const ROOT_NAMESPACES = ['coresdk'] as const; |
There was a problem hiding this comment.
Are all of the messages that are handled lang side in the coresdk namespace? I think the generated code looks correct for task processing. Unsure whether we'll use the visitor for client calls or not; in Go we used the visitor, in Python we piggy-backed onto the existing encode/decode calls.
What was changed
Why?
Checklist