mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-24 20:45:56 +03:00
[PR #673] [MERGED] introduce native-span-feed output stream #701
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#701
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/673
Author: @kommander
Created: 2/11/2026
Status: ✅ Merged
Merged: 2/12/2026
Merged by: @kommander
Base:
main← Head:introduce-output-stream📝 Commits (10+)
34c1aebintegrate72cebefbenchmark891fc12update baselinefed92d2update baseline properly608af13docsf963bacmove testsc509cd5cover reentrance92eb8b3use gpa725a068prettierca262d0shared callback📊 Changes
29 files changed (+7516 additions, -4 deletions)
View changed files
📝
packages/core/README.md(+4 -0)📝
packages/core/package.json(+2 -1)➕
packages/core/src/NativeSpanFeed.ts(+300 -0)➕
packages/core/src/benchmark/.gitignore(+7 -0)➕
packages/core/src/benchmark/latest-all-bench-run.json(+707 -0)➕
packages/core/src/benchmark/latest-async-bench-run.json(+336 -0)➕
packages/core/src/benchmark/latest-default-bench-run.json(+657 -0)➕
packages/core/src/benchmark/latest-large-bench-run.json(+707 -0)➕
packages/core/src/benchmark/latest-quick-bench-run.json(+207 -0)➕
packages/core/src/benchmark/native-span-feed-async-benchmark.ts(+355 -0)➕
packages/core/src/benchmark/native-span-feed-benchmark.md(+56 -0)➕
packages/core/src/benchmark/native-span-feed-benchmark.ts(+596 -0)➕
packages/core/src/benchmark/native-span-feed-compare.ts(+280 -0)📝
packages/core/src/index.ts(+1 -0)📝
packages/core/src/testing/mock-keys.test.ts(+2 -1)➕
packages/core/src/tests/native-span-feed-async.test.ts(+173 -0)➕
packages/core/src/tests/native-span-feed-close.test.ts(+120 -0)➕
packages/core/src/tests/native-span-feed-coverage.test.ts(+227 -0)➕
packages/core/src/tests/native-span-feed-edge-cases.test.ts(+352 -0)➕
packages/core/src/tests/native-span-feed-use-after-free.test.ts(+45 -0)...and 9 more files
📄 Description
Introduces a stream implementation, to feed data efficiently from native/zig to bun/typescript, using spans of memory in a chunked ring buffer, allowing full zero-copy consumption through to typescript, with and async event interface.
Intentionally named
NativeSpanFeedto not be confused with a node ReadStream interface. A ReadStream interface is not possible without copy, but the feed is intentionally zero-copy to not cause GC pressure in Bun.Not actively used in the renderer yet. It will allow to stream all ANSI output to actual WritableStreams in Bun.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.