Skip to content

Support @codama/nodes@1.10 optional array attributes - #120

Merged
lorisleiva merged 1 commit into
2.xfrom
2.x-support-codama-nodes-1.10
Jul 28, 2026
Merged

lorisleiva merged 1 commit into
2.xfrom
2.x-support-codama-nodes-1.10

Conversation

@lorisleiva

Copy link
Copy Markdown
Member

This PR backports the optional-array fix (#117) to the 2.x maintenance line.

Since @codama/nodes@1.5.0, node array attributes are optional (Array<T> | undefined) and factories like structTypeNodeFromInstructionArgumentNodes([]) omit empty arrays entirely. As a result, fresh 2.x installs that resolve @codama/nodes (declared ^1.4.4) up to 1.10.x crashed during rendering (the Rust counterpart of the issue reported in codama-idl/renderers-js#168).

Array reads are now guarded with ?? [] throughout the renderer, and the new injectedValueNode value kind now throws an explicit unsupported-node error rather than being silently mishandled. The @codama/* dependency ranges are raised to ^1.10.0 (with renderers-core to ^1.3.11) so the 2.x line is genuinely compatible with the current Codama nodes and standard, and the CI workflow now also publishes from the 1.x and 2.x branches. The end-to-end fixtures regenerate identically with the updated renderer, so no generated output changes.

@changeset-bot

changeset-bot Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: bdb7c6f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@codama/renderers-rust Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@lorisleiva
lorisleiva force-pushed the 2.x-support-codama-nodes-1.10 branch 2 times, most recently from 44580e0 to b968908 Compare July 27, 2026 16:38
This backports the optional-array fix (#117) to the 2.x maintenance line.
Since `@codama/nodes@1.5.0`, node array attributes are optional
(`Array<T> | undefined`) and factories like
`structTypeNodeFromInstructionArgumentNodes([])` omit empty arrays, so fresh
2.x installs resolving `@codama/nodes` to 1.10.x crashed during rendering (the
Rust counterpart of codama-idl/renderers-js#168). Array reads are guarded with
`?? []` throughout the renderer, the new `injectedValueNode` value kind throws
an explicit unsupported-node error, the `@codama/*` dependency ranges are raised
to `^1.10.0` (`renderers-core` to `^1.3.11`), and the CI workflow now also
publishes from the 1.x and 2.x branches.
@lorisleiva
lorisleiva force-pushed the 2.x-support-codama-nodes-1.10 branch from b968908 to bdb7c6f Compare July 27, 2026 17:10
@lorisleiva
lorisleiva merged commit 18efc6d into 2.x Jul 28, 2026
4 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 28, 2026
@lorisleiva
lorisleiva deleted the 2.x-support-codama-nodes-1.10 branch August 27, 2026 15:44
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