Static

When you just need to build a tiny desktop app: TinyJS

First reported by The Register ·

The signal ●○○○ Compiled by AI from The Register, the single source so far
Why you might care

You can now build and run desktop applications using JavaScript that are significantly smaller than those built with conventional frameworks.

What happened

Software engineer Tarwin Stroh-Spijer has developed TinyJS, a JavaScript runtime designed for creating small desktop applications. These applications typically occupy 6MB or less on disk and run on macOS, Linux, or Windows. TinyJS achieves its small footprint by leveraging the native WebView component of each operating system for rendering, utilizing WebKit on macOS, WebView2 on Windows, and WebKitGTK on Linux. This approach contrasts with frameworks like Electron, which bundle an entire Chromium browser core, leading to much larger application sizes. TinyJS applications will exhibit minor visual differences across platforms due to variations in native rendering engines. The runtime's core, txiki.js, is exceptionally compact, with a starter package around 5.6MB. It simplifies development by using the OS's interprocess communication for data transfer, avoiding the need for bundled HTTP servers. Development uses standard web technologies: JavaScript, CSS, and HTML, with support for frameworks like React, Vue, and Svelte. Stroh-Spijer has also created an "app store" for these TinyJS applications, showcasing examples like a world clock, markdown editor, and a Winamp player clone, all with minimal disk space requirements.

What it means

TinyJS offers a compelling alternative to bloated desktop applications by using native OS webviews, drastically reducing the software footprint. This approach allows developers to leverage familiar web technologies like JavaScript, HTML, and CSS to create lightweight applications that are comparable in size to programs from the early days of personal computing. By offloading rendering and communication to the operating system, TinyJS avoids the overhead of bundling entire browser engines, making it ideal for scenarios where disk space and resource usage are critical.

The pragmatism of TinyJS signals a potential resurgence for small, single-purpose desktop utilities, especially in an era dominated by massive applications and cloud services. While frameworks like Electron prioritize cross-platform consistency at the cost of size, TinyJS embraces platform-specific rendering for extreme efficiency. This caters to users who value minimal resource consumption, fast startup times, and a more streamlined desktop experience, potentially influencing how future lightweight applications are developed and distributed.

AI-written summary. May contain errors.

When