Skip to content

v0.1.0 - First Stable Release 🎉

Choose a tag to compare

@kolkov kolkov released this 22 Nov 13:18
· 15 commits to main since this release

After 35 days of beta testing, uniwidth v0.1.0 is now stable and ready for production use.

🚀 Performance

3.9-46x faster than go-runewidth with zero allocations:

  • ASCII strings: 15-46x faster
  • CJK strings: 4-14x faster
  • Mixed/Emoji strings: 6-8x faster

✨ Key Features

  • 🎯 Unicode 16.0 support with full compliance
  • 💎 Zero allocations for ASCII-only strings (no GC pressure)
  • 🧵 Thread-safe (immutable design, no global state)
  • 📊 Tiered lookup strategy (O(1) for 90-95% of cases)
  • 🔧 Options API for East Asian Width configuration
  • ✅ Proper handling of variation selectors and regional indicators (flags)

📊 Quality Metrics

  • Test Coverage: 90.3% (exceeds 90% target ✅)
  • Tests: 100% passing on Linux, macOS, Windows
  • Linter: 0 issues (golangci-lint with 34+ linters)
  • Race Detector: 0 data races
  • Dependencies: Zero external dependencies (pure stdlib)

📦 Installation

go get github.com/unilibs/uniwidth@v0.1.0

Requirements: Go 1.25 or later

🔧 Quick Start

package main

import (
    "fmt"
    "github.com/unilibs/uniwidth"
)

func main() {
    // Calculate width of a string
    width := uniwidth.StringWidth("Hello 世界")
    fmt.Println(width) // Output: 10

    // East Asian locale (ambiguous characters are wide)
    opts := []uniwidth.Option{
        uniwidth.WithEastAsianAmbiguous(uniwidth.EAWide),
    }
    width = uniwidth.StringWidthWithOptions("±½", opts...)
    fmt.Println(width) // Output: 4
}

📋 What's Changed Since Beta

Fixed (from v0.1.0-beta)

  • ✅ All conformance tests passing (Unicode edge cases resolved)
  • ✅ Increased test coverage: 87.1% → 90.3%
  • ✅ Added comprehensive project governance files

Added

  • ✅ CODE_OF_CONDUCT.md (Contributor Covenant v2.1)
  • ✅ CONTRIBUTING.md (Git-Flow workflow, contribution guidelines)
  • ✅ SECURITY.md (security policy and best practices)
  • ✅ .github/CODEOWNERS (code ownership definition)
  • ✅ scripts/pre-release-check.sh (automated quality validation)
  • ✅ Git-Flow workflow support in CI/CD

Quality Improvements

  • ✅ Coverage increased to 90.3% with new test cases
  • ✅ All linter warnings resolved
  • ✅ Code formatting enforced across all files

🎯 Use Cases

Perfect for:

  • TUI frameworks (terminal rendering hot paths)
  • Terminal emulators (text layout calculations)
  • CLI tools (table alignment, formatting)
  • Text editors (cursor positioning, column calculation)

🔄 Migration from go-runewidth

Drop-in replacement with 3.9-46x performance boost:

// Before (go-runewidth)
import "github.com/mattn/go-runewidth"
width := runewidth.StringWidth(s)

// After (uniwidth) - zero code changes!
import "github.com/unilibs/uniwidth"
width := uniwidth.StringWidth(s)

📚 Documentation

🙏 Special Thanks

Professor Ancha Baranova - This project would not have been possible without her invaluable help and support.

🌟 What's Next

See ROADMAP.md for planned features:

  • Grapheme cluster support (v0.2.0+)
  • Extended Unicode compliance
  • Performance optimizations

Made with ❤️ by the Phoenix TUI Framework team | Powered by Go 1.25+

Full Changelog: v0.1.0-beta...v0.1.0