wiki: Document IPC backwards compatibility
Browse files at this commit2b3a80b477865177dbdf030d9d5360191b03f312Parent: 294f16f1 changed file +17 -0
- wiki/IPC.md +17 -0
wiki/IPC.mdmodified+17 -0
| @@ -10,3 +10,20 @@ The communication over the IPC socket happens in JSON. | |||
| 10 | > [!TIP] | 10 | > [!TIP] |
| 11 | > If you're getting parsing errors from `niri msg` after upgrading niri, make sure that you've restarted niri itself. | 11 | > If you're getting parsing errors from `niri msg` after upgrading niri, make sure that you've restarted niri itself. |
| 12 | > You might be trying to run a newer `niri msg` against an older `niri` compositor. | 12 | > You might be trying to run a newer `niri msg` against an older `niri` compositor. |
| 13 | + | ||
| 14 | +### Backwards Compatibility | ||
| 15 | + | ||
| 16 | +The JSON output *should* remain stable, as in: | ||
| 17 | + | ||
| 18 | +- existing fields and enum variants should not be renamed | ||
| 19 | +- non-optional existing fields should not be removed | ||
| 20 | + | ||
| 21 | +However, new fields and enum variants will be added, so you should handle unknown fields or variants gracefully where reasonable. | ||
| 22 | + | ||
| 23 | +I am not 100% committing to the stability yet because there aren't many users, and there might be something basic I had missed in the JSON output design. | ||
| 24 | + | ||
| 25 | +The formatted/human-readable output (i.e. without `--json` flag) is **not** considered stable. | ||
| 26 | +Please prefer the JSON output for scripts, since I reserve the right to make any changes to the human-readable output. | ||
| 27 | + | ||
| 28 | +The `niri-ipc` sub-crate (like other niri sub-crates) is *not* API-stable in terms of the Rust semver; rather, it follows the version of niri itself. | ||
| 29 | +In particular, new struct fields and enum variants will be added. | ||