docs: sync documents (#2083)

This commit is contained in:
Misite Bao
2022-11-18 22:11:25 +11:00
committed by GitHub
parent 8850b453d9
commit ec56f8807f
20 changed files with 169 additions and 124 deletions
@@ -29,7 +29,7 @@ Today, I am pleased to announce: **Wails v2 Beta for Windows**! There's a huge a
### No CGO Dependency!
No, I'm not joking: *No* *CGO* *dependency* 🤯! The thing about Windows is that, unlike MacOS and Linux, it doesn't come with a default compiler. In addition, CGO requires a mingw compiler and there's a ton of different installation options. Removing the CGO requirement has massively simplified setup, as well as making debugging an awful lot easier. Whilst I have put a fair bit of effort in getting this working, the majority of the credit should go to [John Chadwick](https://github.com/jchv) for not only starting a couple of projects to make this possible, but also being open to someone taking those projects and building on them. Credit also to [Tad Vizbaras](https://github.com/tadvi) whose [winc](https://github.com/tadvi/winc) project started me down this path.
No, I'm not joking: _No_ _CGO_ _dependency_ 🤯! The thing about Windows is that, unlike MacOS and Linux, it doesn't come with a default compiler. In addition, CGO requires a mingw compiler and there's a ton of different installation options. Removing the CGO requirement has massively simplified setup, as well as making debugging an awful lot easier. Whilst I have put a fair bit of effort in getting this working, the majority of the credit should go to [John Chadwick](https://github.com/jchv) for not only starting a couple of projects to make this possible, but also being open to someone taking those projects and building on them. Credit also to [Tad Vizbaras](https://github.com/tadvi) whose [winc](https://github.com/tadvi/winc) project started me down this path.
### WebView2 Chromium Renderer
@@ -48,7 +48,7 @@ Finally, Windows developers get a first class rendering engine for their applica
The WebView2 component does, however, have a requirement to have the `WebView2Loader.dll` sitting alongside the binary. This makes distribution just that little bit more painful than we gophers are used to. All solutions and libraries (that I know of) that use WebView2 have this dependency.
However, I'm really excited to announce that Wails applications *have no such requirement*! Thanks to the wizardry of [John Chadwick](https://github.com/jchv), we are able to bundle this dll inside the binary and get Windows to load it as if it were present on disk.
However, I'm really excited to announce that Wails applications _have no such requirement_! Thanks to the wizardry of [John Chadwick](https://github.com/jchv), we are able to bundle this dll inside the binary and get Windows to load it as if it were present on disk.
Gophers rejoice! The single binary dream lives on!
@@ -114,7 +114,7 @@ It also provides the additional features:
- Hot reload - Any changes to frontend assets will trigger and auto reload of the application frontend
- Auto rebuild - Any changes to your Go code will rebuild and relaunch your application
In addition to this, a webserver will start on port 34115. All connected web browsers will respond to system events like hot reload on asset change. All connected web browsers will respond to system events like hot reload on asset change.
In addition to this, a webserver will start on port 34115. This will serve your application to any browser that connects to it. All connected web browsers will respond to system events like hot reload on asset change.
In Go, we are used to dealing with structs in our applications. It's often useful to send structs to our frontend and use them as state in our application. In v1, this was a very manual process and a bit of a burden on the developer. I'm happy to announce that in v2, any application run in dev mode will automatically generate Typescript models for all structs that are input or output parameters to bound methods. This enables seamless interchange of data models between the two worlds.
@@ -133,7 +133,7 @@ In addition to this, another JS module is dynamically generated wrapping all you
<br />
```
Getting an application up and running quickly was always a key goal for the Wails project. When we launched, we tried to cover a lot of the modern frameworks at the time: react, vue and angular. The world of frontend development is very opinionated, fast moving and hard to keep on top of! It also meant that we didn't have cool modern templates for the latest and greatest tech stacks. It also meant that we didn't have cool modern templates for the latest and greatest tech stacks.
Getting an application up and running quickly was always a key goal for the Wails project. When we launched, we tried to cover a lot of the modern frameworks at the time: react, vue and angular. The world of frontend development is very opinionated, fast moving and hard to keep on top of! As a result, we found our base templates getting out of date pretty quickly and this caused a maintenance headache. It also meant that we didn't have cool modern templates for the latest and greatest tech stacks.
With v2, I wanted to empower the community by giving you the ability to create and host templates yourselves, rather than rely on the Wails project. So now you can create projects using community supported templates! I hope this will inspire developers to create a vibrant ecosystem of project templates. I'm really quite excited about what our developer community can create!
@@ -72,7 +72,7 @@ It also provides the additional features:
- Hot reload - Any changes to frontend assets will trigger and auto reload of the application frontend
- Auto rebuild - Any changes to your Go code will rebuild and relaunch your application
In addition to this, a webserver will start on port 34115. All connected web browsers will respond to system events like hot reload on asset change. All connected web browsers will respond to system events like hot reload on asset change.
In addition to this, a webserver will start on port 34115. This will serve your application to any browser that connects to it. All connected web browsers will respond to system events like hot reload on asset change.
In Go, we are used to dealing with structs in our applications. It's often useful to send structs to our frontend and use them as state in our application. In v1, this was a very manual process and a bit of a burden on the developer. I'm happy to announce that in v2, any application run in dev mode will automatically generate Typescript models for all structs that are input or output parameters to bound methods. This enables seamless interchange of data models between the two worlds.
@@ -91,7 +91,7 @@ In addition to this, another JS module is dynamically generated wrapping all you
<br />
```
Getting an application up and running quickly was always a key goal for the Wails project. When we launched, we tried to cover a lot of the modern frameworks at the time: react, vue and angular. The world of frontend development is very opinionated, fast moving and hard to keep on top of! It also meant that we didn't have cool modern templates for the latest and greatest tech stacks. It also meant that we didn't have cool modern templates for the latest and greatest tech stacks.
Getting an application up and running quickly was always a key goal for the Wails project. When we launched, we tried to cover a lot of the modern frameworks at the time: react, vue and angular. The world of frontend development is very opinionated, fast moving and hard to keep on top of! As a result, we found our base templates getting out of date pretty quickly and this caused a maintenance headache. It also meant that we didn't have cool modern templates for the latest and greatest tech stacks.
With v2, I wanted to empower the community by giving you the ability to create and host templates yourselves, rather than rely on the Wails project. So now you can create projects using community supported templates! I hope this will inspire developers to create a vibrant ecosystem of project templates. I'm really quite excited about what our developer community can create!
@@ -59,7 +59,7 @@ It also provides the additional features:
- Hot reload - Any changes to frontend assets will trigger and auto reload of the application frontend
- Auto rebuild - Any changes to your Go code will rebuild and relaunch your application
In addition to this, a webserver will start on port 34115. All connected web browsers will respond to system events like hot reload on asset change. All connected web browsers will respond to system events like hot reload on asset change.
In addition to this, a webserver will start on port 34115. This will serve your application to any browser that connects to it. All connected web browsers will respond to system events like hot reload on asset change.
In Go, we are used to dealing with structs in our applications. It's often useful to send structs to our frontend and use them as state in our application. In v1, this was a very manual process and a bit of a burden on the developer. I'm happy to announce that in v2, any application run in dev mode will automatically generate Typescript models for all structs that are input or output parameters to bound methods. This enables seamless interchange of data models between the two worlds.
@@ -78,7 +78,7 @@ In addition to this, another JS module is dynamically generated wrapping all you
<br />
```
Getting an application up and running quickly was always a key goal for the Wails project. When we launched, we tried to cover a lot of the modern frameworks at the time: react, vue and angular. The world of frontend development is very opinionated, fast moving and hard to keep on top of! It also meant that we didn't have cool modern templates for the latest and greatest tech stacks. It also meant that we didn't have cool modern templates for the latest and greatest tech stacks.
Getting an application up and running quickly was always a key goal for the Wails project. When we launched, we tried to cover a lot of the modern frameworks at the time: react, vue and angular. The world of frontend development is very opinionated, fast moving and hard to keep on top of! As a result, we found our base templates getting out of date pretty quickly and this caused a maintenance headache. It also meant that we didn't have cool modern templates for the latest and greatest tech stacks.
With v2, I wanted to empower the community by giving you the ability to create and host templates yourselves, rather than rely on the Wails project. So now you can create projects using community supported templates! I hope this will inspire developers to create a vibrant ecosystem of project templates. I'm really quite excited about what our developer community can create!
@@ -65,6 +65,7 @@ import TabItem from "@theme/TabItem";
## 任意の依存関係
- [UPX](https://upx.github.io/)を導入することで、構築したアプリを圧縮できます。
- [NSIS](https://wails.io/docs/guides/windows-installer/) for generating Windows installers.
## Wailsのインストール
@@ -8,24 +8,23 @@ The code below shows where these are injected by default:
```html
<html>
<head>
<title>injection example</title>
<link rel="stylesheet" href="/main.css">
<!-- <script src="/wails/ipc.js"></script> -->
<!-- <script src="/wails/runtime.js"></script> -->
</head>
<head>
<title>injection example</title>
<link rel="stylesheet" href="/main.css" />
<!-- <script src="/wails/ipc.js"></script> -->
<!-- <script src="/wails/runtime.js"></script> -->
</head>
<body data-wails-drag>
<div class="logo"></div>
<div class="result" id="result">Please enter your name below 👇</div>
<div class="input-box" id="input" data-wails-no-drag>
<input class="input" id="name" type="text" autocomplete="off">
<button class="btn" onclick="greet()">Greet</button>
</div>
<script src="/main.js"></script>
</body>
<body data-wails-drag>
<div class="logo"></div>
<div class="result" id="result">Please enter your name below 👇</div>
<div class="input-box" id="input" data-wails-no-drag>
<input class="input" id="name" type="text" autocomplete="off" />
<button class="btn" onclick="greet()">Greet</button>
</div>
<script src="/main.js"></script>
</body>
</html>
```
@@ -34,7 +33,7 @@ The code below shows where these are injected by default:
To provide more flexibility to developers, there is a meta tag that may be used to customise this behaviour:
```html
<meta name="wails-options" content="[options]">
<meta name="wails-options" content="[options]" />
```
The options are as follows:
@@ -51,25 +50,23 @@ This code is perfectly valid and operates the same as the autoinjection version:
```html
<html>
<head>
<title>injection example</title>
<meta name="wails-options" content="noautoinject" />
<link rel="stylesheet" href="/main.css" />
</head>
<head>
<title>injection example</title>
<meta name="wails-options" content="noautoinject">
<link rel="stylesheet" href="/main.css">
</head>
<body data-wails-drag>
<div class="logo"></div>
<div class="result" id="result">Please enter your name below 👇</div>
<div class="input-box" id="input" data-wails-no-drag>
<input class="input" id="name" type="text" autocomplete="off">
<button class="btn" onclick="greet()">Greet</button>
</div>
<script src="/wails/ipc.js"></script>
<script src="/wails/runtime.js"></script>
<script src="/main.js"></script>
</body>
<body data-wails-drag>
<div class="logo"></div>
<div class="result" id="result">Please enter your name below 👇</div>
<div class="input-box" id="input" data-wails-no-drag>
<input class="input" id="name" type="text" autocomplete="off" />
<button class="btn" onclick="greet()">Greet</button>
</div>
<script src="/wails/ipc.js"></script>
<script src="/wails/runtime.js"></script>
<script src="/main.js"></script>
</body>
</html>
```
@@ -170,21 +170,21 @@ The format of the file is slightly different. Here is a comparison:
<p align="center">
| v1 | v2 | Notes |
| ------------------ | ---------------- | --------------------------------------------------- |
| name | name | |
| description | | Removed |
| author / name | author / name | |
| author / email | author / email | |
| version | version | |
| binaryname | outputfilename | Changed |
| frontend / dir | | Removed |
| frontend / install | frontend:install | Changed |
| frontend / build | frontend:build | Changed |
| frontend / bridge | | Removed |
| frontend / serve | | Removed |
| tags | | Removed |
| | wailsjsdir | The directory to generate wailsjs modules |
| v1 | v2 | Notes |
| ------------------ | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name | name | |
| description | | Removed |
| author / name | author / name | |
| author / email | author / email | |
| version | version | |
| binaryname | outputfilename | Changed |
| frontend / dir | | Removed |
| frontend / install | frontend:install | Changed |
| frontend / build | frontend:build | Changed |
| frontend / bridge | | Removed |
| frontend / serve | | Removed |
| tags | | Removed |
| | wailsjsdir | The directory to generate wailsjs modules |
| | assetdir | The directory of the compiled frontend assets for `dev` mode. This is normally inferred and could be left empty. |
| | reloaddirs | Comma separated list of additional directories to watch for changes and to trigger reloads in `dev` mode. This is only needed for some more advanced asset configurations. |
@@ -3,7 +3,7 @@
The Wails runtime intercepts mouse clicks to determine whether a frameless window needs resizing or a window needs to be moved. It has been asked how to detect when a mouse click has occurred, because `window.onclick` doesn't report the mouse buttons correctly. The following code shows how to detect mouse clicks:
```javascript
window.addEventListener('mousedown', handleMouseButtonDown);
window.addEventListener("mousedown", handleMouseButtonDown);
function handleMouseButtonDown(event) {
if (event.button === 0) {
@@ -7,14 +7,14 @@ Routing is a popular way to switch views in an application. This page offers som
The recommended approach for routing in Vue is [Hash Mode](https://next.router.vuejs.org/guide/essentials/history-mode.html#hash-mode):
```js
import { createRouter, createWebHashHistory } from 'vue-router'
import { createRouter, createWebHashHistory } from "vue-router";
const router = createRouter({
history: createWebHashHistory(),
routes: [
//...
],
})
});
```
## Angular
@@ -228,16 +228,16 @@ Now we need to configure some gon config files in our `build/darwin` directory:
```json
{
"source" : ["./build/bin/app.app"],
"bundle_id" : "app.myapp",
"apple_id": {
"username": "my-appleid@email.com",
"password": "@env:APPLE_PASSWORD"
},
"sign" :{
"application_identity" : "Developer ID Application: My Name"
}
"source": ["./build/bin/app.app"],
"bundle_id": "app.myapp",
"apple_id": {
"username": "my-appleid@email.com",
"password": "@env:APPLE_PASSWORD"
},
"sign": {
"application_identity": "Developer ID Application: My Name"
}
}
```
Where `source` is your Wails binary, `bundle_id` is your bundle ID, `apple_id` contains your Apple ID username and App-Specific password which you created earlier, and `sign.application_identity` is your identity which you can find by running the following command:
@@ -253,16 +253,16 @@ security find-identity -v -p codesigning
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.files.downloads.read-write</key>
<true/>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.files.downloads.read-write</key>
<true/>
</dict>
</plist>
```
@@ -227,7 +227,7 @@ import {Greet} from '../wailsjs/go/main/App'
Typescript型定義ファイルは、バインドされたメソッドの正しい型を提供します:
```ts
export function Greet(arg1:string):Promise<string>;
export function Greet(arg1: string): Promise<string>;
```
生成されたメソッドはPromiseを返すようになっています。 呼び出しが成功すると、Goからの1番目の返り値が`resolve`ハンドラに渡されます。 呼び出しに失敗したとみなされるのは、Goメソッドの2番目の返り値がerror型で、それがerrorインスタンスを返したときです。 これは、`reject`ハンドラを介して返されます。 先の例では、`Greet`メソッドは`string`型の返り値のみであるため、無効なデータが渡されない限り、Javascript側でrejectハンドラが呼ばれることはありません。
@@ -269,7 +269,7 @@ func (a *App) Greet(p Person) string {
```js title="App.js"
export function Greet(arg1) {
return window['go']['main']['App']['Greet'](arg1);
return window["go"]["main"]["App"]["Greet"](arg1);
}
```
@@ -101,6 +101,9 @@ func main() {
Icon: icon,
WindowIsTranslucent: false,
},
Debug: options.Debug{
OpenInspectorOnStartup: false,
},
})
if err != nil {
log.Fatal(err)
@@ -720,4 +723,16 @@ The icon should be provided in whatever size it was naturally drawn; that is, do
Setting this to `true` will make the window background translucent. Some window managers may ignore it, or result in a black window.
名前: WindowIsTranslucent<br/> データ型: `bool`
名前: WindowIsTranslucent<br/> データ型: `bool`
### デバッグ
This defines [Debug specific options](#Debug) that apply to debug builds.
Name: Debug<br/> Type: `options.Debug`
#### OpenInspectorOnStartup
Setting this to `true` will open the WebInspector on startup of the application.
Name: OpenInspectorOnStartup<br/> Type: `bool`
@@ -34,7 +34,7 @@ Go: `WindowIsFullscreen(ctx context.Context) bool`<br/> JS: `WindowIsFullscreen(
ウィンドウが現在表示されているモニターの中央に、ウィンドウを配置させます。
Go: `WindowReload(ctx context.Context)`<br/> JS: `WindowReload()`
Go: `WindowCenter(ctx context.Context)`<br/> JS: `WindowCenter()`
### WindowExecJS
@@ -48,19 +48,19 @@ Go: `WindowExecJS(ctx context.Context, js string)`
リロードします。(現在表示されているページをリロード)
Go: `WindowReloadApp(ctx context.Context)`<br/> JS: `WindowReloadApp()`
Go: `WindowReload(ctx context.Context)`<br/> JS: `WindowReload()`
### WindowReloadApp
アプリケーションフロントエンドをリロードします。
Go: `WindowSetSystemDefaultTheme(ctx context.Context)`<br/> JS: `WindowSetSystemDefaultTheme()`
Go: `WindowReloadApp(ctx context.Context)`<br/> JS: `WindowReloadApp()`
### WindowSetSystemDefaultTheme
Windowsのみ使用可能。
Go: `WindowSetDarkTheme(ctx context.Context)`<br/> JS: `WindowSetDarkTheme()`
Go: `WindowSetSystemDefaultTheme(ctx context.Context)`<br/> JS: `WindowSetSystemDefaultTheme()`
ウィンドウのテーマをシステムデフォルト(ダーク/ライト) に設定します。
@@ -76,7 +76,7 @@ Go: `WindowSetLightTheme(ctx context.Context)`<br/> JS: `WindowSetLightTheme()`
Windowsのみ使用可能。
Go: `WindowShow(ctx context.Context)`<br/> JS: `WindowShow()`
Go: `WindowSetDarkTheme(ctx context.Context)`<br/> JS: `WindowSetDarkTheme()`
ウィンドウのテーマをダークに設定します。
@@ -84,13 +84,13 @@ Go: `WindowShow(ctx context.Context)`<br/> JS: `WindowShow()`
ウィンドウが非表示になっている場合は、表示させます。
Go: `WindowHide(ctx context.Context)`<br/> JS: `WindowHide()`
Go: `WindowShow(ctx context.Context)`<br/> JS: `WindowShow()`
### WindowHide
現在表示されているウィンドウを非表示にします。
Go: `WindowSetSize(ctx context.Context, width int, height int)`<br/> JS: `WindowSetSize(size: Size)`
Go: `WindowHide(ctx context.Context)`<br/> JS: `WindowHide()`
### WindowIsNormal
@@ -102,7 +102,7 @@ Go: `WindowIsNormal(ctx context.Context) bool`<br/> JS: `WindowIsNormal() bool`
ウィンドウの幅と高さを設定します。
Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`<br/> JS: `WindowSetMaxSize(size: Size)`
Go: `WindowSetSize(ctx context.Context, width int, height int)`<br/> JS: `WindowSetSize(size: Size)`
### WindowGetSize
@@ -116,7 +116,7 @@ Go: `WindowGetSize(ctx context.Context) (width int, height int)`<br/> JS: `Windo
サイズを`0,0`に設定すると、サイズの制約が無効化されます。
Go: `WindowSetAlwaysOnTop(ctx context.Context, b bool)`<br/> JS: `WindowSetAlwaysOnTop(b: Boolen)`
Go: `WindowSetMinSize(ctx context.Context, width int, height int)`<br/> JS: `WindowSetMinSize(size: Size)`
### WindowSetMaxSize
@@ -124,7 +124,7 @@ Go: `WindowSetAlwaysOnTop(ctx context.Context, b bool)`<br/> JS: `WindowSetAlway
サイズを`0,0`に設定すると、サイズの制約が無効化されます。
Go: `WindowSetPosition(ctx context.Context, x int, y int)`<br/> JS: `WindowSetPosition(position: Position)`
Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`<br/> JS: `WindowSetMaxSize(size: Size)`
### WindowSetAlwaysOnTop
@@ -136,7 +136,7 @@ Go: `WindowSetAlwaysOnTop(ctx context.Context, b bool)`<br/> JS: `WindowSetAlway
現在ウィンドウが表示されているモニターに対する、相対的なウィンドウ位置を設定します。
Go: `WindowMaximise(ctx context.Context)`<br/> JS: `WindowMaximise()`
Go: `WindowSetPosition(ctx context.Context, x int, y int)`<br/> JS: `WindowSetPosition(position: Position)`
### WindowGetPosition
@@ -148,13 +148,13 @@ Go: `WindowGetPosition(ctx context.Context) (x int, y int)`<br/> JS: `WindowGetP
ウィンドウを最大化します。
Go: `WindowToggleMaximise(ctx context.Context)`<br/> JS: `WindowToggleMaximise()`
Go: `WindowMaximise(ctx context.Context)`<br/> JS: `WindowMaximise()`
### WindowUnmaximise
ウィンドウの最大化を解除し、最大化する前のサイズおよび位置に戻します。
Go: `WindowMinimise(ctx context.Context)`<br/> JS: `WindowMinimise()`
Go: `WindowUnmaximise(ctx context.Context)`<br/> JS: `WindowUnmaximise()`
### WindowIsMaximised
@@ -172,7 +172,7 @@ Go: `WindowToggleMaximise(ctx context.Context)`<br/> JS: `WindowToggleMaximise()
ウィンドウを最小化します。
Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`<br/> JS: `WindowSetBackgroundColour(R, G, B, A)`
Go: `WindowMinimise(ctx context.Context)`<br/> JS: `WindowMinimise()`
### WindowUnminimise
@@ -206,8 +206,8 @@ Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`<br/> JS:
```ts
interface Position {
x: number;
y: number;
x: number;
y: number;
}
```
@@ -215,7 +215,7 @@ interface Position {
```ts
interface Size {
w: number;
h: number;
w: number;
h: number;
}
```
@@ -13,6 +13,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## [Unreleased]
### Added
- Added `OpenInspectorOnStartup` to debug options to allow opening the WebInspector during startup of the application in debug mode. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2080)
- On macOS `wails doctor` now also shows the version of Xcode installed. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2089)
- The [AssetServer](/docs/reference/options#assetserver) now supports handling range-requests if the [Assets](/docs/reference/options/#assets-1) `fs.FS` provides an `io.ReadSeeker`. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2091)
### Fixed
- The `noreload` flag in wails dev wasn't applied. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2081)
## v2.2.0 - 2022-11-09
### Added
@@ -64,6 +64,7 @@ import TabItem from "@theme/TabItem";
## 可选依赖
- [UPX](https://upx.github.io/) 用于压缩您的应用程序。
- [NSIS](https://wails.io/docs/guides/windows-installer/) 用于生成 Windows 安装程序。
## 安装 Wails
@@ -172,22 +172,22 @@ func main() {
<p align="center">
| v1 | v2 | Notes |
| v1 | v2 | 记录 |
| ------------------ | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name | name | |
| description | | Removed |
| description | | 移除 |
| author / name | author / name | |
| author / email | author / email | |
| version | version | |
| binaryname | outputfilename | Changed |
| frontend / dir | | Removed |
| frontend / install | frontend:install | Changed |
| frontend / build | frontend:build | Changed |
| frontend / bridge | | Removed |
| frontend / serve | | Removed |
| tags | | Removed |
| | wailsjsdir | The directory to generate wailsjs modules |
| | assetdir | The directory of the compiled frontend assets for `dev` mode. This is normally inferred and could be left empty. |
| | reloaddirs | Comma separated list of additional directories to watch for changes and to trigger reloads in `dev` mode. 这只需要一些更重要的资配置。 |
| binaryname | outputfilename | 变更 |
| frontend / dir | | 移除 |
| frontend / install | frontend:install | 变更 |
| frontend / build | frontend:build | 变更 |
| frontend / bridge | | 移除 |
| frontend / serve | | 移除 |
| tags | | 移除 |
| | wailsjsdir | 生成 wailsjs 模块的目录 |
| | assetdir | 为开发模式编译的前端资产的目录。 这通常是推断的,可以留空。 |
| | reloaddirs | 以逗号分隔的附加目录列表,用于监视更改并在开发模式下触发重新加载。 只有一些更高级的资配置才需要这样做。 |
</p>
@@ -101,6 +101,9 @@ func main() {
Icon: icon,
WindowIsTranslucent: false,
},
Debug: options.Debug{
OpenInspectorOnStartup: false,
},
})
if err != nil {
log.Fatal(err)
@@ -736,4 +739,16 @@ func main() {
将此设置为 `true` 将使窗口半透明。 某些窗口管理员可能忽略它,或导致黑窗口。
名称:WindowIsTranslucent<br/> 类型:`bool`
名称:WindowIsTranslucent<br/> 类型:`bool`
### 调试
这定义了用于调试构建的 [调试特定选项](#调试)。
名称: Debug<br/> 类型: `options.Debug`
#### 启动时打开检查器
设置为 `true` 将在应用程序启动时打开 Web 检查器。
名称: OpenInspectorOnStartup<br/> 类型: `bool`
@@ -4,14 +4,22 @@
格式基于 [维护更新日志](https://keepachangelog.com/en/1.0.0/),并且该项目遵循 [语义化版本](https://semver.org/spec/v2.0.0.html)。
- `Added` for new features.
- `Changed` for changes in existing functionality.
- `Deprecated` for soon-to-be removed features.
- `Removed` for now removed features.
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.
- `Added` 新添加的功能。
- `Changed` 对现有功能的变更。
- `Deprecated` 已经不建议使用,即将移除的功能。
- `Removed` 已经移除的功能。
- `Fixed` 对 bug 的修复。
- `Security` 对安全性的改进。
## [Unreleased]
## [即将发布]
### 新增
- 添加 `OpenInspectorOnStartup` 到调试选项以允许在调试模式下启动应用程序期间打开 Web 检查器。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2080) 中添加。
- 在 macOS 上的 `wails doctor`,现在也会显示安装的 Xcode 版本。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2089) 中添加。
- 如果 [Assets](/docs/reference/options/#资产-1) `fs.FS` 提供 `io.ReadSeeker`[AssetServer](/docs/reference/options#资产服务器) 现在支持处理范围请求。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2091) 中添加。
### 修复
- wails dev 中 `noreload` 标志未被应用。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2081) 中修复。
## v2.2.0 - 2022-11-09
+1 -1
View File
@@ -17,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Added `OpenInspectorOnStartup` to debug options to allow opening the WebInspector during startup of the application in debug mode. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2080)
- On macOS `wails doctor` now also shows the version of Xcode installed. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2089)
- The [AssetServer](https://wails.io/docs/reference/options#assetserver) now supports handling range-requests if the [Assets](https://wails.io/docs/reference/options/#assets-1) `fs.FS` provides an `io.ReadSeeker`. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2091)
- The [AssetServer](/docs/reference/options#assetserver) now supports handling range-requests if the [Assets](/docs/reference/options/#assets-1) `fs.FS` provides an `io.ReadSeeker`. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2091)
### Fixed
- The `noreload` flag in wails dev wasn't applied. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2081)