mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-24 20:45:56 +03:00
[PR #86] [CLOSED] Migrate to zig 0.15.1 #1057
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#1057
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/anomalyco/opentui/pull/86
Author: @nyxkrage
Created: 8/26/2025
Status: ❌ Closed
Base:
main← Head:migrate-zig-0.15.1📝 Commits (1)
28cab43feat: migrate to zig 0.15.1📊 Changes
6 files changed (+112 additions, -99 deletions)
View changed files
📝
packages/core/scripts/build.ts(+3 -1)📝
packages/core/src/zig/ansi.zig(+5 -5)📝
packages/core/src/zig/buffer.zig(+1 -1)📝
packages/core/src/zig/build.zig(+1 -3)📝
packages/core/src/zig/renderer.zig(+87 -74)📝
packages/core/src/zig/text-buffer.zig(+15 -15)📄 Description
Fixes #12
Also includes a small change to the build script which allows setting the Zig compiler with the ZIG environment variable, as this makes it much easier than needing to change your PATH back and forth when testing different versions of zig.
Migrates:
std.fmt.format -> std.Io.Writer.print
std.ArrayList -> std.ArrayListUnmanaged (while std.array_list.Managed does exist and should be the same as the old ArrayList, the managed options will be removed in the future, so I thought might as well bite the bullet and use the Unmanaged versions as is recommended)
CliRenderer.addStatSample to a method instead of a function so that it can use self.allocator for the unmanaged arraylist it now uses
Removes the use of bufferedWriter and now just stores the buffer and constructs the stdout writer as needed.
One consideration is the use of the std.io.GenericWriter in the CliRenderer.writer return type, this is technically deprecated, but as far as I can tell, the other options requires a much larger refactoring, so I have marked it as a TODO, however you may want to just hold out on moving to Zig 0.15 and migrate it properly at the same time as upgrading the toolchain version instead.
With these changes I also seem to get faster speeds from the src/benchmark/renderer-benchmark.ts, though unsure why that is or whether it is a fluke.


Before:
After:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.