Files

95 lines
4.0 KiB
Plaintext
Raw Permalink Normal View History

2022-04-27 21:47:11 +10:00
---
sidebar_position: 1
---
# Introduction
Wails is a project that enables you to write desktop apps using Go and web technologies.
Consider it a lightweight and fast Electron alternative for Go. You can easily build applications with the flexibility
and power of Go, combined with a rich, modern frontend.
2022-09-18 11:00:39 +10:00
### Features
- Native Menus, Dialogs, Theming and Translucency
- Windows, macOS and linux support
- Built in templates for Svelte, React, Preact, Vue, Lit and Vanilla JS
2022-12-30 07:38:22 +11:00
- Easily call Go methods from JavaScript
- Automatic Go struct to TypeScript model generation
2022-09-18 11:00:39 +10:00
- No CGO or external DLLs required on Windows
- Live development mode using the power of [Vite](https://vitejs.dev/)
- Powerful CLI to easily Create, Build and Package applications
- A rich [runtime library](/docs/reference/runtime/intro)
- Applications built with Wails are Apple & Microsoft Store compliant
This is [varly](https://varly.app) - a desktop application for
2022-07-19 07:38:23 +10:00
MacOS & Windows written using Wails. Not only does it look great, it uses native menus and translucency - everything
you'd expect from a modern native app.
2022-04-27 21:47:11 +10:00
2022-09-18 11:00:39 +10:00
```mdx-code-block
2022-04-27 21:47:11 +10:00
<p class="text--center">
2022-09-18 11:00:39 +10:00
<a href="https://varly.app/">
<img
src={require("@site/static/img/showcase/varly2.webp").default}
style={{ width: "75%", "max-width": "800px" }}
/>
</a>
2022-04-27 21:47:11 +10:00
</p>
2022-09-18 11:00:39 +10:00
```
2022-04-27 21:47:11 +10:00
2022-09-18 11:00:39 +10:00
### Quick Start Templates
2022-04-27 21:47:11 +10:00
Wails comes with a number of pre-configured templates that allow you to get your application up and running quickly.
2022-12-30 07:38:22 +11:00
There are templates for the following frameworks: Svelte, React, Vue, Preact, Lit and Vanilla. There are both JavaScript
and TypeScript versions for each template.
2022-04-27 21:47:11 +10:00
2022-09-18 11:00:39 +10:00
### Native Elements
2022-04-27 21:47:11 +10:00
Wails uses a purpose built library for handling native elements such as Window, Menus, Dialogs, etc, so you can build
good-looking, feature rich desktop applications.
2023-12-09 16:32:29 +11:00
**It does not embed a browser**, so it delivers a small runtime. Instead, it reuses the native rendering engine for the
2022-04-27 21:47:11 +10:00
platform. On Windows, this is the new Microsoft Webview2 library, built on Chromium.
2022-12-30 07:38:22 +11:00
### Go & JavaScript Interoperability
2022-04-27 21:47:11 +10:00
2022-12-30 07:38:22 +11:00
Wails automatically makes your Go methods available to JavaScript, so you can call them by name from your frontend!
It even generates TypeScript models for the structs used by your Go methods, so you can pass the same data structures
between Go and JavaScript.
2022-04-27 21:47:11 +10:00
2022-09-18 11:00:39 +10:00
### Runtime Library
2022-04-27 21:47:11 +10:00
2022-12-30 07:38:22 +11:00
Wails provides a runtime library, for both Go and JavaScript, that handles a lot of the things modern applications need,
2022-04-27 21:47:11 +10:00
like Eventing, Logging, Dialogs, etc.
2022-09-18 11:00:39 +10:00
### Live Development Experience
2022-04-27 21:47:11 +10:00
2022-09-18 11:00:39 +10:00
#### Automatic Rebuilds
2022-04-27 21:47:11 +10:00
When you run your application in "dev" mode, Wails will build your application as a native desktop application, but will
read your assets from disk. It will detect any changes to your Go code and automatically rebuild and relaunch your
application.
2022-09-18 11:00:39 +10:00
#### Automatic Reloads
2022-04-27 21:47:11 +10:00
When changes to your application assets are detected, your running application will "reload", reflecting your changes
almost immediately.
2022-09-18 11:00:39 +10:00
#### Develop your application in a Browser
2022-04-27 21:47:11 +10:00
If you prefer to debug and develop in a browser then Wails has you covered. The running application also has a webserver
that will run your application in any browser that connects to it. It will even refresh when your assets change on disk.
2022-09-18 11:00:39 +10:00
### Production-ready Native Binaries
2022-04-27 21:47:11 +10:00
When you're ready to do the final build of your application, the CLI will compile it down to a single executable, with
all the assets bundled into it. On Windows and MacOS, it is possible to create a native package for distribution. The
assets used in packaging (icon, info.plist, manifest file, etc) are part of your project and may be customised, giving
you total control over how your applications are built.
2022-09-18 11:00:39 +10:00
### Tooling
2022-04-27 21:47:11 +10:00
The Wails CLI provides a hassle-free way to generate, build and bundle your applications. It will do the heavy lifting
of creating icons, compiling your application with optimal settings and delivering a distributable, production ready
binary. Choose from a number of starter templates to get up and running quickly!