mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
The frontend of the GUI client is written in TypeScript and communicates with the backend via event listeners. Currently, we only have type-safety within either of those parts of the codebase but not across it. The payloads of these events are JSON-encoded. Any change to this interface therefore needs to be applied on either end. To avoid this, we add `tslink` to the GUI client which generates TypeScript interfaces from Rust structs. We still check those into Git into order to make local builds easy (otherwise every dev would have to set `TSLINK_BUILD=true` on their machine). Our Tauri CI build already has a check to ensure the Git workspace isn't modified after building so any changes to these generated files will fail CI. This adds a bit more type-safety to the codebase and makes refactorings on the GUI client easier.