跪拜 Guibai
← All articles
Juejin Community · Open Source · AI Programming

From rejected PR to 33MB: Tauri fork of Juejin AI usage tracker

By 雨夜寻晴天 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

A Tauri client at one-third the size of the official Electron app proves the framework is a viable drop-in when the data layer stays intact. The fork also shows an unmerged community PR can evolve into a maintained project that tracks upstream.

Summary

Juejin's AI usage tracker tracks token consumption for Claude Code, Codex, Cursor, and other AI tools, and its official desktop client runs on Electron with a ~100MB installer. A proposed Tauri version in a PR went unmerged, so the author built and maintains it independently. The client wraps the official core as an engine and only builds the shell in Rust, which skips rewriting parsers for 30+ tools and picks up upstream fixes automatically.

The installer dropped from 44MB to 33MB by stripping unused TypeScript declarations, duplicate builds, and browser-specific dependencies, then replacing the embedded Node binary's full ICU library with a small-icu English-only build. Four date-formatting calls used formatToParts, which is locale-agnostic, so the 30MB savings came without breaking. Validation ran 516 test cases with byte-identical output. The client offers the same dashboard, subscription quotas for 12 channels, a desktop pet, menu bar usage, deep-link login, and signed auto-updates, and its data and cloud sync stay compatible with the official Electron app. The roadmap targets a fully Rust implementation at 1.0 with an installer under 15MB.

Takeaways
— The macOS installer is 33MB, about one-third of the official Electron version's ~100MB.
— The Rust shell is ~10MB; the embedded Node runtime takes the remaining bulk.
— The architecture wraps the official core without touching its data layer; no parser was rewritten.
— Size cuts came from removing hono TypeScript declarations, duplicate CJS builds, and yaml browser versions from the bundle.
— Replacing full ICU with small-icu (English-only) saved ~30MB from the Node binary.
— Four date-formatting spots used formatToParts, which is locale-independent, so the swap didn't change output.
— Validation covered 516 test cases with byte-identical results between full and small-icu Node.
— Features include subscription quota cards for 12 channels, a desktop pet, macOS menu bar usage, deep-link login, and signed auto-updates.
— Data and cloud sync are fully compatible with the official Electron app.
— The 1.0 roadmap targets a fully Rust data/API layer with an installer under 15MB.
Conclusions

Reusing the official core sidesteps the hardest 80% of the work: parsing usage data from 30+ AI tools with different storage locations and formats.

Embedding a Node runtime to run that core offsets Tauri's size benefit, but a careful audit still yields a third of the official installer size.

The PR rejection is justified by the double cost of maintaining a second UI framework; a fork is a pragmatic way to keep the contribution alive.

The size reduction recipe (audit output, strip unused declarations and locale data, verify with a test suite) generalizes to any app bundling a runtime.

Concepts & terms
small-icu
A Node.js build variant that includes only a minimal set of ICU locale data, typically English only, reducing binary size by tens of megabytes. It works when the app doesn't need full internationalization.
formatToParts
A method on Intl.DateTimeFormat that returns date components as an array of tokens, letting code assemble date strings without relying on locale-specific formatting, so output stays consistent across locales.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗