Skip to main content

xfa_layout_engine/ir/
version.rs

1//! Schema version for the LayoutTreeIR.
2//!
3//! ## Compatibility policy
4//!
5//! - **Field additions** to existing structs in [`crate::ir`] bump
6//!   [`SCHEMA_VERSION`] by one and append a migration line below.
7//! - **Field removals or semantic-changing renames** are breaking and
8//!   require either a new major (e.g. v2) on top of v1 with a translation
9//!   shim, or coordinated update of every consumer in the same PR. M1
10//!   ships v1; anything past v1 must justify the bump in this file's
11//!   migration log.
12//! - **Snapshots committed under tests/ir_snapshots/** carry the version
13//!   they were captured under via the `schema_version` field at the root
14//!   of the JSON. Tests that load older snapshots must reject mismatched
15//!   versions explicitly rather than silently re-interpret.
16//!
17//! ## Migration log
18//!
19//! - v1 (M1) — initial schema. Fields: `schema_version`, `root` with
20//!   `children`, `field_kind`, `form_node_id`, `id`, `kind`, `overflow`,
21//!   `page_index`, `presence`, `rect`, `som`, `value_hash`.
22
23/// Current LayoutTreeIR schema version.
24pub const SCHEMA_VERSION: u32 = 1;