Skip to content

v4.0.0-rc.0

Pre-release
Pre-release

Choose a tag to compare

@codama-releases codama-releases released this 01 Dec 09:15
· 2 commits to 3.x since this release
0fbab44

Major Changes

  • #199 d9777f9 Thanks @codama-releases! - Start major 4. Release candidates publish under the rc dist-tag while this major is in development.

  • #200 f21f004 Thanks @lorisleiva! - Render IDLs of the Codama v2 standard. The renderer now depends on the v2 releases of @codama/nodes, @codama/visitors-core and @codama/errors, and on @codama/fragments instead of @codama/renderers-core.

    BREAKING CHANGES

    Codama v2 IDLs are required. The renderer only accepts trees of the v2 standard, and rendering a root node whose version is not a 2.x version throws CODAMA_ERROR__VERSION_MISMATCH. Upgrade v1 IDLs with the codama upgrade command, or with @codama/upgrade as a before visitor of your Codama configuration.

    {
        "idl": "program/idl.json",
        "before": ["@codama/upgrade"],
        "scripts": { "rust": { "from": "@codama/renderers-rust", "args": ["clients/rust"] } }
    }

    Node.js 22.12.0 or later is required, as Codama v2 does.

    Account and instruction data must be structs. Instruction arguments are read from the data of the instruction. Account or instruction data of any other type, e.g. a link to a defined type, which only native v2 IDLs can express, throws CODAMA_ERROR__RENDERERS__UNSUPPORTED_NODE.

    Names are derived from identifiers of any casing. Node identifiers keep their original casing in v2, e.g. transfer_tokens from an Anchor IDL, and every generated name goes through the casing helpers of @codama/fragments/casing. Fields of struct values now use their snake_case form, matching the fields of the generated structs.

    Option keys must match identifiers exactly. Keys of linkOverrides and traitOptions.overrides are compared with node identifiers as they are, e.g. Counter rather than counter for a type from an Anchor IDL.

    The resolvers link override is removed, since resolvers are no longer value nodes in Codama v2 and the renderer never rendered them.