mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
v2.0.0
This commit is contained in:
@@ -8,7 +8,7 @@ You can run your application in development mode by running `wails dev` from you
|
||||
|
||||
- Build your application and run it
|
||||
- Bind your Go code to the frontend so it can be called from Javascript
|
||||
- Using the power of [vite](https://vitejs.dev/), will watch for modifications in your Go files and rebuild/re-run on change
|
||||
- Using the power of [Vite](https://vitejs.dev/), will watch for modifications in your Go files and rebuild/re-run on change
|
||||
- Sets up a [webserver](http://localhost:34115) that will serve your application over a browser. This allows you to use your favourite browser extensions. You can even call your Go code from the console
|
||||
|
||||
To get started, run `wails dev` in the project directory. More information on this can be found [here](../reference/cli.mdx#dev).
|
||||
|
||||
@@ -20,7 +20,7 @@ Wails has a number of common dependencies that are required before installation:
|
||||
|
||||
### Go
|
||||
|
||||
Download Go from the [Go Downloads Page](https://go.dev/doc/install).
|
||||
Download Go from the [Go Downloads Page](https://go.dev/dl/).
|
||||
|
||||
Ensure that you follow the official [Go installation instructions](https://go.dev/doc/install). You will also need to ensure that your `PATH` environment variable also includes the path to your `~/go/bin` directory. Restart your terminal and do the following checks:
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ To customise the obfuscation settings, you can use the `-garbleargs` flag:
|
||||
wails build -obfuscate -garbleargs "-literals -tiny -seed=myrandomseed"
|
||||
```
|
||||
|
||||
These settings may be persisted in your [project config](/guides/reference/project-config).
|
||||
These settings may be persisted in your [project config](../reference/project-config).
|
||||
|
||||
## How it works
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Javascript methods that can be called, just as if they were local Javascript met
|
||||
|
||||
```mdx-code-block
|
||||
<div className="text--center">
|
||||
<img src={require("@site/static/img/architecture.webp").default} width="75%" />
|
||||
<img src={require("@site/static/img/architecture.webp").default} style={{"width":"75%", "max-width":"800px"}} />
|
||||
</div>
|
||||
```
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ and power of Go, combined with a rich, modern frontend.
|
||||
- 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/next/reference/runtime/intro)
|
||||
- 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
|
||||
@@ -29,7 +29,10 @@ you'd expect from a modern native app.
|
||||
```mdx-code-block
|
||||
<p class="text--center">
|
||||
<a href="https://varly.app/">
|
||||
<img src={require("@site/static/img/varly.webp").default} width="75%" />
|
||||
<img
|
||||
src={require("@site/static/img/showcase/varly2.webp").default}
|
||||
style={{ width: "75%", "max-width": "800px" }}
|
||||
/>
|
||||
</a>
|
||||
</p>
|
||||
```
|
||||
|
||||
@@ -53,7 +53,7 @@ If you are unsure about a template, inspect `package.json` and `wails.json` for
|
||||
`wails build` is used for compiling your project to a production-ready binary.
|
||||
|
||||
| Flag | Description | Default |
|
||||
| :------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
|:---------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| -platform | Build for the given (comma delimited) [platforms](../reference/cli.mdx#platforms) eg. `windows/arm64`. Note, if you do not give the architecture, `runtime.GOARCH` is used. | platform = `GOOS` environment variable if given else `runtime.GOOS`.<br/>arch = `GOARCH` envrionment variable if given else `runtime.GOARCH`. |
|
||||
| -clean | Cleans the `build/bin` directory | |
|
||||
| -compiler "compiler" | Use a different go compiler to build, eg go1.15beta1 | go |
|
||||
@@ -71,7 +71,9 @@ If you are unsure about a template, inspect `package.json` and `wails.json` for
|
||||
| -debug | Retains debug information in the application. Allows the use of the devtools in the application window | false |
|
||||
| -trimpath | Remove all file system paths from the resulting executable. | false |
|
||||
| -race | Build with Go's race detector | false |
|
||||
| -windowsconsole | Keep the console window for Windows builds | false |
|
||||
| -windowsconsole | Keep the console window for Windows builds | |
|
||||
| -obfuscate | Obfuscate the application using [garble](https://github.com/burrowers/garble) | false |
|
||||
| -garbleargs | Arguments to pass to garble | `-literals -tiny -seed=random` |
|
||||
|
||||
For a detailed description of the `webview2` flag, please refer to the [Windows](../guides/windows.mdx) Guide.
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ func main() {
|
||||
Windows: &windows.Options{
|
||||
WebviewIsTransparent: false,
|
||||
WindowIsTranslucent: false,
|
||||
BackdropType: windows.Mica,
|
||||
DisableWindowIcon: false,
|
||||
DisableFramelessWindowDecorations: false,
|
||||
WebviewUserDataPath: "",
|
||||
@@ -63,6 +64,10 @@ func main() {
|
||||
},
|
||||
// User messages that can be customised
|
||||
Messages *windows.Messages
|
||||
// OnSuspend is called when Windows enters low power mode
|
||||
OnSuspend func()
|
||||
// OnResume is called when Windows resumes from low power mode
|
||||
OnResume func()
|
||||
},
|
||||
Mac: &mac.Options{
|
||||
TitleBar: &mac.TitleBar{
|
||||
@@ -364,7 +369,7 @@ Type: `[]interface{}`
|
||||
|
||||
### Windows
|
||||
|
||||
This defines [Windows specific options](#windows-specific-options).
|
||||
This defines [Windows specific options](#windows).
|
||||
|
||||
Name: Windows<br/>
|
||||
Type: `*windows.Options`
|
||||
@@ -381,11 +386,39 @@ Type: `bool`
|
||||
#### WindowIsTranslucent
|
||||
|
||||
Setting this to `true` will make the window background translucent. Often combined
|
||||
with [WebviewIsTransparent](#WebviewIsTransparent) to make frosty-looking applications.
|
||||
with [WebviewIsTransparent](#WebviewIsTransparent).
|
||||
|
||||
For Windows 11 versions before build 22621, this will use the [BlurBehind](https://learn.microsoft.com/en-us/windows/win32/dwm/blur-ovw)
|
||||
method for translucency, which can be slow. For Windows 11 versions after build 22621, this will enable the
|
||||
newer translucency types that are much faster. By default, the type of translucency used will be determined
|
||||
by Windows. To configure this, use the [BackdropType](#BackdropType) option.
|
||||
|
||||
Name: WindowIsTranslucent<br/>
|
||||
Type: `bool`
|
||||
|
||||
#### BackdropType
|
||||
|
||||
:::note
|
||||
|
||||
Requires Windows 11 build 22621 or later.
|
||||
|
||||
:::
|
||||
|
||||
Sets the translucency type of the window. This is only applicable if [WindowIsTranslucent](#WindowIsTranslucent) is set to `true`.
|
||||
|
||||
Name: BackdropType<br/>
|
||||
Type `windows.BackdropType`
|
||||
|
||||
The value can be one of the following:
|
||||
|
||||
| Value | Description |
|
||||
|---------|-------------------------------------------------------------------------------------------|
|
||||
| Auto | Let Windows decide which backdrop to use |
|
||||
| None | Do not use translucency |
|
||||
| Acrylic | Use [Acrylic](https://learn.microsoft.com/en-us/windows/apps/design/style/acrylic) effect |
|
||||
| Mica | Use [Mica](https://learn.microsoft.com/en-us/windows/apps/design/style/mica) effect |
|
||||
| Tabbed | Use Tabbed. This is a backdrop that is similar to Mica. |
|
||||
|
||||
#### DisableWindowIcon
|
||||
|
||||
Setting this to `true` will remove the icon in the top left corner of the title bar.
|
||||
@@ -515,21 +548,21 @@ Type: `uint16`
|
||||
|
||||
#### OnSuspend
|
||||
|
||||
If set, this function will be called when windows initiates a switch to low power mode (suspend/hibernate)
|
||||
If set, this function will be called when Windows initiates a switch to low power mode (suspend/hibernate)
|
||||
|
||||
Name: OnSuspend<br/>
|
||||
Type: `func()`
|
||||
|
||||
#### OnResume
|
||||
|
||||
If set, this function will be called when windows resumes from low power mode (suspend/hibernate)
|
||||
If set, this function will be called when Windows resumes from low power mode (suspend/hibernate)
|
||||
|
||||
Name: OnResume<br/>
|
||||
Type: `func()`
|
||||
|
||||
### Mac
|
||||
|
||||
This defines [Mac specific options](#mac-specific-options).
|
||||
This defines [Mac specific options](#mac).
|
||||
|
||||
Name: Mac<br/>
|
||||
Type: `*mac.Options`
|
||||
@@ -695,7 +728,7 @@ When clicked, that will open an about message box:
|
||||
|
||||
### Linux
|
||||
|
||||
This defines [Linux specific options](#linux-specific-options).
|
||||
This defines [Linux specific options](#linux).
|
||||
|
||||
Name: Linux<br/>
|
||||
Type: `*linux.Options`
|
||||
|
||||
Reference in New Issue
Block a user