Skip to content

fix(codegen): preserve equivalent suffixed type references - #48024

Merged
rekram1-node merged 1 commit into
v2from
codegen-references
Sep 8, 2026
Merged

fix(codegen): preserve equivalent suffixed type references#48024
rekram1-node merged 1 commit into
v2from
codegen-references

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Summary

Fix Effect client type generation when an encoded schema and a normal optional schema contain equivalent named types.

Schema representation can assign a numeric suffix to one occurrence (for example Message_State_1). The Effect emitter previously only matched exact registered names, so it expanded that occurrence inline instead of preserving the authoritative type reference.

  • Retain the generated definition alongside each registered Effect type reference.
  • Resolve numeric-suffixed references to the original named type only when their definitions match exactly.
  • Preserve distinct definitions that share an identifier.
  • Add regression tests for encoded/optional occurrences and conflicting shapes.

This is a standalone generator fix extracted from #48005. It contains only generator implementation and tests; it does not depend on the fork API changes.

Verification

  • packages/httpapi-codegen: bun test test/generate.test.ts — 90 passing
  • packages/httpapi-codegen: bun typecheck
  • packages/client: bun run check:generated — passes without changes to generated baseline files

@rekram1-node
rekram1-node merged commit 11aee1b into v2 Sep 8, 2026
10 checks passed
@rekram1-node
rekram1-node deleted the codegen-references branch September 8, 2026 20:21
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