tools/updater/README.md
A syntax-aware migration tool that automatically upgrades .slint files to the latest Slint language syntax.
As the Slint language evolves, some syntax patterns are deprecated in favor of new ones. This tool parses your .slint files using the Slint compiler and applies transformations to migrate deprecated patterns.
cargo install slint-updater
# Preview changes (prints to stdout)
slint-updater file.slint
# Apply changes in-place
slint-updater -i file.slint
# Update multiple files
slint-updater -i src/**/*.slint
# Move property declarations to component root
slint-updater -i --move-declarations file.slint
| Flag | Description |
|---|---|
-i, --inline | Modify files in-place instead of printing to stdout |
--move-declarations | Move all property declarations to the root of each component |
.slint files.rs files containing slint! macros.md files with ```slint code blocksEnum renames:
PointerEventButton.none → PointerEventButton.otherKeys.* → Key.*These transforms handle migrations from older Slint syntax versions:
Component declaration syntax:
// Old syntax
MyComponent := Rectangle { }
// New syntax
component MyComponent inherits Rectangle { }
Property visibility:
// Old syntax
property <int> count: 0;
// New syntax
in-out property <int> count: 0;
Struct declaration:
// Old syntax
MyStruct := { field: int }
// New syntax
struct MyStruct { field: int }
Update all .slint files in a project:
slint-updater -i $(find . -name "*.slint")
Preview changes before applying:
slint-updater file.slint | diff file.slint -
Update Slint code embedded in Rust:
slint-updater -i src/**/*.rs