Skip to content

What's New in Wails v3

Wails v3 introduces significant changes from v2. It replaces the single-window, declarative API with a more flexible procedural approach. This new API design improves code readability and simplifies development, especially for complex multi-window applications.

Wails v3 represents a substantial evolution in how desktop applications can be built using Go and web technologies.

Multiple Windows

Wails v3 introduces the ability to create and manage multiple windows within a single application. This feature allows developers to design more complex and versatile user interfaces, moving beyond the limitations of single-window applications.

Each window can be independently configured, providing flexibility in terms of size, position, content, and behavior. This enables the creation of applications with separate windows for different functionalities, such as main interfaces, settings panels, or auxiliary views.

Developers can create, manipulate, and manage these windows programmatically, allowing for dynamic user interfaces that adapt to user needs and application states.

System Tray Integration

Wails v3 introduces robust support for system tray functionality, allowing your application to maintain a persistent presence on the user’s desktop. This feature is particularly useful for applications that need to run in the background or provide quick access to key functions.

Key features of the Wails v3 system tray integration include:

  1. Window Attachment: You can associate a window with the system tray icon. When activated, this window will be centered relative to the icon’s position, providing a great way to quickly access your application.

  2. Comprehensive Menu Support: Create rich, interactive menus that users can access directly from the system tray icon. This allows for quick actions without needing to open the full application window.

  3. Adaptive Icon Display: Support for both light and dark mode icons ensures your application’s system tray icon remains visible and aesthetically pleasing across different system themes. Template icons are also supported on macOS.

Improved bindings generation

Wails v3 introduces a significant improvement in how bindings are generated for your project. Bindings are the glue that connects your Go backend to your frontend, allowing seamless communication between the two.

Binding generation is now done using a sophisticated static analyzer that radically improves the binding generation process. It offers enhanced speed and preserves code quality by maintaining comments and parameter names.

The binding generation process has been simplified, requiring only a single command: wails3 generate bindings.

Improved build system

Wails v3 introduces a more flexible and transparent build system, addressing the limitations of its predecessor. In v2, the build process was largely opaque and difficult to customise, which could be frustrating for developers seeking more control over their project’s build process.

All the heavy lifting that the v2 build system did, such as icon generation and manifest creation, have been added as tool commands in the CLI. We have incorporated Taskfile into the CLI to orchestrate these calls to bring the same developer experience as v2. However, this approach brings the ultimate balance of flexibility and ease of use as you can now customise the build process to your needs.

You can even use make if that’s your thing!

Improved events

Wails now emits events for various runtime operations and system activities. This allows your application to respond to these events in real-time. Additionally, cross-platform (common) events are available, enabling you to write consistent event handling methods that work across different operating systems.

Event hooks can be registered to handle specific events synchronously. Unlike the On method, these hooks allow you to cancel the event if needed. A common use case is displaying a confirmation dialog before closing a window. This gives you more control over the event flow and user experience.

Wails Markup Language (wml)

An experimental feature to call runtime methods using plain html, similar to htmx.

Examples

There are more examples available in the examples directory. Check them out!