Introducing Gluon: A New Framework for Building Desktop Applications with Web Technologies
What is Gluon?
Gluon is a framework that allows you to build desktop applications using HTML, CSS, and JavaScript. Unlike other desktop frameworks, Gluon doesn’t bundle your application with a browser engine or webview. Instead, it uses the client’s installed browsers to render its application. This approach has several benefits, including a tiny bundle size and ease of use.
Key Features of Gluon
- Tiny Bundle Size: A typical application built with Gluon weighs less than 1 MB, compared to 220 MB with Electron.js and 1.8 MB with Tauri.
- Easy to Use: Gluon is straightforward to use, with no additional languages or patterns required to start building desktop applications.
- Cross-Platform Support: Gluon currently supports Chromium-based browsers and Firefox, allowing you to build applications for different platforms.
- Node.js, Bun, and Deno Support: Gluon lets you build applications with Node.js, Bun, and Deno, which is not currently available in other major frameworks.
Exploring Gluon’s Architecture
Gluon’s architecture is divided into two components: a Node.js and Deno script to manage your app windows, and the web frontend to build your application interface. The index.js
file serves as the entry point, importing Gluon and creating new windows using the Gluon.open()
method.
// index.js import Gluon from 'gluon'; Gluon.open({ title: 'My App', width: 800, height: 600, });
Using Gluon APIs
Gluon provides support for various methods, events, and APIs necessary for building desktop applications. These include:
- Page and Controls APIs: Retrieve information about the current page and enhance it as preferred.
- IPC API: Communicate with your application from the main window process and expose functions between your application.
Comparing Gluon with Electron, Tauri, and Neutralinojs
Gluon has the advantage over other major desktop frameworks in terms of build size, memory usage, and build time. However, other factors to consider are the features and community support offered by each framework.
Getting Started with Gluon
Gluon is still in its alpha testing phase, but you can try out the example bundled with it by following the steps outlined in the Gluon examples repo.