Skip to main content

Module versioning

Module versioning 

Source
Expand description

API versioning: one @version enum, @added/@removed lifecycle annotations and per-version HIR projection.

Phase 1 is deliberately small. A specification is versioned by marking one enum with @version; its members, in declaration order, are the version history. @added(Versions::v1) and @removed(Versions::v2) mark when a declaration exists; annotation order never matters. Renames are expressed by declaring a new member with a disjoint interval plus @rename, exactly like the desugaring versioned idl -> multi idl describes.

Projection is a pure HIR rewrite: each version is wrapped in module <version-ident> { ... }, lifecycle annotations and the version enum are removed, and the document version pragma carries the version value. The merged form keeps one module per selected version so generators can stay version-free.

Modules§

map
Language-neutral facts describing adjacent API-version changes.

Structs§

MemberInterval
The existence interval of one declaration, as half-open timeline indices.
VersionDef
One member of the API version enum.
VersionId
Position of a version inside the declaration order of the @version enum.
VersionTimeline
Ordered API version history declared by the @version enum.
VersionedProjection
One HIR projection produced from a specification.
VersioningRecord
Result of analysing the API versioning annotations of a specification.

Enums§

IntervalKind
What kind of declaration a MemberInterval describes.
VersioningError
Diagnostics raised while analysing or projecting API versioning annotations.

Constants§

API_VERSIONS_PROPERTY
Generation property that selects several API versions (comma separated, or *).
API_VERSION_MODULES_PROPERTY
Generation property that lists the API version modules of a projection.
API_VERSION_PROPERTY
Generation property that selects one API version by member ident or value.
LAYOUT_MERGED
Layout value: one specification holding one module per version.
LAYOUT_PER_VERSION
Layout value: one projection per version.
VERSION_LAYOUT_PROPERTY
Generation property that selects the version output layout.