Skip to content

Keep single-item tuple variants when upgrading from v1 - #188

Merged
lorisleiva merged 2 commits into
mainfrom
fix-tuple-variant-upgrade-guidance
Oct 2, 2026
Merged

lorisleiva merged 2 commits into
mainfrom
fix-tuple-variant-upgrade-guidance

Conversation

@lorisleiva

@lorisleiva lorisleiva commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

This PR corrects the upgrade guidance for v1 tuple variants holding a single item. The current guidance says upgrades should unwrap them into their item, except for structs, tuples and links. Instead, upgrades should keep them as tuples:

// v1
enumTupleVariantTypeNode('wait', tupleTypeNode([numberTypeNode('u64')]));
// v2
enumVariantTypeNode('wait', { data: tupleTypeNode([integerTypeNode('u64')]) });

This keeps the upgrade a faithful translation of the v1 IDL and leaves generated APIs unchanged. Authors can then simplify these variants to { data: integerTypeNode('u64') } themselves, and renderers can unwrap them before rendering if they wish.

Since the stable 2.0.0 changelog is built from the pre-release changesets, the correction amends the existing enum variant changeset in .changeset/pre/ rather than adding a new one. The stable changelog therefore states the correct guidance once. Its upgrade example is updated to keep the tuple too.

@lorisleiva
lorisleiva marked this pull request as ready for review October 2, 2026 15:20
@lorisleiva
lorisleiva merged commit 2306e23 into main Oct 2, 2026
3 checks passed
@lorisleiva
lorisleiva deleted the fix-tuple-variant-upgrade-guidance branch October 2, 2026 15:20
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