solenoid: yet another desktop application framework
solenoid is a framework for making desktop applications. You know maybe about Electron and Tauri. The project started as Tauri clone in Zig.
I needed the zig-gobject bindings for v0.17.0 but it isnt available at the time. so i forked zig-gobject repository and updated it to v0.17.0 version of Zig. (The PR)
So finally i had the bindings. Then i started writing the rendering stuff. It was fantastic, i rendered my first html, css and js files. Browse source
After that, i wrote command/plugin system. Its very simple, you only throwing fetch request from your frontend code. Then Zig side parses it and executes the command.
The assets generator logic is awful for now. You need to generate an assets.zig file after you build your frontend.
pub const Asset = struct {
path: []const u8,
data: []const u8,
mime: [*:0]const u8,
};
I couldnt find a useful way to generate that at compile time. If anyone can help, I can (maybe[1]) do it. The asset generator script
About cross-platform compability, currently only supports Linux because it uses WebKitGTK. I wrote a cross-platform window management library like webview, named as pencere
I will implement it to solenoid sometime. But i havent tested it on Windows and macOS very well. it needs more work.
I use Zine for the website. Thanks kristoff-it and the contributors.
You can check out the examples
I know more or less that no one will do this, but I’ll warn you anyway: dont use it in production (yet) ![]()
Links
Code: https://codeberg.org/Erenay/solenoid
Website: https://solenoid.erenaydev.com.tr (I havent purchased a domain yet)
pencere code: https://codeberg.org/Erenay/pencere
Supported Zig versions
v0.17.0 (master)
AI / LLM usage disclosure
- the idea belongs to me. I asked to a LLM for brainstorming somethings before coding a single line of code.
- I used LLM to help me with the pencere code in a part of macOS
Due to the college entrance exam, I wont be available for the next 8 months. I wanted to create a post about solenoid and stop using the computer until the exam. ↩︎
