Skip to content

fix: map core types in succinct method return types#54

Closed
klaidliadon wants to merge 1 commit intomasterfrom
fix/succinct-core-type-mapping
Closed

fix: map core types in succinct method return types#54
klaidliadon wants to merge 1 commit intomasterfrom
fix/succinct-core-type-mapping

Conversation

@klaidliadon
Copy link
Copy Markdown
Contributor

Summary

  • Succinct methods (e.g. Delete(Req) => (ok: bool)) emitted raw RIDL type names (bool) instead of mapped TypeScript types (boolean) in generated client interface, client implementation, and server interface
  • The templates used {{(index $method.Outputs 0).Type}} which renders via Go's Stringer, bypassing the $typeMap
  • Also handles the void case (no outputs) for succinct methods in clientInterface and serverInterface

Before: deleteProject(req: DeleteProjectRequest): Promise<bool>
After: deleteProject(req: DeleteProjectRequest): Promise<boolean>

Files changed

  • clientInterface.go.tmpl — use {{template "type" ...}} + handle void
  • client.go.tmpl — use {{template "type" ...}} for return type, isCoreType guard for $methodRespName
  • serverInterface.go.tmpl — use {{template "type" ...}} + handle void

@klaidliadon klaidliadon force-pushed the fix/succinct-core-type-mapping branch from c484ee4 to 2832931 Compare March 20, 2026 12:47
Succinct method outputs used .Type directly (Go Stringer) instead of
routing through the typeMap, producing 'bool' instead of 'boolean',
'int64' instead of 'number', etc.

Use the 'type' template with typeMap for all succinct output references
in client, clientInterface, and serverInterface templates.
@klaidliadon klaidliadon force-pushed the fix/succinct-core-type-mapping branch from 2832931 to 4a2449c Compare March 20, 2026 13:43
@klaidliadon
Copy link
Copy Markdown
Contributor Author

No longer needed - fixed in the webrpc parser instead (webrpc/webrpc#437). Methods with only one side using inline struct now fall back to non-succinct, which already maps types correctly.

@klaidliadon klaidliadon deleted the fix/succinct-core-type-mapping branch March 20, 2026 14:14
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.

1 participant