From 767bfcff895b65031c49ce43c9e683c4e935cf74 Mon Sep 17 00:00:00 2001
From: stffabi
Date: Mon, 17 Apr 2023 12:50:27 +0200
Subject: [PATCH 1/7] [v2, windows] Make sure to open the CommonFileDialogs on
the main thread (#2606)
Otherwise it might have some strange side-effects like blocking
the completion of Deferrals in WebView2 when using custom
IStreams.
---
.../frontend/desktop/windows/dialog.go | 108 +++++++++---------
.../frontend/desktop/windows/window.go | 12 ++
website/src/pages/changelog.mdx | 1 +
3 files changed, 67 insertions(+), 54 deletions(-)
diff --git a/v2/internal/frontend/desktop/windows/dialog.go b/v2/internal/frontend/desktop/windows/dialog.go
index ab41df332c6..1ca422b7199 100644
--- a/v2/internal/frontend/desktop/windows/dialog.go
+++ b/v2/internal/frontend/desktop/windows/dialog.go
@@ -4,13 +4,14 @@
package windows
import (
+ "path/filepath"
+ "strings"
+ "syscall"
+
"github.com/wailsapp/wails/v2/internal/frontend"
"github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32"
"github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd"
"golang.org/x/sys/windows"
- "path/filepath"
- "strings"
- "syscall"
)
func (f *Frontend) getHandleForDialog() w32.HWND {
@@ -40,27 +41,20 @@ func (f *Frontend) OpenDirectoryDialog(options frontend.OpenDialogOptions) (stri
Role: "PickFolder",
Folder: defaultFolder,
}
- thisDialog, err := cfd.NewSelectFolderDialog(config)
- if err != nil {
- return "", err
- }
- thisDialog.SetParentWindowHandle(f.getHandleForDialog())
- defer func(thisDialog cfd.SelectFolderDialog) {
- err := thisDialog.Release()
- if err != nil {
- println("ERROR: Unable to release dialog:", err.Error())
- }
- }(thisDialog)
- result, err := thisDialog.ShowAndGetResult()
+
+ result, err := f.showCfdDialog(
+ func() (cfd.Dialog, error) {
+ return cfd.NewSelectFolderDialog(config)
+ }, false)
+
if err != nil && err != cfd.ErrorCancelled {
return "", err
}
- return result, nil
+ return result.(string), nil
}
// OpenFileDialog prompts the user to select a file
func (f *Frontend) OpenFileDialog(options frontend.OpenDialogOptions) (string, error) {
-
defaultFolder, err := getDefaultFolder(options.DefaultDirectory)
if err != nil {
return "", err
@@ -72,22 +66,16 @@ func (f *Frontend) OpenFileDialog(options frontend.OpenDialogOptions) (string, e
FileName: options.DefaultFilename,
Title: options.Title,
}
- thisdialog, err := cfd.NewOpenFileDialog(config)
- if err != nil {
- return "", err
- }
- thisdialog.SetParentWindowHandle(f.getHandleForDialog())
- defer func(thisdialog cfd.OpenFileDialog) {
- err := thisdialog.Release()
- if err != nil {
- println("ERROR: Unable to release dialog:", err.Error())
- }
- }(thisdialog)
- result, err := thisdialog.ShowAndGetResult()
+
+ result, err := f.showCfdDialog(
+ func() (cfd.Dialog, error) {
+ return cfd.NewOpenFileDialog(config)
+ }, false)
+
if err != nil && err != cfd.ErrorCancelled {
return "", err
}
- return result, nil
+ return result.(string), nil
}
// OpenMultipleFilesDialog prompts the user to select a file
@@ -105,22 +93,16 @@ func (f *Frontend) OpenMultipleFilesDialog(options frontend.OpenDialogOptions) (
FileName: options.DefaultFilename,
Folder: defaultFolder,
}
- thisdialog, err := cfd.NewOpenMultipleFilesDialog(config)
- if err != nil {
- return nil, err
- }
- thisdialog.SetParentWindowHandle(f.getHandleForDialog())
- defer func(thisdialog cfd.OpenMultipleFilesDialog) {
- err := thisdialog.Release()
- if err != nil {
- println("ERROR: Unable to release dialog:", err.Error())
- }
- }(thisdialog)
- result, err := thisdialog.ShowAndGetResults()
+
+ result, err := f.showCfdDialog(
+ func() (cfd.Dialog, error) {
+ return cfd.NewOpenMultipleFilesDialog(config)
+ }, true)
+
if err != nil && err != cfd.ErrorCancelled {
return nil, err
}
- return result, nil
+ return result.([]string), nil
}
// SaveFileDialog prompts the user to select a file
@@ -131,26 +113,44 @@ func (f *Frontend) SaveFileDialog(options frontend.SaveDialogOptions) (string, e
return "", err
}
- saveDialog, err := cfd.NewSaveFileDialog(cfd.DialogConfig{
+ config := cfd.DialogConfig{
Title: options.Title,
Role: "SaveFile",
FileFilters: convertFilters(options.Filters),
FileName: options.DefaultFilename,
Folder: defaultFolder,
- })
- if err != nil {
- return "", err
}
- saveDialog.SetParentWindowHandle(f.getHandleForDialog())
- err = saveDialog.Show()
- if err != nil {
- return "", err
- }
- result, err := saveDialog.GetResult()
+
+ result, err := f.showCfdDialog(
+ func() (cfd.Dialog, error) {
+ return cfd.NewSaveFileDialog(config)
+ }, false)
+
if err != nil && err != cfd.ErrorCancelled {
return "", err
}
- return result, nil
+ return result.(string), nil
+}
+
+func (f *Frontend) showCfdDialog(newDlg func() (cfd.Dialog, error), isMultiSelect bool) (any, error) {
+ return invokeSync(f.mainWindow, func() (any, error) {
+ dlg, err := newDlg()
+ if err != nil {
+ return nil, err
+ }
+ defer func() {
+ err := dlg.Release()
+ if err != nil {
+ println("ERROR: Unable to release dialog:", err.Error())
+ }
+ }()
+
+ dlg.SetParentWindowHandle(f.getHandleForDialog())
+ if multi, _ := dlg.(cfd.OpenMultipleFilesDialog); multi != nil && isMultiSelect {
+ return multi.ShowAndGetResults()
+ }
+ return dlg.ShowAndGetResult()
+ })
}
func calculateMessageDialogFlags(options frontend.MessageDialogOptions) uint32 {
diff --git a/v2/internal/frontend/desktop/windows/window.go b/v2/internal/frontend/desktop/windows/window.go
index 9080009a981..43ec57c7250 100644
--- a/v2/internal/frontend/desktop/windows/window.go
+++ b/v2/internal/frontend/desktop/windows/window.go
@@ -3,6 +3,7 @@
package windows
import (
+ "sync"
"unsafe"
"github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/go-webview2/pkg/edge"
@@ -323,3 +324,14 @@ func (w *Window) SetTheme(theme winoptions.Theme) {
w.UpdateTheme()
})
}
+
+func invokeSync[T any](cba *Window, fn func() (T, error)) (res T, err error) {
+ var wg sync.WaitGroup
+ wg.Add(1)
+ cba.Invoke(func() {
+ res, err = fn()
+ wg.Done()
+ })
+ wg.Wait()
+ return res, err
+}
diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx
index 54f5344fe93..0a0ab8359f7 100644
--- a/website/src/pages/changelog.mdx
+++ b/website/src/pages/changelog.mdx
@@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed `-skipbindings` flag in `wails dev`. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2584)
- Fixed `runtime.MenuUpdateApplicationMenu` on macOS. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2588)
- Fixed add package name for `libwebkit`/`pkg-config` and use shell.RunCommandWithENV instead of shell.RunCommand in `zypper.go`. Fixed by @wgjtyu in [PR](https://github.com/wailsapp/wails/pull/2593)
+- Make sure to start the CommonFileDialogs on Windows on the Main-Thread. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2606)
## v2.4.1 - 2023-03-20
From a1cc41c92660c74c8d8392ad01b0bbebc085f478 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Mon, 17 Apr 2023 20:51:33 +1000
Subject: [PATCH 2/7] chore: update sponsors.svg (#2603)
Co-authored-by: leaanthony
---
website/static/img/sponsors.svg | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/website/static/img/sponsors.svg b/website/static/img/sponsors.svg
index 6cc79ab6c22..28b5a199e92 100644
--- a/website/static/img/sponsors.svg
+++ b/website/static/img/sponsors.svg
@@ -102,38 +102,42 @@ text {
+
From d8d499753256cb7a0e1c02992310eb3dd1200c0a Mon Sep 17 00:00:00 2001
From: Misite Bao
Date: Mon, 17 Apr 2023 18:54:06 +0800
Subject: [PATCH 3/7] chore: optimize website building process (#2601)
* chore: remove pnpm from dependencies
* chore: upgrade devDependencies
* chore: set Nodejs version
---
website/.npmrc | 1 -
website/.nvmrc | 1 +
website/package.json | 5 +-
website/pnpm-lock.yaml | 166 +++++++++++++++++++++++++++++------------
4 files changed, 121 insertions(+), 52 deletions(-)
delete mode 100644 website/.npmrc
create mode 100644 website/.nvmrc
diff --git a/website/.npmrc b/website/.npmrc
deleted file mode 100644
index 3e775efb0f4..00000000000
--- a/website/.npmrc
+++ /dev/null
@@ -1 +0,0 @@
-auto-install-peers=true
diff --git a/website/.nvmrc b/website/.nvmrc
new file mode 100644
index 00000000000..741b4916ea8
--- /dev/null
+++ b/website/.nvmrc
@@ -0,0 +1 @@
+18.14.0
\ No newline at end of file
diff --git a/website/package.json b/website/package.json
index c761c8c279a..fc9dc3ce4d4 100644
--- a/website/package.json
+++ b/website/package.json
@@ -28,7 +28,6 @@
"@swc/core": "^1.3.7",
"clsx": "^1.2.1",
"file-loader": "^6.2.0",
- "pnpm": "^8.0.0",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
@@ -48,7 +47,7 @@
]
},
"devDependencies": {
- "@crowdin/cli": "^3.8.1",
- "prettier": "^2.7.1"
+ "@crowdin/cli": "^3.10.1",
+ "prettier": "^2.8.7"
}
}
diff --git a/website/pnpm-lock.yaml b/website/pnpm-lock.yaml
index 589da69a6a4..d1d695f252a 100644
--- a/website/pnpm-lock.yaml
+++ b/website/pnpm-lock.yaml
@@ -24,10 +24,7 @@ dependencies:
version: 1.2.1
file-loader:
specifier: ^6.2.0
- version: 6.2.0(webpack@5.78.0)
- pnpm:
- specifier: ^8.0.0
- version: 8.0.0
+ version: 6.2.0(webpack@5.79.0)
prism-react-renderer:
specifier: ^1.3.5
version: 1.3.5(react@17.0.2)
@@ -42,15 +39,15 @@ dependencies:
version: 3.2.23
swc-loader:
specifier: ^0.2.3
- version: 0.2.3(@swc/core@1.3.7)(webpack@5.78.0)
+ version: 0.2.3(@swc/core@1.3.7)(webpack@5.79.0)
devDependencies:
'@crowdin/cli':
- specifier: ^3.8.1
- version: 3.8.1
+ specifier: ^3.10.1
+ version: 3.10.1
prettier:
- specifier: ^2.7.1
- version: 2.7.1
+ specifier: ^2.8.7
+ version: 2.8.7
packages:
@@ -1543,12 +1540,15 @@ packages:
dev: false
optional: true
- /@crowdin/cli@3.8.1:
- resolution: {integrity: sha512-kSohd26AKqXVNo+G48C1cv+/TPBks44YbD2+nQLm8d/mUGGazhYHY6k6wU7yP+vkaT/F5WeL3br5Sffn0QoxRg==}
+ /@crowdin/cli@3.10.1:
+ resolution: {integrity: sha512-CBzABy2voC+T1KpgQYI1DIBGANahG9Vuwiqp0GJERVAWhqp1Tveie3N2rCkzjZT8N8E5SHp/z+OpstrdZYOA+g==}
hasBin: true
dependencies:
- njre: 0.2.0
+ command-exists-promise: 2.0.2
+ node-fetch: 2.6.7
shelljs: 0.8.5
+ tar: 4.4.19
+ yauzl: 2.10.0
transitivePeerDependencies:
- encoding
dev: true
@@ -2131,7 +2131,7 @@ packages:
peerDependencies:
react: '*'
dependencies:
- '@types/react': 18.0.34
+ '@types/react': 18.0.35
prop-types: 15.8.1
react: 17.0.2
dev: false
@@ -2948,6 +2948,10 @@ packages:
resolution: {integrity: sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==}
dev: false
+ /@types/estree@1.0.0:
+ resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==}
+ dev: false
+
/@types/express-serve-static-core@4.17.33:
resolution: {integrity: sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA==}
dependencies:
@@ -3080,6 +3084,14 @@ packages:
csstype: 3.1.2
dev: false
+ /@types/react@18.0.35:
+ resolution: {integrity: sha512-6Laome31HpetaIUGFWl1VQ3mdSImwxtFZ39rh059a1MNnKGqBpC88J6NJ8n/Is3Qx7CefDGLgf/KhN/sYCf7ag==}
+ dependencies:
+ '@types/prop-types': 15.7.5
+ '@types/scheduler': 0.16.3
+ csstype: 3.1.2
+ dev: false
+
/@types/responselike@1.0.0:
resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==}
dependencies:
@@ -4624,6 +4636,10 @@ packages:
resolution: {integrity: sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==}
dev: false
+ /es-module-lexer@1.2.1:
+ resolution: {integrity: sha512-9978wrXM50Y4rTMmW5kXIC09ZdXQZqkE4mxhwkd8VbzsGkXGPgV4zWuqQJgCEzYngdo2dYDa0l8xhX4fkSwJSg==}
+ dev: false
+
/escalade@3.1.1:
resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==}
engines: {node: '>=6'}
@@ -4864,6 +4880,17 @@ packages:
webpack: 5.78.0(@swc/core@1.3.7)
dev: false
+ /file-loader@6.2.0(webpack@5.79.0):
+ resolution: {integrity: sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==}
+ engines: {node: '>= 10.13.0'}
+ peerDependencies:
+ webpack: ^4.0.0 || ^5.0.0
+ dependencies:
+ loader-utils: 2.0.4
+ schema-utils: 3.1.1
+ webpack: 5.79.0(@swc/core@1.3.7)
+ dev: false
+
/filesize@8.0.7:
resolution: {integrity: sha512-pjmC+bkIF8XI7fWaH8KxHcZL3DPybs1roSKP4rKDvy20tAWwIObE4+JIseG2byfGKhud5ZnM4YSGKBz7Sh0ndQ==}
engines: {node: '>= 0.4.0'}
@@ -6203,18 +6230,6 @@ packages:
resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==}
dev: false
- /njre@0.2.0:
- resolution: {integrity: sha512-+Wq8R6VmjK+jI8a9NdzfU6Vh50r3tjsdvl5KJE1OyHeH8I/nx5Ptm12qpO3qNUbstXuZfBDgDL0qQZw9JyjhMw==}
- engines: {node: '>=8'}
- dependencies:
- command-exists-promise: 2.0.2
- node-fetch: 2.6.9
- tar: 4.4.19
- yauzl: 2.10.0
- transitivePeerDependencies:
- - encoding
- dev: true
-
/no-case@3.0.4:
resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==}
dependencies:
@@ -6238,19 +6253,6 @@ packages:
optional: true
dependencies:
whatwg-url: 5.0.0
- dev: false
-
- /node-fetch@2.6.9:
- resolution: {integrity: sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg==}
- engines: {node: 4.x || >=6.0.0}
- peerDependencies:
- encoding: ^0.1.0
- peerDependenciesMeta:
- encoding:
- optional: true
- dependencies:
- whatwg-url: 5.0.0
- dev: true
/node-forge@1.3.1:
resolution: {integrity: sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==}
@@ -6574,12 +6576,6 @@ packages:
find-up: 3.0.0
dev: false
- /pnpm@8.0.0:
- resolution: {integrity: sha512-Crsvd8LKb+SoEB/bQxRZrtSt5Ri8g9jmPg6MKyexMTI1pdLd44gPwVV6cZLq2jYYPv5q+gADPkYTbYr8SeFCeA==}
- engines: {node: '>=16.14'}
- hasBin: true
- dev: false
-
/postcss-calc@8.2.4(postcss@8.4.21):
resolution: {integrity: sha512-SmWMSJmB8MRnnULldx0lQIyhSNvuDl9HfrZkaqqE/WHAhToYsAvDq+yAsA/kIyINDszOp3Rh0GFoNuH5Ypsm3Q==}
peerDependencies:
@@ -7005,8 +7001,8 @@ packages:
engines: {node: '>=4'}
dev: false
- /prettier@2.7.1:
- resolution: {integrity: sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==}
+ /prettier@2.8.7:
+ resolution: {integrity: sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==}
engines: {node: '>=10.13.0'}
hasBin: true
dev: true
@@ -7659,6 +7655,15 @@ packages:
ajv-keywords: 3.5.2(ajv@6.12.6)
dev: false
+ /schema-utils@3.1.2:
+ resolution: {integrity: sha512-pvjEHOgWc9OWA/f/DE3ohBWTD6EleVLf7iFUkoSwAxttdBhB9QUebQgxER2kWueOvRJXPHNnyrvvh9eZINB8Eg==}
+ engines: {node: '>= 10.13.0'}
+ dependencies:
+ '@types/json-schema': 7.0.11
+ ajv: 6.12.6
+ ajv-keywords: 3.5.2(ajv@6.12.6)
+ dev: false
+
/schema-utils@4.0.0:
resolution: {integrity: sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg==}
engines: {node: '>= 12.13.0'}
@@ -8099,14 +8104,14 @@ packages:
stable: 0.1.8
dev: false
- /swc-loader@0.2.3(@swc/core@1.3.7)(webpack@5.78.0):
+ /swc-loader@0.2.3(@swc/core@1.3.7)(webpack@5.79.0):
resolution: {integrity: sha512-D1p6XXURfSPleZZA/Lipb3A8pZ17fP4NObZvFCDjK/OKljroqDpPmsBdTraWhVBqUNpcWBQY1imWdoPScRlQ7A==}
peerDependencies:
'@swc/core': ^1.2.147
webpack: '>=2'
dependencies:
'@swc/core': 1.3.7
- webpack: 5.78.0(@swc/core@1.3.7)
+ webpack: 5.79.0(@swc/core@1.3.7)
dev: false
/tapable@1.1.3:
@@ -8157,6 +8162,31 @@ packages:
webpack: 5.78.0(@swc/core@1.3.7)
dev: false
+ /terser-webpack-plugin@5.3.7(@swc/core@1.3.7)(webpack@5.79.0):
+ resolution: {integrity: sha512-AfKwIktyP7Cu50xNjXF/6Qb5lBNzYaWpU6YfoX3uZicTx0zTy0stDDCsvjDapKsSDvOeWo5MEq4TmdBy2cNoHw==}
+ engines: {node: '>= 10.13.0'}
+ peerDependencies:
+ '@swc/core': '*'
+ esbuild: '*'
+ uglify-js: '*'
+ webpack: ^5.1.0
+ peerDependenciesMeta:
+ '@swc/core':
+ optional: true
+ esbuild:
+ optional: true
+ uglify-js:
+ optional: true
+ dependencies:
+ '@jridgewell/trace-mapping': 0.3.18
+ '@swc/core': 1.3.7
+ jest-worker: 27.5.1
+ schema-utils: 3.1.1
+ serialize-javascript: 6.0.1
+ terser: 5.16.9
+ webpack: 5.79.0(@swc/core@1.3.7)
+ dev: false
+
/terser@5.16.9:
resolution: {integrity: sha512-HPa/FdTB9XGI2H1/keLFZHxl6WNvAI4YalHGtDQTlMnJcoqSab1UwL4l1hGEhs6/GmLHBZIg/YgB++jcbzoOEg==}
engines: {node: '>=10'}
@@ -8748,6 +8778,46 @@ packages:
- uglify-js
dev: false
+ /webpack@5.79.0(@swc/core@1.3.7):
+ resolution: {integrity: sha512-3mN4rR2Xq+INd6NnYuL9RC9GAmc1ROPKJoHhrZ4pAjdMFEkJJWrsPw8o2JjCIyQyTu7rTXYn4VG6OpyB3CobZg==}
+ engines: {node: '>=10.13.0'}
+ hasBin: true
+ peerDependencies:
+ webpack-cli: '*'
+ peerDependenciesMeta:
+ webpack-cli:
+ optional: true
+ dependencies:
+ '@types/eslint-scope': 3.7.4
+ '@types/estree': 1.0.0
+ '@webassemblyjs/ast': 1.11.1
+ '@webassemblyjs/wasm-edit': 1.11.1
+ '@webassemblyjs/wasm-parser': 1.11.1
+ acorn: 8.8.2
+ acorn-import-assertions: 1.8.0(acorn@8.8.2)
+ browserslist: 4.21.5
+ chrome-trace-event: 1.0.3
+ enhanced-resolve: 5.12.0
+ es-module-lexer: 1.2.1
+ eslint-scope: 5.1.1
+ events: 3.3.0
+ glob-to-regexp: 0.4.1
+ graceful-fs: 4.2.11
+ json-parse-even-better-errors: 2.3.1
+ loader-runner: 4.3.0
+ mime-types: 2.1.35
+ neo-async: 2.6.2
+ schema-utils: 3.1.2
+ tapable: 2.2.1
+ terser-webpack-plugin: 5.3.7(@swc/core@1.3.7)(webpack@5.79.0)
+ watchpack: 2.4.0
+ webpack-sources: 3.2.3
+ transitivePeerDependencies:
+ - '@swc/core'
+ - esbuild
+ - uglify-js
+ dev: false
+
/webpackbar@5.0.2(webpack@5.78.0):
resolution: {integrity: sha512-BmFJo7veBDgQzfWXl/wwYXr/VFus0614qZ8i9znqcl9fnEdiVkdbi0TedLQ6xAK92HZHDJ0QmyQ0fmuZPAgCYQ==}
engines: {node: '>=12'}
From c7e5608a600431321e8e51ee84738be878d993e0 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Mon, 17 Apr 2023 23:48:27 +1000
Subject: [PATCH 4/7] docs: sync translations (#2581)
Co-authored-by: misitebao
---
website/i18n/fr/code.json | 10 ++++-
.../2023-01-17-v3-roadmap.mdx | 16 ++++----
.../current/community/links.mdx | 2 +-
.../current/community/templates.mdx | 6 +++
.../current/gettingstarted/installation.mdx | 2 +-
.../current/guides/routing.mdx | 2 +-
.../current/reference/menus.mdx | 7 +++-
.../current/reference/options.mdx | 7 ++--
.../changelog.mdx | 24 ++++++++++-
.../community-guide.mdx | 4 +-
.../credits.mdx | 13 ++----
.../docusaurus-plugin-content-pages/faq.mdx | 2 +-
.../fr/docusaurus-theme-classic/footer.json | 4 ++
.../fr/docusaurus-theme-classic/navbar.json | 4 ++
website/i18n/ja/code.json | 10 ++++-
.../current/community/templates.mdx | 6 +++
.../current/guides/routing.mdx | 2 +-
.../current/reference/menus.mdx | 7 +++-
.../current/reference/options.mdx | 5 ++-
.../current/reference/project-config.mdx | 11 +++--
.../changelog.mdx | 24 ++++++++++-
.../community-guide.mdx | 40 +++++++++----------
.../credits.mdx | 9 +----
.../ja/docusaurus-theme-classic/footer.json | 4 ++
.../ja/docusaurus-theme-classic/navbar.json | 4 ++
website/i18n/ko/code.json | 10 ++++-
.../current/community/templates.mdx | 6 +++
.../current/guides/routing.mdx | 2 +-
.../current/reference/menus.mdx | 7 +++-
.../current/reference/options.mdx | 7 ++--
.../changelog.mdx | 24 ++++++++++-
.../credits.mdx | 9 +----
.../ko/docusaurus-theme-classic/footer.json | 4 ++
.../ko/docusaurus-theme-classic/navbar.json | 4 ++
website/i18n/pt/code.json | 10 ++++-
.../current/community/templates.mdx | 6 +++
.../current/guides/routing.mdx | 2 +-
.../current/reference/menus.mdx | 7 +++-
.../current/reference/options.mdx | 7 ++--
.../changelog.mdx | 24 ++++++++++-
.../credits.mdx | 9 +----
.../pt/docusaurus-theme-classic/footer.json | 4 ++
.../pt/docusaurus-theme-classic/navbar.json | 4 ++
website/i18n/ru/code.json | 10 ++++-
.../current/community/templates.mdx | 6 +++
.../current/guides/routing.mdx | 2 +-
.../current/reference/menus.mdx | 7 +++-
.../current/reference/options.mdx | 7 ++--
.../changelog.mdx | 24 ++++++++++-
.../credits.mdx | 9 +----
.../ru/docusaurus-theme-classic/footer.json | 4 ++
.../ru/docusaurus-theme-classic/navbar.json | 4 ++
website/i18n/zh-Hans/code.json | 10 ++++-
.../current/community/showcase/emailit.mdx | 2 +-
.../community/showcase/encrypteasy.mdx | 4 +-
.../current/community/showcase/filehound.mdx | 8 ++--
.../community/showcase/modalfilemanager.mdx | 4 +-
.../current/community/templates.mdx | 6 +++
.../current/guides/routing.mdx | 2 +-
.../current/reference/menus.mdx | 7 +++-
.../current/reference/options.mdx | 11 ++---
.../current/reference/project-config.mdx | 26 +++++++-----
.../changelog.mdx | 24 ++++++++++-
.../credits.mdx | 9 +----
.../docusaurus-theme-classic/footer.json | 4 ++
.../docusaurus-theme-classic/navbar.json | 4 ++
66 files changed, 415 insertions(+), 150 deletions(-)
diff --git a/website/i18n/fr/code.json b/website/i18n/fr/code.json
index 4be2ef0b08b..e7d0813e875 100644
--- a/website/i18n/fr/code.json
+++ b/website/i18n/fr/code.json
@@ -32,7 +32,7 @@
},
"theme.ErrorPageContent.tryAgain": {
"message": "Réessayer",
- "description": "The label of the button to try again when the page crashed"
+ "description": "The label of the button to try again rendering when the React error boundary captures an error"
},
"theme.NotFound.title": {
"message": "Page non trouvée",
@@ -419,5 +419,13 @@
"theme.docs.sidebar.toggleSidebarButtonAriaLabel": {
"message": "Ouvrir/fermer la barre de navigation",
"description": "The ARIA label for hamburger menu button of mobile navigation"
+ },
+ "theme.NavBar.navAriaLabel": {
+ "message": "Main",
+ "description": "The ARIA label for the main navigation"
+ },
+ "theme.docs.sidebar.navAriaLabel": {
+ "message": "Docs sidebar",
+ "description": "The ARIA label for the sidebar navigation"
}
}
diff --git a/website/i18n/fr/docusaurus-plugin-content-blog/2023-01-17-v3-roadmap.mdx b/website/i18n/fr/docusaurus-plugin-content-blog/2023-01-17-v3-roadmap.mdx
index 9a137d09a8c..0cd8312e29b 100644
--- a/website/i18n/fr/docusaurus-plugin-content-blog/2023-01-17-v3-roadmap.mdx
+++ b/website/i18n/fr/docusaurus-plugin-content-blog/2023-01-17-v3-roadmap.mdx
@@ -1,6 +1,6 @@
---
slug: the-road-to-wails-v3
-title: The Road to Wails v3
+title: La route vers Wails v3
authors:
- leaanthony
tags:
@@ -20,9 +20,9 @@ tags:
# Introduction
-Wails is a project that simplifies the ability to write cross-platform desktop applications using Go. It uses native webview components for the frontend (not embedded browsers), bringing the power of the world's most popular UI system to Go, whilst remaining lightweight.
+Wails est un projet qui simplifie la possibilité d'écrire des applications de bureau inter-plateformes en utilisant Go. It uses native webview components for the frontend (not embedded browsers), bringing the power of the world's most popular UI system to Go, whilst remaining lightweight.
-Version 2 was released on the 22nd of September 2022 and brought with it a lot of enhancements including:
+La version 2 a été publiée le 22 septembre 2022 et a apporté de nombreuses améliorations y compris :
- Live development, leveraging the popular Vite project
- Rich functionality for managing windows and creating menus
@@ -35,13 +35,13 @@ Right now, Wails v2 provides powerful tooling for creating rich, cross-platform
This blog post aims to look at where the project is at right now and what we can improve on moving forward.
-# Where are we now?
+# Où en sommes-nous actuellement?
It's been incredible to see the popularity of Wails rising since the v2 release. I'm constantly amazed by the creativity of the community and the wonderful things that are being built with it. With more popularity, comes more eyes on the project. And with that, more feature requests and bug reports.
Over time, I've been able to identify some of the most pressing issues facing the project. I've also been able to identify some of the things that are holding the project back.
-## Current issues
+## Problèmes actuels
I've identified the following areas that I feel are holding the project back:
@@ -161,11 +161,11 @@ Benefits to the project maintainers are:
- The new build system will be much easier to maintain and extend. I hope this will lead to a new ecosystem of community driven build pipelines.
- Better separation of concerns within the project. This will make it easier to add new features and platforms.
-## The Plan
+## Le Plan
A lot of the experimentation for this has already been done and it's looking good. There is no current timeline for this work but I'm hoping by the end of Q1 2023, there will be an alpha release for Mac to allow the community to test, experiment with and provide feedback.
-## Summary
+## Résumé
- The v2 API is declarative, hides a lot from the developer and not suitable for features such as multiple windows. A new API will be created which will be simpler, intuitive and more powerful.
- The build system is opaque and difficult to customise so we will move to an external build system which will open it all up.
@@ -175,7 +175,7 @@ There has been a lot of work put into the guts of v2 and it's solid. It's now ti
I hope you are as excited about this as I am. I'm looking forward to hearing your thoughts and feedback.
-Regards,
+Cordialement,
‐ Lea
diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/links.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/links.mdx
index d8dba1b191e..d6b742435e4 100644
--- a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/links.mdx
+++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/links.mdx
@@ -12,7 +12,7 @@ La [liste définitive](https://github.com/wailsapp/awesome-wails) de liens relat
## Canaux de support
-- [Wails Discord Server](https://discord.gg/JDdSxwjhGf)
+- [Serveur Discord Wails](https://discord.gg/JDdSxwjhGf)
- [Github Issues](https://github.com/wailsapp/wails/issues)
- [canal de discussion sur la bêta v2](https://github.com/wailsapp/wails/discussions/828)
diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/templates.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/templates.mdx
index 825386b7895..a2bf2b75742 100644
--- a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/templates.mdx
+++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/templates.mdx
@@ -31,6 +31,7 @@ Si vous n'êtes pas sûr d'un modèle, inspectez `package.json` et `wails.json`
## Angular
+- [wails-template-angular](https://github.com/mateothegreat/wails-template-angular) - Modèle Angular 15+ prêt à être utilisé en production.
- [wails-angular-template](https://github.com/TAINCER/wails-angular-template) - Angular avec TypeScript, Sass, rechargement à chaud, découpage dynamique de code et i18n
## React
@@ -47,6 +48,11 @@ Si vous n'êtes pas sûr d'un modèle, inspectez `package.json` et `wails.json`
- [wails-vite-svelte-tailwind-template](https://github.com/BillBuilt/wails-vite-svelte-tailwind-template) - Un modèle utilisant Svelte et Vite avec TailwindCSS v3
- [wails-sveltekit-template](https://github.com/h8gi/wails-sveltekit-template) - Un modèle utilisant SvelteKit
+## Solid
+
+- [wails-template-vite-solid-ts](https://github.com/xijaja/wails-template-solid-ts) - Un modèle utilisant Solid + Ts + Vite
+- [wails-template-vite-solid-ts](https://github.com/xijaja/wails-template-solid-js) - Un modèle utilisant Solid + Js + Vite
+
## Elm
- [wails-elm-template](https://github.com/benjamin-thomas/wails-elm-template) - Développez votre application GUI avec de la programmation fonctionnelle et une configuration de développement en direct :tada: :rocket:
diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/gettingstarted/installation.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/gettingstarted/installation.mdx
index 668ce4ce708..86ffde34bde 100644
--- a/website/i18n/fr/docusaurus-plugin-content-docs/current/gettingstarted/installation.mdx
+++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/gettingstarted/installation.mdx
@@ -57,7 +57,7 @@ import TabItem from "@theme/TabItem";
Wails a besoin que WebView2 runtime soit installé. Certaines installations de Windows auront déjà installé cette fonctionnalité. Vous pouvez vérifier en utilisant la commande wails doctor
.
- Linux requires the standard gcc
build tools plus libgtk3
and libwebkit
. Plutôt que de lister une tonne de commandes pour différentes distributions, Wails peut essayer de déterminer ce que sont les commandes d'installation pour votre distribution spécifique. Exécutez wails doctor
après l'installation pour voir de quelles dépendances vous avez besoin. Si votre gestionnaire de distribution/paquet n'est pas pris en charge, veuillez consulter le guide Ajouter une distribution Linux.
+ Linux a besoin de gcc
comme outil de compilation en plus de libgtk3
et libwebkit
. Plutôt que de lister une tonne de commandes pour différentes distributions, Wails peut essayer de déterminer ce que sont les commandes d'installation pour votre distribution. Exécutez wails doctor
après l'installation pour voir de quelles dépendances vous avez besoin. Si votre gestionnaire de distribution/paquet n'est pas pris en charge, veuillez consulter le guide Ajouter une distribution Linux.
```
diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/routing.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/routing.mdx
index c35cc1c8a4d..ce176943ea5 100644
--- a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/routing.mdx
+++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/routing.mdx
@@ -27,7 +27,7 @@ RouterModule.forRoot(routes, { useHash: true });
## React
-The recommended approach for routing in React is [HashRouter](https://reactrouter.com/docs/en/v6/routers/hash-router):
+The recommended approach for routing in React is [HashRouter](https://reactrouter.com/en/main/router-components/hash-router):
```jsx
import { HashRouter } from "react-router-dom";
diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/menus.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/menus.mdx
index 34c6d96a562..80dbaa0c5cf 100644
--- a/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/menus.mdx
+++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/menus.mdx
@@ -9,12 +9,15 @@ Il est possible d'ajouter un menu applicatif aux projets Wails. Ceci est réalis
Un exemple de définition d'un menu :
```go
+
+ app := NewApp()
+
AppMenu := menu.NewMenu()
FileMenu := AppMenu.AddSubmenu("File")
FileMenu.AddText("&Open", keys.CmdOrCtrl("o"), openFile)
FileMenu.AddSeparator()
FileMenu.AddText("Quit", keys.CmdOrCtrl("q"), func(_ *menu.CallbackData) {
- runtime.Quit()
+ runtime.Quit(app.ctx)
})
if runtime.GOOS == "darwin" {
@@ -25,7 +28,7 @@ Un exemple de définition d'un menu :
Title: "Menus Demo",
Width: 800,
Height: 600,
- Menu: AppMenu,
+ Menu: AppMenu, // reference the menu above
Bind: []interface{}{
app,
},
diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/options.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/options.mdx
index 76b2a3a21f1..89e2bcf4263 100644
--- a/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/options.mdx
+++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/options.mdx
@@ -234,8 +234,8 @@ Toutes les fonctionnalités d'une `http.Request` ne sont pas actuellement prises
| PATCH | ✅ | ✅ | ✅ [^1] |
| DELETE | ✅ | ✅ | ✅ [^1] |
| Request Headers | ✅ | ✅ | ✅ [^1] |
-| Request Body | ✅ | ✅ | ❌ |
-| Request Body Streaming | ✅ | ✅ | ❌ |
+| Request Body | ✅ | ✅ | ✅ [^2] |
+| Request Body Streaming | ✅ | ✅ | ✅ [^2] |
| Response StatusCodes | ✅ | ✅ | ✅ [^1] |
| Response Headers | ✅ | ✅ | ✅ [^1] |
| Response Body | ✅ | ✅ | ✅ |
@@ -763,4 +763,5 @@ Définir cette option à `true` ouvrira l'inspecteur Web au démarrage de l'appl
Nom: OpenInspectorOnStartup
Type: `bool`
-[^1]: Cela nécessite la prise en charge de WebKit2GTK 2.36+ et votre application doit être construite avec la balise de compilation `webkit2_36` pour activer le support de cette fonctionnalité. Cela augmente aussi la version minnimale de WebKit2GTK à 2.36 pour votre application.
+[^1]: This requires WebKit2GTK 2.36+ support and your app needs to be build with the build tag `webkit2_36` to activate support for this feature. This also bumps the minimum requirement of WebKit2GTK to 2.36 for your app.
+[^2]: This requires WebKit2GTK 2.40+ support and your app needs to be build with the build tag `webkit2_40` to activate support for this feature. This also bumps the minimum requirement of WebKit2GTK to 2.40 for your app.
diff --git a/website/i18n/fr/docusaurus-plugin-content-pages/changelog.mdx b/website/i18n/fr/docusaurus-plugin-content-pages/changelog.mdx
index aa736d1dae2..abcfd887a3f 100644
--- a/website/i18n/fr/docusaurus-plugin-content-pages/changelog.mdx
+++ b/website/i18n/fr/docusaurus-plugin-content-pages/changelog.mdx
@@ -13,28 +13,46 @@ Le format est basé sur [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
## [Unreleased]
+### Ajouts
+
+- Added Nodejs version in `wails doctor`. Added by @misitebao in [PR](https://github.com/wailsapp/wails/pull/2546)
+- Added support for WebKit2GTK 2.40+ on Linux. This brings additional features for the [AssetServer](/docs/reference/options#assetserver), like support for HTTP Request Bodies. The app must be compiled with the Go build tag `webkit2_40` to activate support for this features. This also bumps the minimum requirement of WebKit2GTK to 2.40 for your app. Added by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2592)
+
### Changements
+
- [v3] Typescript model generation using `StructDef`s from new AST-based parser. Added by @ATenderholt in [PR1](https://github.com/wailsapp/wails/pull/2428/files) and [PR2](https://github.com/wailsapp/wails/pull/2485).
+### Corrections
+
+- Fixed console printing in `wails generate template`. Fixed by @misitebao in [PR](https://github.com/wailsapp/wails/pull/2483)
+- Fixed unicode encoding of strings for multi-rune characters. Fixed by @joshbuddy in [PR](https://github.com/wailsapp/wails/pull/2509)
+- Fixed `-skipbindings` flag in `wails dev`. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2584)
+- Fixed `runtime.MenuUpdateApplicationMenu` on macOS. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2588)
+- Fixed add package name for `libwebkit`/`pkg-config` and use shell.RunCommandWithENV instead of shell.RunCommand in `zypper.go`. Fixed by @wgjtyu in [PR](https://github.com/wailsapp/wails/pull/2593)
+- Make sure to start the CommonFileDialogs on Windows on the Main-Thread. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2606)
## v2.4.1 - 2023-03-20
### Changements
+
- Support single clicks on items with `--wails-draggable: drag` again on Windows. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2482)
### Corrections
+
- Fixed panic when using `wails dev` and the AssetServer tried to log to the logger. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2481)
- Fixed compatibility with WebView2 Runtime > `110.0.1587.69` which showed a `connection refused` html page before doing a reload of the frontend. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2496)
## v2.4.0 - 2023-03-08
### Ajouts
+
- Added Webview GPU acceleration options for [Windows](/docs/reference/options#webviewgpuisdisabled) and [Linux](/docs/reference/options#webviewgpupolicy). Added by @Lyimmi in [PR](https://github.com/wailsapp/wails/pull/2266)
- Added `EnableFraudulentWebsiteDetection` option to opt-in to scan services for fraudulent content, such as malware or phishing attempts. Older releases had the scan services per default activated. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2269)
- Allow an [AssetServer Middleware](/docs/reference/options#middleware) to specify the `Content-Type` of a file served by the [Assets](/docs/reference/options#assets-1) `fs.FS`. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2286)
- The AssetServer now detects more mimetypes by extension, e.g. `.mjs`. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2391)
### Changements
+
- Improved fullscreen mode for frameless window on Windows. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279), [PR](https://github.com/wailsapp/wails/pull/2288) and [PR](https://github.com/wailsapp/wails/pull/2299)
- On Windows unmaximising a window has no effect anymore when the window is in fullscreen mode, this makes it consistent with e.g. macOS. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279)
- Frameless resize now sets the cursor on documentElement, otherwise resizing cursor won't be shown outside of the body rectangle. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2289)
@@ -42,11 +60,12 @@ Le format est basé sur [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- NSIS template now installs the shortcuts for all users and not only for the current user. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2373)
### Corrections
+
- Fixed failing build hooks when `build/bin` was missing. Fixed by @Lyimmi in [PR](https://github.com/wailsapp/wails/pull/2273)
- Fixed fullscreen mode for frameless window on Windows to fully cover the taskbar when changing into fullscreen from maximised state. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279)
- Fixed set window background colour on Windows when setting the colour via runtime. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279)
- Fixed the showing of a white border around a fullscreen window when `DisableWindowIcon` is active on Windows. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2299)
-- Fixed the sometimes lagging drag experience with `--wails-draggable` on Windows. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2302)
+- Fixed the sometimes lagging drag experience with `--wails-draggable` on Windows. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2302)
- Fixed applying the default arch to platform flag in wails cli. If only a `GOOS` has been supplied as platform flag e.g. `wails build --platform windows` the current architecture wasn't applied and the build failed. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2309)
- Fixed a segfault on opening the inspector on older macOS versions. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2397)
- Fixed the macos single architecture builds not respecting an output file name specified with the '-o' flag. Fixed by @gwynforthewyn in [PR](https://github.com/wailsapp/wails/pull/2358)
@@ -58,6 +77,7 @@ Le format est basé sur [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
## v2.3.0 - 2022-12-29
### Ajouts
+
- Ajout de l'option `OpenInspectorOnStartup` au débogage pour permettre d'ouvrir le WebInspector au démarrage de l'application en mode débogage . Ajouté par @stffabi : [PR](https://github.com/wailsapp/wails/pull/2080)
- Sur MacOS, `wails doctor` affiche à présent la version de Xcode installée. Ajouté par @stffabi : [PR](https://github.com/wailsapp/wails/pull/2089)
- L'[AssetServer](/docs/reference/options#assetserver) supporte à présent les range-requests si l' [Assets](/docs/reference/options/#assets-1) `fs.FS` importe `io.ReadSeeker`. Ajouté par @stffabi : [PR](https://github.com/wailsapp/wails/pull/2091)
@@ -76,6 +96,7 @@ Le format est basé sur [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added Korean translation for the website. Added by @cybertramp in [PR](https://github.com/wailsapp/wails/pull/2093)
### Corrections
+
- Le booléen activant la fonctionnalité `noreload` n'était pas utilisable dans le mode développement de wails. Corrigé par @stffabi dans cette [PR](https://github.com/wailsapp/wails/pull/2081)
- `le dossier build/bin` se dupliquait sur chaque rechargement en mode `wails dev`. Corrigé par @OlegGulevskyy dans cette [PR](https://github.com/wailsapp/wails/pull/2103)
- Empêcher une fine ligne blanche au bas d'une fenêtre sans cadre sous Windows. Correction par @stffabi dans cette [PR](https://github.com/wailsapp/wails/pull/2111)
@@ -91,6 +112,7 @@ Le format est basé sur [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Fixed React Hash Router link in docs. Fixed by @marvinhosea in [PR](https://github.com/wailsapp/wails/pull/2050)
### Changements
+
- Amélioration du message d'erreur si aucun `index.html` ne peut être trouvé dans les assets et de la validation des options d'assetserver. Changé par @stffabi dans cette [PR](https://github.com/wailsapp/wails/pull/2110)
- Promotion de Go WebView2Loader d'expérimental à stable. Cela signifie que maintenant, par défaut, toutes les constructions de Wails utilisent le nouveau chargeur introduit avec `v2.2.0`. L'ancien chargeur reste utilisable avec la balise de compilation `native_webview2loader` pour les prochaines versions. Changé par @stffabi dans cette [PR](https://github.com/wailsapp/wails/pull/2199)
- Refactored CLI. Changed by @leaanthony in this [PR](https://github.com/wailsapp/wails/pull/2123)
diff --git a/website/i18n/fr/docusaurus-plugin-content-pages/community-guide.mdx b/website/i18n/fr/docusaurus-plugin-content-pages/community-guide.mdx
index 2af29a79925..0153cede2bd 100644
--- a/website/i18n/fr/docusaurus-plugin-content-pages/community-guide.mdx
+++ b/website/i18n/fr/docusaurus-plugin-content-pages/community-guide.mdx
@@ -131,9 +131,9 @@ Si vous souhaitez ajouter une nouvelle langue à la documentation, veuillez suiv
### Aider les autres
-Une bonne façon de contribuer au projet est d'aider ceux qui éprouvent des difficultés. This is normally reported as a ticket or a message on the Wails discord server. Même clarifier le problème peut vraiment aider. Parfois, quand un problème est discuté et résolu, nous créons un guide pour aider ceux qui sont confrontés aux mêmes problèmes.
+Une bonne façon de contribuer au projet est d'aider ceux qui éprouvent des difficultés. C'est normalement signalé par un ticket ou un message sur le serveur discord de Wails. Même clarifier le problème peut vraiment aider. Parfois, quand un problème est discuté et résolu, nous créons un guide pour aider ceux qui sont confrontés aux mêmes problèmes.
-To join the Wails discord server, click [here](https://discord.gg/JDdSxwjhGf).
+Pour rejoindre le serveur Discord de Wails, cliquez [ici](https://discord.gg/JDdSxwjhGf).
:::note
diff --git a/website/i18n/fr/docusaurus-plugin-content-pages/credits.mdx b/website/i18n/fr/docusaurus-plugin-content-pages/credits.mdx
index cdb44bd3879..1fa097ee349 100644
--- a/website/i18n/fr/docusaurus-plugin-content-pages/credits.mdx
+++ b/website/i18n/fr/docusaurus-plugin-content-pages/credits.mdx
@@ -4,7 +4,7 @@
- [Stffabi](https://github.com/stffabi) - Chef technique, développeur et mainteneur
- [Misite Bao](https://github.com/misitebao) - Sorcier de la documentation, traducteur chinois, testeur pour Windows, découvreur principal de bugs
- [Travis McLane](https://github.com/tmclane) - Travaux de compilation sur plusieurs plateformes, testeur MacOS
-- [Lyimmi](https://github.com/Lyimmi) - All things Linux
+- [Lyimmi](https://github.com/Lyimmi) - Tout ce qui est Linux
## Partenaires
@@ -12,9 +12,7 @@
## Contributeurs
-
-
-
+
-
-
-
-
+
## Mentions spéciales
- [John Chadwick](https://github.com/jchv) - Pour son travail incroyable sur [go-webview2](https://github.com/jchv/go-webview2) et [go-winloader](https://github.com/jchv/go-winloader) qui a permis d'avoir une version Windows.
- [Tad Vizbaras](https://github.com/tadvi) - Son projet winc était la première pierre d'un projet Wails en pure Go.
- [Mat Ryer](https://github.com/matryer) - Pour ses conseils, son support et son humour.
-- [Byron Chris](https://github.com/bh90210) - For his long term contributions to this project.
+- [Byron Chris](https://github.com/bh90210) - Pour ses contributions à long terme à ce projet.
- [Dustin Krysak](https://wiki.ubuntu.com/bashfulrobot) - Son support et ses retours ont été inestimables.
- [Justen Walker](https://github.com/justenwalker/) - Pour aider à résoudre les problèmes COM qui ont permis de publier la v2.
- [Wang, Chi](https://github.com/patr0nus/) - Le projet DeskGap a été une grande influence sur la direction de Wails v2.
diff --git a/website/i18n/fr/docusaurus-plugin-content-pages/faq.mdx b/website/i18n/fr/docusaurus-plugin-content-pages/faq.mdx
index ad857468c7d..5c69f1e503b 100644
--- a/website/i18n/fr/docusaurus-plugin-content-pages/faq.mdx
+++ b/website/i18n/fr/docusaurus-plugin-content-pages/faq.mdx
@@ -4,6 +4,6 @@
Quand j'ai vu WebView, j'ai pensé "Ce que je veux vraiment c'est un outil construit autour d'une application WebView, un peu comme Rails l'est pour Ruby". Alors à la base c'était un jeu de mot (**W**ebview on R**ails**). Et il se trouve que c'est un homophone pour le nom anglais du [Pays](https://en.wikipedia.org/wiki/Wales) d'où je viens. Alors c'est resté.
-## Est-ce que c'est une alternative à Electron ?
+## Est-ce une alternative à Electron?
Cela dépend de vos besoins. Ça a été conçu pour que les développeurs en Go puissent créer des applications de bureau légères ou pour qu'ils puissent ajouter une interface graphique à leurs applications existantes. Wails v2 offre l'accès à des éléments natifs tels que des menus et des boîtes de dialogues, par conséquent c'est devenu une alternative plus légère à electron.
diff --git a/website/i18n/fr/docusaurus-theme-classic/footer.json b/website/i18n/fr/docusaurus-theme-classic/footer.json
index 75ad0c4be4b..47b07b4c757 100644
--- a/website/i18n/fr/docusaurus-theme-classic/footer.json
+++ b/website/i18n/fr/docusaurus-theme-classic/footer.json
@@ -54,5 +54,9 @@
"link.item.label.Discord": {
"message": "Discord",
"description": "The label of footer link with label=Discord linking to https://discord.gg/JDdSxwjhGf"
+ },
+ "logo.alt": {
+ "message": "Wails Logo",
+ "description": "The alt text of footer logo"
}
}
diff --git a/website/i18n/fr/docusaurus-theme-classic/navbar.json b/website/i18n/fr/docusaurus-theme-classic/navbar.json
index dfb3f0f19fa..4aa41884ed7 100644
--- a/website/i18n/fr/docusaurus-theme-classic/navbar.json
+++ b/website/i18n/fr/docusaurus-theme-classic/navbar.json
@@ -38,5 +38,9 @@
"item.label.Code of Conduct": {
"message": "Code de Conduite",
"description": "Navbar item with label Code of Conduct"
+ },
+ "logo.alt": {
+ "message": "Wails Logo",
+ "description": "The alt text of navbar logo"
}
}
diff --git a/website/i18n/ja/code.json b/website/i18n/ja/code.json
index f44b03bd04e..461b7d43c39 100644
--- a/website/i18n/ja/code.json
+++ b/website/i18n/ja/code.json
@@ -32,7 +32,7 @@
},
"theme.ErrorPageContent.tryAgain": {
"message": "再試行",
- "description": "The label of the button to try again when the page crashed"
+ "description": "The label of the button to try again rendering when the React error boundary captures an error"
},
"theme.NotFound.title": {
"message": "ページが見つかりません",
@@ -419,5 +419,13 @@
"theme.docs.sidebar.toggleSidebarButtonAriaLabel": {
"message": "ナビゲーションバーの表示/非表示を切り替え",
"description": "The ARIA label for hamburger menu button of mobile navigation"
+ },
+ "theme.NavBar.navAriaLabel": {
+ "message": "Main",
+ "description": "The ARIA label for the main navigation"
+ },
+ "theme.docs.sidebar.navAriaLabel": {
+ "message": "Docs sidebar",
+ "description": "The ARIA label for the sidebar navigation"
}
}
diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/templates.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/templates.mdx
index 93a21f368de..7baf3ecd566 100644
--- a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/templates.mdx
+++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/templates.mdx
@@ -31,6 +31,7 @@ sidebar_position: 1
## Angular
+- [wails-template-angular](https://github.com/mateothegreat/wails-template-angular) - Angular 15+ action packed & ready to roll to production.
- [wails-angular-template](https://github.com/TAINCER/wails-angular-template) - TypeScript、Sass、ホットリロード、コード分割、i18n を使用した Angular
## React
@@ -47,6 +48,11 @@ sidebar_position: 1
- [wails-vite-svelte-tailwind-template](https://github.com/BillBuilt/wails-vite-svelte-tailwind-template) - TailwindCSS v3を含んだ、SvelteおよびViteを使用したテンプレート
- [wails-sveltekit-template](https://github.com/h8gi/wails-sveltekit-template) - SvelteKitを使用したテンプレート
+## Solid
+
+- [wails-template-vite-solid-ts](https://github.com/xijaja/wails-template-solid-ts) - Solid + Ts + Viteを使用したテンプレート
+- [wails-template-vite-solid-js](https://github.com/xijaja/wails-template-solid-js) - Solid + Js + Viteを使用したテンプレート
+
## Elm
- [wails-elm-template](https://github.com/benjamin-thomas/wails-elm-template) - 関数型プログラミングと**高速な**ホットリロードを使ったGUIアプリ開発 :tada: :rocket:
diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/routing.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/routing.mdx
index 4d0e8aa4822..ba9195d2bb2 100644
--- a/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/routing.mdx
+++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/routing.mdx
@@ -27,7 +27,7 @@ RouterModule.forRoot(routes, { useHash: true });
## React
-Reactにおいてルーティングで推奨されるアプローチは、[HashRouter](https://reactrouter.com/docs/en/v6/routers/hash-router)となります:
+Reactにおいてルーティングで推奨されるアプローチは、[HashRouter](https://reactrouter.com/en/main/router-components/hash-router)となります:
```jsx
import { HashRouter } from "react-router-dom";
diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/menus.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/menus.mdx
index cdd37c07b8c..5e1f1e21808 100644
--- a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/menus.mdx
+++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/menus.mdx
@@ -9,12 +9,15 @@ Wailsプロジェクトに、アプリケーションメニューを追加する
メニューを作成する例:
```go
+
+ app := NewApp()
+
AppMenu := menu.NewMenu()
FileMenu := AppMenu.AddSubmenu("File")
FileMenu.AddText("&Open", keys.CmdOrCtrl("o"), openFile)
FileMenu.AddSeparator()
FileMenu.AddText("Quit", keys.CmdOrCtrl("q"), func(_ *menu.CallbackData) {
- runtime.Quit()
+ runtime.Quit(app.ctx)
})
if runtime.GOOS == "darwin" {
@@ -25,7 +28,7 @@ Wailsプロジェクトに、アプリケーションメニューを追加する
Title: "Menus Demo",
Width: 800,
Height: 600,
- Menu: AppMenu,
+ Menu: AppMenu, // reference the menu above
Bind: []interface{}{
app,
},
diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/options.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/options.mdx
index 7d75d7138dd..82ee092f77e 100644
--- a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/options.mdx
+++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/options.mdx
@@ -234,8 +234,8 @@ AssetServerの固有オプションを定義します。 静的なアセット
| PATCH | ✅ | ✅ | ✅ [^1] |
| DELETE | ✅ | ✅ | ✅ [^1] |
| Request Headers | ✅ | ✅ | ✅ [^1] |
-| Request Body | ✅ | ✅ | ❌ |
-| Request Body Streaming | ✅ | ✅ | ❌ |
+| Request Body | ✅ | ✅ | ✅ [^2] |
+| Request Body Streaming | ✅ | ✅ | ✅ [^2] |
| Response StatusCodes | ✅ | ✅ | ✅ [^1] |
| Response Headers | ✅ | ✅ | ✅ [^1] |
| Response Body | ✅ | ✅ | ✅ |
@@ -764,3 +764,4 @@ func main() {
名前: OpenInspectorOnStartup
データ型: `bool`
[^1]: この機能の動作には、WebKit2GTK 2.36以上が必要となるため、機能を確実に対応させたい場合は、アプリビルド時にビルドタグ`webkit2_36`を付与してください。 これにより、アプリに必要なWebKit2GTKの最小バージョン要件が2.36に引き上げられます。
+[^2]: この機能の動作には、WebKit2GTK 2.40以上が必要となるため、機能を確実に対応させたい場合は、アプリビルド時にビルドタグ`webkit2_40`を付与してください。 これにより、アプリに必要なWebKit2GTKの最小バージョン要件が2.40に引き上げられます。
diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/project-config.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/project-config.mdx
index 5c7d578b777..f768d1c4795 100644
--- a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/project-config.mdx
+++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/project-config.mdx
@@ -2,9 +2,9 @@
sidebar_position: 5
---
-# Project Config
+# プロジェクト構成
-The project config resides in the `wails.json` file in the project directory. The structure of the config is:
+プロジェクト構成は、プロジェクトディレクトリ内の`wails.json`ファイルで設定します。 ファイルの構造は次のとおりです:
```json
{
@@ -84,9 +84,8 @@ The project config resides in the `wails.json` file in the project directory. Th
}
```
-This file is read by the Wails CLI when running `wails build` or `wails dev`.
+このファイルは、Wails CLIで `wails build` コマンドまたは `wails dev` コマンドを実行した際に読み込まれます。
-The `assetdir`, `reloaddirs`, `wailsjsdir`, `debounceMS`, `devserver` and `frontenddevserverurl` flags in `wails build/dev` will update the project config
-and thus become defaults for subsequent runs.
+`wails build/dev` コマンドを実行時に、`assetdir`、`reloaddirs`、`wailsjsdir`、`debounceMS`、`devserver`、`frontenddevserverurl`フラグを使用すると、プロジェクト構成が更新され、次回以降コマンドを実行する際のデフォルト値となります。
-The JSON Schema for this file is located [here](https://wails.io/schemas/config.v2.json).
+このファイルのJSONスキーマは、[こちら](https://wails.io/schemas/config.v2.json)にあります。
diff --git a/website/i18n/ja/docusaurus-plugin-content-pages/changelog.mdx b/website/i18n/ja/docusaurus-plugin-content-pages/changelog.mdx
index d572f4a3494..fad847dd8ab 100644
--- a/website/i18n/ja/docusaurus-plugin-content-pages/changelog.mdx
+++ b/website/i18n/ja/docusaurus-plugin-content-pages/changelog.mdx
@@ -13,28 +13,46 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## [Unreleased]
+### Added
+
+- Added Nodejs version in `wails doctor`. Added by @misitebao in [PR](https://github.com/wailsapp/wails/pull/2546)
+- Added support for WebKit2GTK 2.40+ on Linux. This brings additional features for the [AssetServer](/docs/reference/options#assetserver), like support for HTTP Request Bodies. The app must be compiled with the Go build tag `webkit2_40` to activate support for this features. This also bumps the minimum requirement of WebKit2GTK to 2.40 for your app. Added by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2592)
+
### Changed
+
- [v3] Typescript model generation using `StructDef`s from new AST-based parser. Added by @ATenderholt in [PR1](https://github.com/wailsapp/wails/pull/2428/files) and [PR2](https://github.com/wailsapp/wails/pull/2485).
+### Fixed
+
+- Fixed console printing in `wails generate template`. Fixed by @misitebao in [PR](https://github.com/wailsapp/wails/pull/2483)
+- Fixed unicode encoding of strings for multi-rune characters. Fixed by @joshbuddy in [PR](https://github.com/wailsapp/wails/pull/2509)
+- Fixed `-skipbindings` flag in `wails dev`. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2584)
+- Fixed `runtime.MenuUpdateApplicationMenu` on macOS. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2588)
+- Fixed add package name for `libwebkit`/`pkg-config` and use shell.RunCommandWithENV instead of shell.RunCommand in `zypper.go`. Fixed by @wgjtyu in [PR](https://github.com/wailsapp/wails/pull/2593)
+- Make sure to start the CommonFileDialogs on Windows on the Main-Thread. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2606)
## v2.4.1 - 2023-03-20
### Changed
+
- Support single clicks on items with `--wails-draggable: drag` again on Windows. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2482)
### Fixed
+
- Fixed panic when using `wails dev` and the AssetServer tried to log to the logger. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2481)
- Fixed compatibility with WebView2 Runtime > `110.0.1587.69` which showed a `connection refused` html page before doing a reload of the frontend. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2496)
## v2.4.0 - 2023-03-08
### Added
+
- Added Webview GPU acceleration options for [Windows](/docs/reference/options#webviewgpuisdisabled) and [Linux](/docs/reference/options#webviewgpupolicy). Added by @Lyimmi in [PR](https://github.com/wailsapp/wails/pull/2266)
- Added `EnableFraudulentWebsiteDetection` option to opt-in to scan services for fraudulent content, such as malware or phishing attempts. Older releases had the scan services per default activated. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2269)
- Allow an [AssetServer Middleware](/docs/reference/options#middleware) to specify the `Content-Type` of a file served by the [Assets](/docs/reference/options#assets-1) `fs.FS`. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2286)
- The AssetServer now detects more mimetypes by extension, e.g. `.mjs`. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2391)
### Changed
+
- Improved fullscreen mode for frameless window on Windows. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279), [PR](https://github.com/wailsapp/wails/pull/2288) and [PR](https://github.com/wailsapp/wails/pull/2299)
- On Windows unmaximising a window has no effect anymore when the window is in fullscreen mode, this makes it consistent with e.g. macOS. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279)
- Frameless resize now sets the cursor on documentElement, otherwise resizing cursor won't be shown outside of the body rectangle. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2289)
@@ -42,11 +60,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- NSIS template now installs the shortcuts for all users and not only for the current user. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2373)
### Fixed
+
- Fixed failing build hooks when `build/bin` was missing. Fixed by @Lyimmi in [PR](https://github.com/wailsapp/wails/pull/2273)
- Fixed fullscreen mode for frameless window on Windows to fully cover the taskbar when changing into fullscreen from maximised state. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279)
- Fixed set window background colour on Windows when setting the colour via runtime. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279)
- Fixed the showing of a white border around a fullscreen window when `DisableWindowIcon` is active on Windows. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2299)
-- Fixed the sometimes lagging drag experience with `--wails-draggable` on Windows. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2302)
+- Fixed the sometimes lagging drag experience with `--wails-draggable` on Windows. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2302)
- Fixed applying the default arch to platform flag in wails cli. If only a `GOOS` has been supplied as platform flag e.g. `wails build --platform windows` the current architecture wasn't applied and the build failed. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2309)
- Fixed a segfault on opening the inspector on older macOS versions. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2397)
- Fixed the macos single architecture builds not respecting an output file name specified with the '-o' flag. Fixed by @gwynforthewyn in [PR](https://github.com/wailsapp/wails/pull/2358)
@@ -58,6 +77,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## v2.3.0 - 2022-12-29
### 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)
@@ -76,6 +96,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Added Korean translation for the website. Added by @cybertramp in [PR](https://github.com/wailsapp/wails/pull/2093)
### Fixed
+
- The `noreload` flag in wails dev wasn't applied. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2081)
- `build/bin` folder was duplicating itself on each reload in `wails dev` mode. Fixed by @OlegGulevskyy in this [PR](https://github.com/wailsapp/wails/pull/2103)
- Prevent a thin white line at the bottom of a frameless window on Windows. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2111)
@@ -91,6 +112,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Fixed React Hash Router link in docs. Fixed by @marvinhosea in [PR](https://github.com/wailsapp/wails/pull/2050)
### Changed
+
- Improve error message if no `index.html` could be found in the assets and validate assetserver options. Changed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2110)
- Promote the Go WebView2Loader from experimental to stable. This means now per default all Wails build use the new loader introduced with `v2.2.0`. The old loader remains usable with build tag `native_webview2loader` for the next few releases. Changed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2199)
- Refactored CLI. Changed by @leaanthony in this [PR](https://github.com/wailsapp/wails/pull/2123)
diff --git a/website/i18n/ja/docusaurus-plugin-content-pages/community-guide.mdx b/website/i18n/ja/docusaurus-plugin-content-pages/community-guide.mdx
index f366562780d..06176e7aeaa 100644
--- a/website/i18n/ja/docusaurus-plugin-content-pages/community-guide.mdx
+++ b/website/i18n/ja/docusaurus-plugin-content-pages/community-guide.mdx
@@ -53,44 +53,44 @@ Wailsはオープンソースであり、コミュニティ主導のプロジェ
- 機能をテストする準備ができたら、プルリクエストのドラフトを作成してください。 プルリクエストの説明欄には、テストシナリオおよびチェックマーク付きのテストケースをリストアップしてください。これにより、何をテストすべきなのかを他の人が把握できるようになります。
- すべてのテストが完了したら、プルリクエストのステータスをドラフトから更新し、メッセージを残してください。
-:::備考
+:::note
自分でチケットをオープンして作業することを止めはしませんが、すべての機能強化リクエストは、それが適切かどうかを審査されているという点に留意してください。 すべてのアイデアが採択されるわけでは無いため、まずは当該機能強化についてディスカッションすることを推奨します。
:::
-:::警告
+:::warning
紐づくチケットが無い状態でオープンされたプルリクエストは、リジェクトされることがあります。
:::
-### Fixing Bugs
+### バグの修正
-The process for fixing bugs are as follows:
+バグを修正するプロセスは次のとおりです:
-- Check the current [Backlog](https://github.com/orgs/wailsapp/projects/1/views/1) and select a bug to fix
+- 現時点での[バックログ](https://github.com/orgs/wailsapp/projects/1/views/1)を確認し、修正するつもりのバグを選んでください。
- 開発を始める前に、チケットに以下の情報が含まれていることを確認してください:
-- The scope of the issue including platforms affected
-- The steps to reproduce. Sometimes bugs are opened that are not Wails issues and the onus is on the reporter to prove that it is a Wails issue with a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example)
-- The output of `wails doctor`
-- A test that can reproduce the bug
+- 影響のあるプラットフォームといった、イシューの対象範囲。
+- バグの再現手順。 Sometimes bugs are opened that are not Wails issues and the onus is on the reporter to prove that it is a Wails issue with a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example)
+- `wails doctor`の出力内容。
+- バグを再現できるテスト。
- チケットにこれらの情報が含まれていない場合、チケットをオープンした人に、これらの情報をリクエストしてください。
-- Comment on the ticket stating you wish to develop a fix
-- Clone the repository and create a branch with the format `bugfix/_`
-- Once the fix is ready for testing, create a draft PR. プルリクエストの説明欄には、テストシナリオおよびチェックマーク付きのテストケースをリストアップしてください。これにより、何をテストすべきなのかを他の人が把握できるようになります。
+- 修正作業を実施する旨を、チケットにコメントしてください。
+- リポジトリをクローンし、`bugfix/_`の命名形式でブランチを作成してください。
+- 修正をテストする準備ができたら、プルリクエストのドラフトを作成してください。 プルリクエストの説明欄には、テストシナリオおよびチェックマーク付きのテストケースをリストアップしてください。これにより、何をテストすべきなのかを他の人が把握できるようになります。
- すべてのテストが完了したら、プルリクエストのステータスをドラフトから更新し、メッセージを残してください。
:::note
-There is nothing stopping you from opening a ticket and working on it yourself, but please be aware that all bugfixes should be discussed as the approach may have unintended side effects.
+自分でチケットをオープンして作業することを止めはしませんが、あなたの修正アプローチには副作用が発生する可能性もあるため、どのようなバグ修正であっても、議論をするようにしてください。
:::
-:::警告
+:::warning
紐づくチケットが無い状態でオープンされたプルリクエストは、リジェクトされることがあります。
:::
### テスト
-Testing is vitally important to ensure quality in the project. There are a couple of scenarios where testing can really help the project:
+テストは、プロジェクトの品質を保つために極めて重要なものです。 実際に、テストがプロジェクトに役立つ場面はいくつかあります:
-- Testing if a bug is reproducible on your local system
-- Testing PRs to ensure that they work correctly
+- ローカルマシンでバグが再現するかどうかのテスト
+- プルリクエストの内容が正しく動作するかを確認するテスト
If you chose to test if someone's bug report is reproducible on your local system, then feel free to add a comment on the ticket confirming this with the output of `wails doctor`.
@@ -98,7 +98,7 @@ To test PRs, choose a PR to test and check if the PR description has the testing
If you ever need more clarity or help on testing, please ask a question in the [Contributing to Wails](https://github.com/wailsapp/wails/discussions/1520) discussion or on slack.
-### Documenting
+### ドキュメント
This website is also the main documentation site for the project. Sometimes this gets out of date and needs some slight adjustments. Some of the documentation isn't written to the best standards either. Developing documentation is hard and so any contribution to this is greatly appreciated. Features without documentation are unfinished so to the project, it's _as important_ as the code.
@@ -113,7 +113,7 @@ To set up a local documentation development environment, do the following:
After it has all installed and is running, you should see the site at [`http://localhost:3000`](http://localhost:3000). Any changes made to the site text will be immediately reflected in the browser.
-#### Versioning
+#### バージョン管理
We employ a versioning system where we have the "latest" documentation AKA "Next Version" which has all the changes that have occurred since the last release. We also keep the last release documentation as well as the version before that.
@@ -121,7 +121,7 @@ There isn't usually a reason to update released documentation so we don't genera
The "next version" docs are mainly in `website/docs` with some "version independent" documents in `src/pages`. Any updates should be made in the `website/docs` directory.
-#### Languages
+#### 翻訳
The default documents of the Wails project are English documents. We use the "crowdin" tool to translate documents in other languages and synchronize them to the website. You can [join our project](https://crowdin.com/project/wails) and submit your translations to make contributions.
diff --git a/website/i18n/ja/docusaurus-plugin-content-pages/credits.mdx b/website/i18n/ja/docusaurus-plugin-content-pages/credits.mdx
index 7d899183a81..db7fdbfb144 100644
--- a/website/i18n/ja/docusaurus-plugin-content-pages/credits.mdx
+++ b/website/i18n/ja/docusaurus-plugin-content-pages/credits.mdx
@@ -12,9 +12,7 @@
## コントリビューター
-
-
-
+
-
-
-
-
+
## スペシャルサンクス
diff --git a/website/i18n/ja/docusaurus-theme-classic/footer.json b/website/i18n/ja/docusaurus-theme-classic/footer.json
index d7829f32d08..ef84a7eecda 100644
--- a/website/i18n/ja/docusaurus-theme-classic/footer.json
+++ b/website/i18n/ja/docusaurus-theme-classic/footer.json
@@ -54,5 +54,9 @@
"link.item.label.Discord": {
"message": "Discord",
"description": "The label of footer link with label=Discord linking to https://discord.gg/JDdSxwjhGf"
+ },
+ "logo.alt": {
+ "message": "Wails ロゴ",
+ "description": "The alt text of footer logo"
}
}
diff --git a/website/i18n/ja/docusaurus-theme-classic/navbar.json b/website/i18n/ja/docusaurus-theme-classic/navbar.json
index 6f738ece307..90d686fcf8b 100644
--- a/website/i18n/ja/docusaurus-theme-classic/navbar.json
+++ b/website/i18n/ja/docusaurus-theme-classic/navbar.json
@@ -38,5 +38,9 @@
"item.label.Code of Conduct": {
"message": "行動規範",
"description": "Navbar item with label Code of Conduct"
+ },
+ "logo.alt": {
+ "message": "Wails ロゴ",
+ "description": "The alt text of navbar logo"
}
}
diff --git a/website/i18n/ko/code.json b/website/i18n/ko/code.json
index 84b4ab98413..39f4238b562 100644
--- a/website/i18n/ko/code.json
+++ b/website/i18n/ko/code.json
@@ -32,7 +32,7 @@
},
"theme.ErrorPageContent.tryAgain": {
"message": "재시도",
- "description": "The label of the button to try again when the page crashed"
+ "description": "The label of the button to try again rendering when the React error boundary captures an error"
},
"theme.NotFound.title": {
"message": "페이지를 찾을 수 없습니다.",
@@ -419,5 +419,13 @@
"theme.docs.sidebar.toggleSidebarButtonAriaLabel": {
"message": "Toggle navigation bar",
"description": "The ARIA label for hamburger menu button of mobile navigation"
+ },
+ "theme.NavBar.navAriaLabel": {
+ "message": "Main",
+ "description": "The ARIA label for the main navigation"
+ },
+ "theme.docs.sidebar.navAriaLabel": {
+ "message": "Docs sidebar",
+ "description": "The ARIA label for the sidebar navigation"
}
}
diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/community/templates.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/templates.mdx
index c7cbcef7dc8..5b57cd60455 100644
--- a/website/i18n/ko/docusaurus-plugin-content-docs/current/community/templates.mdx
+++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/templates.mdx
@@ -31,6 +31,7 @@ If you are unsure about a template, inspect `package.json` and `wails.json` for
## Angular
+- [wails-template-angular](https://github.com/mateothegreat/wails-template-angular) - Angular 15+ action packed & ready to roll to production.
- [wails-angular-template](https://github.com/TAINCER/wails-angular-template) - Angular with TypeScript, Sass, Hot-Reload, Code-Splitting and i18n
## React
@@ -47,6 +48,11 @@ If you are unsure about a template, inspect `package.json` and `wails.json` for
- [wails-vite-svelte-tailwind-template](https://github.com/BillBuilt/wails-vite-svelte-tailwind-template) - A template using Svelte and Vite with TailwindCSS v3
- [wails-sveltekit-template](https://github.com/h8gi/wails-sveltekit-template) - A template using SvelteKit
+## Solid
+
+- [wails-template-vite-solid-ts](https://github.com/xijaja/wails-template-solid-ts) - A template using Solid + Ts + Vite
+- [wails-template-vite-solid-js](https://github.com/xijaja/wails-template-solid-js) - A template using Solid + Js + Vite
+
## Elm
- [wails-elm-template](https://github.com/benjamin-thomas/wails-elm-template) - Develop your GUI app with functional programming and a **snappy** hot-reload setup :tada: :rocket:
diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/routing.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/routing.mdx
index c35cc1c8a4d..ce176943ea5 100644
--- a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/routing.mdx
+++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/routing.mdx
@@ -27,7 +27,7 @@ RouterModule.forRoot(routes, { useHash: true });
## React
-The recommended approach for routing in React is [HashRouter](https://reactrouter.com/docs/en/v6/routers/hash-router):
+The recommended approach for routing in React is [HashRouter](https://reactrouter.com/en/main/router-components/hash-router):
```jsx
import { HashRouter } from "react-router-dom";
diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/menus.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/menus.mdx
index 304f57d65c2..ff9a2442281 100644
--- a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/menus.mdx
+++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/menus.mdx
@@ -9,12 +9,15 @@ It is possible to add an application menu to Wails projects. This is achieved by
An example of how to create a menu:
```go
+
+ app := NewApp()
+
AppMenu := menu.NewMenu()
FileMenu := AppMenu.AddSubmenu("File")
FileMenu.AddText("&Open", keys.CmdOrCtrl("o"), openFile)
FileMenu.AddSeparator()
FileMenu.AddText("Quit", keys.CmdOrCtrl("q"), func(_ *menu.CallbackData) {
- runtime.Quit()
+ runtime.Quit(app.ctx)
})
if runtime.GOOS == "darwin" {
@@ -25,7 +28,7 @@ An example of how to create a menu:
Title: "Menus Demo",
Width: 800,
Height: 600,
- Menu: AppMenu,
+ Menu: AppMenu, // reference the menu above
Bind: []interface{}{
app,
},
diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/options.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/options.mdx
index 49214bb08c1..451d7a9482c 100644
--- a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/options.mdx
+++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/options.mdx
@@ -234,8 +234,8 @@ Not all features of an `http.Request` are currently supported, please see the fo
| PATCH | ✅ | ✅ | ✅ [^1] |
| DELETE | ✅ | ✅ | ✅ [^1] |
| Request Headers | ✅ | ✅ | ✅ [^1] |
-| Request Body | ✅ | ✅ | ❌ |
-| Request Body Streaming | ✅ | ✅ | ❌ |
+| Request Body | ✅ | ✅ | ✅ [^2] |
+| Request Body Streaming | ✅ | ✅ | ✅ [^2] |
| Response StatusCodes | ✅ | ✅ | ✅ [^1] |
| Response Headers | ✅ | ✅ | ✅ [^1] |
| Response Body | ✅ | ✅ | ✅ |
@@ -763,4 +763,5 @@ Setting this to `true` will open the WebInspector on startup of the application.
Name: OpenInspectorOnStartup
Type: `bool`
-[^1]: This requires WebKit2GTK 2.36+ support and your app needs to be build with the build tag `webkit2_36` to activate support for this feature. This also bumps the minimum requirement of WebKit2GTK to 2.36 for your app.
+[^1]: This requires WebKit2GTK 2.36+ support and your app needs to be build with the build tag `webkit2_36` to activate support for this feature. This also bumps the minimum requirement of WebKit2GTK to 2.36 for your app.
+[^2]: This requires WebKit2GTK 2.40+ support and your app needs to be build with the build tag `webkit2_40` to activate support for this feature. This also bumps the minimum requirement of WebKit2GTK to 2.40 for your app.
diff --git a/website/i18n/ko/docusaurus-plugin-content-pages/changelog.mdx b/website/i18n/ko/docusaurus-plugin-content-pages/changelog.mdx
index bce1ce99619..5e0cf5a1f4f 100644
--- a/website/i18n/ko/docusaurus-plugin-content-pages/changelog.mdx
+++ b/website/i18n/ko/docusaurus-plugin-content-pages/changelog.mdx
@@ -13,28 +13,46 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## [Unreleased]
+### Added
+
+- Added Nodejs version in `wails doctor`. Added by @misitebao in [PR](https://github.com/wailsapp/wails/pull/2546)
+- Added support for WebKit2GTK 2.40+ on Linux. This brings additional features for the [AssetServer](/docs/reference/options#assetserver), like support for HTTP Request Bodies. The app must be compiled with the Go build tag `webkit2_40` to activate support for this features. This also bumps the minimum requirement of WebKit2GTK to 2.40 for your app. Added by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2592)
+
### Changed
+
- [v3] Typescript model generation using `StructDef`s from new AST-based parser. Added by @ATenderholt in [PR1](https://github.com/wailsapp/wails/pull/2428/files) and [PR2](https://github.com/wailsapp/wails/pull/2485).
+### Fixed
+
+- Fixed console printing in `wails generate template`. Fixed by @misitebao in [PR](https://github.com/wailsapp/wails/pull/2483)
+- Fixed unicode encoding of strings for multi-rune characters. Fixed by @joshbuddy in [PR](https://github.com/wailsapp/wails/pull/2509)
+- Fixed `-skipbindings` flag in `wails dev`. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2584)
+- Fixed `runtime.MenuUpdateApplicationMenu` on macOS. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2588)
+- Fixed add package name for `libwebkit`/`pkg-config` and use shell.RunCommandWithENV instead of shell.RunCommand in `zypper.go`. Fixed by @wgjtyu in [PR](https://github.com/wailsapp/wails/pull/2593)
+- Make sure to start the CommonFileDialogs on Windows on the Main-Thread. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2606)
## v2.4.1 - 2023-03-20
### Changed
+
- Support single clicks on items with `--wails-draggable: drag` again on Windows. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2482)
### Fixed
+
- Fixed panic when using `wails dev` and the AssetServer tried to log to the logger. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2481)
- Fixed compatibility with WebView2 Runtime > `110.0.1587.69` which showed a `connection refused` html page before doing a reload of the frontend. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2496)
## v2.4.0 - 2023-03-08
### Added
+
- Added Webview GPU acceleration options for [Windows](/docs/reference/options#webviewgpuisdisabled) and [Linux](/docs/reference/options#webviewgpupolicy). Added by @Lyimmi in [PR](https://github.com/wailsapp/wails/pull/2266)
- Added `EnableFraudulentWebsiteDetection` option to opt-in to scan services for fraudulent content, such as malware or phishing attempts. Older releases had the scan services per default activated. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2269)
- Allow an [AssetServer Middleware](/docs/reference/options#middleware) to specify the `Content-Type` of a file served by the [Assets](/docs/reference/options#assets-1) `fs.FS`. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2286)
- The AssetServer now detects more mimetypes by extension, e.g. `.mjs`. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2391)
### Changed
+
- Improved fullscreen mode for frameless window on Windows. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279), [PR](https://github.com/wailsapp/wails/pull/2288) and [PR](https://github.com/wailsapp/wails/pull/2299)
- On Windows unmaximising a window has no effect anymore when the window is in fullscreen mode, this makes it consistent with e.g. macOS. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279)
- Frameless resize now sets the cursor on documentElement, otherwise resizing cursor won't be shown outside of the body rectangle. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2289)
@@ -42,11 +60,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- NSIS template now installs the shortcuts for all users and not only for the current user. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2373)
### Fixed
+
- Fixed failing build hooks when `build/bin` was missing. Fixed by @Lyimmi in [PR](https://github.com/wailsapp/wails/pull/2273)
- Fixed fullscreen mode for frameless window on Windows to fully cover the taskbar when changing into fullscreen from maximised state. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279)
- Fixed set window background colour on Windows when setting the colour via runtime. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279)
- Fixed the showing of a white border around a fullscreen window when `DisableWindowIcon` is active on Windows. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2299)
-- Fixed the sometimes lagging drag experience with `--wails-draggable` on Windows. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2302)
+- Fixed the sometimes lagging drag experience with `--wails-draggable` on Windows. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2302)
- Fixed applying the default arch to platform flag in wails cli. If only a `GOOS` has been supplied as platform flag e.g. `wails build --platform windows` the current architecture wasn't applied and the build failed. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2309)
- Fixed a segfault on opening the inspector on older macOS versions. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2397)
- Fixed the macos single architecture builds not respecting an output file name specified with the '-o' flag. Fixed by @gwynforthewyn in [PR](https://github.com/wailsapp/wails/pull/2358)
@@ -58,6 +77,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## v2.3.0 - 2022-12-29
### 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)
@@ -76,6 +96,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Added Korean translation for the website. Added by @cybertramp in [PR](https://github.com/wailsapp/wails/pull/2093)
### Fixed
+
- The `noreload` flag in wails dev wasn't applied. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2081)
- `build/bin` folder was duplicating itself on each reload in `wails dev` mode. Fixed by @OlegGulevskyy in this [PR](https://github.com/wailsapp/wails/pull/2103)
- Prevent a thin white line at the bottom of a frameless window on Windows. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2111)
@@ -91,6 +112,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Fixed React Hash Router link in docs. Fixed by @marvinhosea in [PR](https://github.com/wailsapp/wails/pull/2050)
### Changed
+
- Improve error message if no `index.html` could be found in the assets and validate assetserver options. Changed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2110)
- Promote the Go WebView2Loader from experimental to stable. This means now per default all Wails build use the new loader introduced with `v2.2.0`. The old loader remains usable with build tag `native_webview2loader` for the next few releases. Changed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2199)
- Refactored CLI. Changed by @leaanthony in this [PR](https://github.com/wailsapp/wails/pull/2123)
diff --git a/website/i18n/ko/docusaurus-plugin-content-pages/credits.mdx b/website/i18n/ko/docusaurus-plugin-content-pages/credits.mdx
index 0f210680505..af5cd28c530 100644
--- a/website/i18n/ko/docusaurus-plugin-content-pages/credits.mdx
+++ b/website/i18n/ko/docusaurus-plugin-content-pages/credits.mdx
@@ -12,9 +12,7 @@
## Contributors
-
-
-
+
-
-
-
-
+
## Special Mentions
diff --git a/website/i18n/ko/docusaurus-theme-classic/footer.json b/website/i18n/ko/docusaurus-theme-classic/footer.json
index 0a204f208a9..4f31e1920ac 100644
--- a/website/i18n/ko/docusaurus-theme-classic/footer.json
+++ b/website/i18n/ko/docusaurus-theme-classic/footer.json
@@ -54,5 +54,9 @@
"link.item.label.Discord": {
"message": "Discord",
"description": "The label of footer link with label=Discord linking to https://discord.gg/JDdSxwjhGf"
+ },
+ "logo.alt": {
+ "message": "Wails Logo",
+ "description": "The alt text of footer logo"
}
}
diff --git a/website/i18n/ko/docusaurus-theme-classic/navbar.json b/website/i18n/ko/docusaurus-theme-classic/navbar.json
index 33101f21b73..eba994190b5 100644
--- a/website/i18n/ko/docusaurus-theme-classic/navbar.json
+++ b/website/i18n/ko/docusaurus-theme-classic/navbar.json
@@ -38,5 +38,9 @@
"item.label.Code of Conduct": {
"message": "코드 지침",
"description": "Navbar item with label Code of Conduct"
+ },
+ "logo.alt": {
+ "message": "Wails Logo",
+ "description": "The alt text of navbar logo"
}
}
diff --git a/website/i18n/pt/code.json b/website/i18n/pt/code.json
index efeb4074df0..2944e237279 100644
--- a/website/i18n/pt/code.json
+++ b/website/i18n/pt/code.json
@@ -32,7 +32,7 @@
},
"theme.ErrorPageContent.tryAgain": {
"message": "Tente novamente",
- "description": "The label of the button to try again when the page crashed"
+ "description": "The label of the button to try again rendering when the React error boundary captures an error"
},
"theme.NotFound.title": {
"message": "Página não encontrada",
@@ -419,5 +419,13 @@
"theme.docs.sidebar.toggleSidebarButtonAriaLabel": {
"message": "Toggle navigation bar",
"description": "The ARIA label for hamburger menu button of mobile navigation"
+ },
+ "theme.NavBar.navAriaLabel": {
+ "message": "Main",
+ "description": "The ARIA label for the main navigation"
+ },
+ "theme.docs.sidebar.navAriaLabel": {
+ "message": "Docs sidebar",
+ "description": "The ARIA label for the sidebar navigation"
}
}
diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/community/templates.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/templates.mdx
index 0279e39d1a4..00d82e74eb7 100644
--- a/website/i18n/pt/docusaurus-plugin-content-docs/current/community/templates.mdx
+++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/templates.mdx
@@ -31,6 +31,7 @@ Se você não tiver certeza sobre um template, inspecione `package.json` e `wail
## Angular
+- [wails-template-angular](https://github.com/mateothegreat/wails-template-angular) - Angular 15+ action packed & ready to roll to production.
- [wails-angular-template](https://github.com/TAINCER/wails-angular-template) - Angular with TypeScript, Sass, Hot-Reload, Code-Splitting and i18n
## React
@@ -47,6 +48,11 @@ Se você não tiver certeza sobre um template, inspecione `package.json` e `wail
- [wails-vite-svelte-tailwind-template](https://github.com/BillBuilt/wails-vite-svelte-tailwind-template) - A template using Svelte and Vite with TailwindCSS v3
- [wails-sveltekit-template](https://github.com/h8gi/wails-sveltekit-template) - A template using SvelteKit
+## Solid
+
+- [wails-template-vite-solid-ts](https://github.com/xijaja/wails-template-solid-ts) - A template using Solid + Ts + Vite
+- [wails-template-vite-solid-js](https://github.com/xijaja/wails-template-solid-js) - A template using Solid + Js + Vite
+
## Elm
- [wails-elm-template](https://github.com/benjamin-thomas/wails-elm-template) - Develop your GUI app with functional programming and a **snappy** hot-reload setup :tada: :rocket:
diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/routing.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/routing.mdx
index 54e7073df15..90d06d2872d 100644
--- a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/routing.mdx
+++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/routing.mdx
@@ -27,7 +27,7 @@ RouterModule.forRoot(routes, { useHash: true });
## React
-A abordagem recomendada para roteamento em React é [HashRouter](https://reactrouter.com/docs/en/v6/routers/hash-router):
+The recommended approach for routing in React is [HashRouter](https://reactrouter.com/en/main/router-components/hash-router):
```jsx
import { HashRouter } from "react-router-dom";
diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/menus.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/menus.mdx
index 304f57d65c2..ff9a2442281 100644
--- a/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/menus.mdx
+++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/menus.mdx
@@ -9,12 +9,15 @@ It is possible to add an application menu to Wails projects. This is achieved by
An example of how to create a menu:
```go
+
+ app := NewApp()
+
AppMenu := menu.NewMenu()
FileMenu := AppMenu.AddSubmenu("File")
FileMenu.AddText("&Open", keys.CmdOrCtrl("o"), openFile)
FileMenu.AddSeparator()
FileMenu.AddText("Quit", keys.CmdOrCtrl("q"), func(_ *menu.CallbackData) {
- runtime.Quit()
+ runtime.Quit(app.ctx)
})
if runtime.GOOS == "darwin" {
@@ -25,7 +28,7 @@ An example of how to create a menu:
Title: "Menus Demo",
Width: 800,
Height: 600,
- Menu: AppMenu,
+ Menu: AppMenu, // reference the menu above
Bind: []interface{}{
app,
},
diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/options.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/options.mdx
index 49214bb08c1..451d7a9482c 100644
--- a/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/options.mdx
+++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/options.mdx
@@ -234,8 +234,8 @@ Not all features of an `http.Request` are currently supported, please see the fo
| PATCH | ✅ | ✅ | ✅ [^1] |
| DELETE | ✅ | ✅ | ✅ [^1] |
| Request Headers | ✅ | ✅ | ✅ [^1] |
-| Request Body | ✅ | ✅ | ❌ |
-| Request Body Streaming | ✅ | ✅ | ❌ |
+| Request Body | ✅ | ✅ | ✅ [^2] |
+| Request Body Streaming | ✅ | ✅ | ✅ [^2] |
| Response StatusCodes | ✅ | ✅ | ✅ [^1] |
| Response Headers | ✅ | ✅ | ✅ [^1] |
| Response Body | ✅ | ✅ | ✅ |
@@ -763,4 +763,5 @@ Setting this to `true` will open the WebInspector on startup of the application.
Name: OpenInspectorOnStartup
Type: `bool`
-[^1]: This requires WebKit2GTK 2.36+ support and your app needs to be build with the build tag `webkit2_36` to activate support for this feature. This also bumps the minimum requirement of WebKit2GTK to 2.36 for your app.
+[^1]: This requires WebKit2GTK 2.36+ support and your app needs to be build with the build tag `webkit2_36` to activate support for this feature. This also bumps the minimum requirement of WebKit2GTK to 2.36 for your app.
+[^2]: This requires WebKit2GTK 2.40+ support and your app needs to be build with the build tag `webkit2_40` to activate support for this feature. This also bumps the minimum requirement of WebKit2GTK to 2.40 for your app.
diff --git a/website/i18n/pt/docusaurus-plugin-content-pages/changelog.mdx b/website/i18n/pt/docusaurus-plugin-content-pages/changelog.mdx
index 52a9b6665c8..039e4cc102c 100644
--- a/website/i18n/pt/docusaurus-plugin-content-pages/changelog.mdx
+++ b/website/i18n/pt/docusaurus-plugin-content-pages/changelog.mdx
@@ -13,28 +13,46 @@ O formato é baseado em [Manter um Log de Alterações](https://keepachangelog.c
## [Unreleased]
+### Adicionado
+
+- Added Nodejs version in `wails doctor`. Added by @misitebao in [PR](https://github.com/wailsapp/wails/pull/2546)
+- Added support for WebKit2GTK 2.40+ on Linux. This brings additional features for the [AssetServer](/docs/reference/options#assetserver), like support for HTTP Request Bodies. The app must be compiled with the Go build tag `webkit2_40` to activate support for this features. This also bumps the minimum requirement of WebKit2GTK to 2.40 for your app. Added by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2592)
+
### Alterado
+
- [v3] Typescript model generation using `StructDef`s from new AST-based parser. Added by @ATenderholt in [PR1](https://github.com/wailsapp/wails/pull/2428/files) and [PR2](https://github.com/wailsapp/wails/pull/2485).
+### Corrigido
+
+- Fixed console printing in `wails generate template`. Fixed by @misitebao in [PR](https://github.com/wailsapp/wails/pull/2483)
+- Fixed unicode encoding of strings for multi-rune characters. Fixed by @joshbuddy in [PR](https://github.com/wailsapp/wails/pull/2509)
+- Fixed `-skipbindings` flag in `wails dev`. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2584)
+- Fixed `runtime.MenuUpdateApplicationMenu` on macOS. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2588)
+- Fixed add package name for `libwebkit`/`pkg-config` and use shell.RunCommandWithENV instead of shell.RunCommand in `zypper.go`. Fixed by @wgjtyu in [PR](https://github.com/wailsapp/wails/pull/2593)
+- Make sure to start the CommonFileDialogs on Windows on the Main-Thread. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2606)
## v2.4.1 - 2023-03-20
### Alterado
+
- Support single clicks on items with `--wails-draggable: drag` again on Windows. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2482)
### Corrigido
+
- Fixed panic when using `wails dev` and the AssetServer tried to log to the logger. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2481)
- Fixed compatibility with WebView2 Runtime > `110.0.1587.69` which showed a `connection refused` html page before doing a reload of the frontend. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2496)
## v2.4.0 - 2023-03-08
### Adicionado
+
- Added Webview GPU acceleration options for [Windows](/docs/reference/options#webviewgpuisdisabled) and [Linux](/docs/reference/options#webviewgpupolicy). Added by @Lyimmi in [PR](https://github.com/wailsapp/wails/pull/2266)
- Added `EnableFraudulentWebsiteDetection` option to opt-in to scan services for fraudulent content, such as malware or phishing attempts. Older releases had the scan services per default activated. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2269)
- Allow an [AssetServer Middleware](/docs/reference/options#middleware) to specify the `Content-Type` of a file served by the [Assets](/docs/reference/options#assets-1) `fs.FS`. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2286)
- The AssetServer now detects more mimetypes by extension, e.g. `.mjs`. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2391)
### Alterado
+
- Improved fullscreen mode for frameless window on Windows. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279), [PR](https://github.com/wailsapp/wails/pull/2288) and [PR](https://github.com/wailsapp/wails/pull/2299)
- On Windows unmaximising a window has no effect anymore when the window is in fullscreen mode, this makes it consistent with e.g. macOS. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279)
- Frameless resize now sets the cursor on documentElement, otherwise resizing cursor won't be shown outside of the body rectangle. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2289)
@@ -42,11 +60,12 @@ O formato é baseado em [Manter um Log de Alterações](https://keepachangelog.c
- NSIS template now installs the shortcuts for all users and not only for the current user. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2373)
### Corrigido
+
- Fixed failing build hooks when `build/bin` was missing. Fixed by @Lyimmi in [PR](https://github.com/wailsapp/wails/pull/2273)
- Fixed fullscreen mode for frameless window on Windows to fully cover the taskbar when changing into fullscreen from maximised state. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279)
- Fixed set window background colour on Windows when setting the colour via runtime. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279)
- Fixed the showing of a white border around a fullscreen window when `DisableWindowIcon` is active on Windows. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2299)
-- Fixed the sometimes lagging drag experience with `--wails-draggable` on Windows. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2302)
+- Fixed the sometimes lagging drag experience with `--wails-draggable` on Windows. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2302)
- Fixed applying the default arch to platform flag in wails cli. If only a `GOOS` has been supplied as platform flag e.g. `wails build --platform windows` the current architecture wasn't applied and the build failed. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2309)
- Fixed a segfault on opening the inspector on older macOS versions. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2397)
- Fixed the macos single architecture builds not respecting an output file name specified with the '-o' flag. Fixed by @gwynforthewyn in [PR](https://github.com/wailsapp/wails/pull/2358)
@@ -58,6 +77,7 @@ O formato é baseado em [Manter um Log de Alterações](https://keepachangelog.c
## v2.3.0 - 2022-12-29
### Adicionado
+
- 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)
@@ -76,6 +96,7 @@ O formato é baseado em [Manter um Log de Alterações](https://keepachangelog.c
- Added Korean translation for the website. Added by @cybertramp in [PR](https://github.com/wailsapp/wails/pull/2093)
### Corrigido
+
- The `noreload` flag in wails dev wasn't applied. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2081)
- `build/bin` folder was duplicating itself on each reload in `wails dev` mode. Fixed by @OlegGulevskyy in this [PR](https://github.com/wailsapp/wails/pull/2103)
- Prevent a thin white line at the bottom of a frameless window on Windows. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2111)
@@ -91,6 +112,7 @@ O formato é baseado em [Manter um Log de Alterações](https://keepachangelog.c
- Fixed React Hash Router link in docs. Fixed by @marvinhosea in [PR](https://github.com/wailsapp/wails/pull/2050)
### Alterado
+
- Improve error message if no `index.html` could be found in the assets and validate assetserver options. Changed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2110)
- Promote the Go WebView2Loader from experimental to stable. This means now per default all Wails build use the new loader introduced with `v2.2.0`. The old loader remains usable with build tag `native_webview2loader` for the next few releases. Changed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2199)
- Refactored CLI. Changed by @leaanthony in this [PR](https://github.com/wailsapp/wails/pull/2123)
diff --git a/website/i18n/pt/docusaurus-plugin-content-pages/credits.mdx b/website/i18n/pt/docusaurus-plugin-content-pages/credits.mdx
index 0f210680505..af5cd28c530 100644
--- a/website/i18n/pt/docusaurus-plugin-content-pages/credits.mdx
+++ b/website/i18n/pt/docusaurus-plugin-content-pages/credits.mdx
@@ -12,9 +12,7 @@
## Contributors
-
-
-
+
-
-
-
-
+
## Special Mentions
diff --git a/website/i18n/pt/docusaurus-theme-classic/footer.json b/website/i18n/pt/docusaurus-theme-classic/footer.json
index db8ed5137e3..b7a2860ef13 100644
--- a/website/i18n/pt/docusaurus-theme-classic/footer.json
+++ b/website/i18n/pt/docusaurus-theme-classic/footer.json
@@ -54,5 +54,9 @@
"link.item.label.Discord": {
"message": "Discord",
"description": "The label of footer link with label=Discord linking to https://discord.gg/JDdSxwjhGf"
+ },
+ "logo.alt": {
+ "message": "Wails Logo",
+ "description": "The alt text of footer logo"
}
}
diff --git a/website/i18n/pt/docusaurus-theme-classic/navbar.json b/website/i18n/pt/docusaurus-theme-classic/navbar.json
index b8957114cbc..da208d172fe 100644
--- a/website/i18n/pt/docusaurus-theme-classic/navbar.json
+++ b/website/i18n/pt/docusaurus-theme-classic/navbar.json
@@ -38,5 +38,9 @@
"item.label.Code of Conduct": {
"message": "Código de Conduta",
"description": "Navbar item with label Code of Conduct"
+ },
+ "logo.alt": {
+ "message": "Wails Logo",
+ "description": "The alt text of navbar logo"
}
}
diff --git a/website/i18n/ru/code.json b/website/i18n/ru/code.json
index b4b61539f14..379b48f5296 100644
--- a/website/i18n/ru/code.json
+++ b/website/i18n/ru/code.json
@@ -32,7 +32,7 @@
},
"theme.ErrorPageContent.tryAgain": {
"message": "Попробуйте еще раз",
- "description": "The label of the button to try again when the page crashed"
+ "description": "The label of the button to try again rendering when the React error boundary captures an error"
},
"theme.NotFound.title": {
"message": "Страница не найдена",
@@ -419,5 +419,13 @@
"theme.docs.sidebar.toggleSidebarButtonAriaLabel": {
"message": "Toggle navigation bar",
"description": "The ARIA label for hamburger menu button of mobile navigation"
+ },
+ "theme.NavBar.navAriaLabel": {
+ "message": "Main",
+ "description": "The ARIA label for the main navigation"
+ },
+ "theme.docs.sidebar.navAriaLabel": {
+ "message": "Docs sidebar",
+ "description": "The ARIA label for the sidebar navigation"
}
}
diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/community/templates.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/templates.mdx
index d649393e612..74b7673f024 100644
--- a/website/i18n/ru/docusaurus-plugin-content-docs/current/community/templates.mdx
+++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/templates.mdx
@@ -31,6 +31,7 @@ sidebar_position: 1
## Angular
+- [wails-template-angular](https://github.com/mateothegreat/wails-template-angular) - Angular 15+ action packed & ready to roll to production.
- [wails-угловый-template](https://github.com/TAINCER/wails-angular-template) - Angular с TypeScript, Sass, Hot-Reload, Code-Splitting и i18n
## React
@@ -47,6 +48,11 @@ sidebar_position: 1
- [wails-vite-svelte-tailwind-template](https://github.com/BillBuilt/wails-vite-svelte-tailwind-template) - шаблон с использованием Svelte и Vite с TailwindCSS v3
- [wails-sveltekit-template](https://github.com/h8gi/wails-sveltekit-template) - шаблон с использованием SvelteKit
+## Solid
+
+- [wails-template-vite-solid-ts](https://github.com/xijaja/wails-template-solid-ts) - A template using Solid + Ts + Vite
+- [wails-template-vite-solid-js](https://github.com/xijaja/wails-template-solid-js) - A template using Solid + Js + Vite
+
## Elm
- [wails-elm-шаблон](https://github.com/benjamin-thomas/wails-elm-template) - Разработайте ваше GUI приложение с функциональным программированием и **snappy** настройками горячей перезагрузки :tada: :rocket:
diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/routing.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/routing.mdx
index a51741b2e42..acb1eb656d6 100644
--- a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/routing.mdx
+++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/routing.mdx
@@ -27,7 +27,7 @@ RouterModule.forRoot(routes, { useHash: true });
## React
-Рекомендуемый подход к маршрутизации в React - [HashRouter](https://reactrouter.com/docs/en/v6/routers/hash-router):
+The recommended approach for routing in React is [HashRouter](https://reactrouter.com/en/main/router-components/hash-router):
```jsx
import { HashRouter } from "react-router-dom";
diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/menus.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/menus.mdx
index 304f57d65c2..ff9a2442281 100644
--- a/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/menus.mdx
+++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/menus.mdx
@@ -9,12 +9,15 @@ It is possible to add an application menu to Wails projects. This is achieved by
An example of how to create a menu:
```go
+
+ app := NewApp()
+
AppMenu := menu.NewMenu()
FileMenu := AppMenu.AddSubmenu("File")
FileMenu.AddText("&Open", keys.CmdOrCtrl("o"), openFile)
FileMenu.AddSeparator()
FileMenu.AddText("Quit", keys.CmdOrCtrl("q"), func(_ *menu.CallbackData) {
- runtime.Quit()
+ runtime.Quit(app.ctx)
})
if runtime.GOOS == "darwin" {
@@ -25,7 +28,7 @@ An example of how to create a menu:
Title: "Menus Demo",
Width: 800,
Height: 600,
- Menu: AppMenu,
+ Menu: AppMenu, // reference the menu above
Bind: []interface{}{
app,
},
diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/options.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/options.mdx
index 49214bb08c1..451d7a9482c 100644
--- a/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/options.mdx
+++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/options.mdx
@@ -234,8 +234,8 @@ Not all features of an `http.Request` are currently supported, please see the fo
| PATCH | ✅ | ✅ | ✅ [^1] |
| DELETE | ✅ | ✅ | ✅ [^1] |
| Request Headers | ✅ | ✅ | ✅ [^1] |
-| Request Body | ✅ | ✅ | ❌ |
-| Request Body Streaming | ✅ | ✅ | ❌ |
+| Request Body | ✅ | ✅ | ✅ [^2] |
+| Request Body Streaming | ✅ | ✅ | ✅ [^2] |
| Response StatusCodes | ✅ | ✅ | ✅ [^1] |
| Response Headers | ✅ | ✅ | ✅ [^1] |
| Response Body | ✅ | ✅ | ✅ |
@@ -763,4 +763,5 @@ Setting this to `true` will open the WebInspector on startup of the application.
Name: OpenInspectorOnStartup
Type: `bool`
-[^1]: This requires WebKit2GTK 2.36+ support and your app needs to be build with the build tag `webkit2_36` to activate support for this feature. This also bumps the minimum requirement of WebKit2GTK to 2.36 for your app.
+[^1]: This requires WebKit2GTK 2.36+ support and your app needs to be build with the build tag `webkit2_36` to activate support for this feature. This also bumps the minimum requirement of WebKit2GTK to 2.36 for your app.
+[^2]: This requires WebKit2GTK 2.40+ support and your app needs to be build with the build tag `webkit2_40` to activate support for this feature. This also bumps the minimum requirement of WebKit2GTK to 2.40 for your app.
diff --git a/website/i18n/ru/docusaurus-plugin-content-pages/changelog.mdx b/website/i18n/ru/docusaurus-plugin-content-pages/changelog.mdx
index d572f4a3494..fad847dd8ab 100644
--- a/website/i18n/ru/docusaurus-plugin-content-pages/changelog.mdx
+++ b/website/i18n/ru/docusaurus-plugin-content-pages/changelog.mdx
@@ -13,28 +13,46 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## [Unreleased]
+### Added
+
+- Added Nodejs version in `wails doctor`. Added by @misitebao in [PR](https://github.com/wailsapp/wails/pull/2546)
+- Added support for WebKit2GTK 2.40+ on Linux. This brings additional features for the [AssetServer](/docs/reference/options#assetserver), like support for HTTP Request Bodies. The app must be compiled with the Go build tag `webkit2_40` to activate support for this features. This also bumps the minimum requirement of WebKit2GTK to 2.40 for your app. Added by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2592)
+
### Changed
+
- [v3] Typescript model generation using `StructDef`s from new AST-based parser. Added by @ATenderholt in [PR1](https://github.com/wailsapp/wails/pull/2428/files) and [PR2](https://github.com/wailsapp/wails/pull/2485).
+### Fixed
+
+- Fixed console printing in `wails generate template`. Fixed by @misitebao in [PR](https://github.com/wailsapp/wails/pull/2483)
+- Fixed unicode encoding of strings for multi-rune characters. Fixed by @joshbuddy in [PR](https://github.com/wailsapp/wails/pull/2509)
+- Fixed `-skipbindings` flag in `wails dev`. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2584)
+- Fixed `runtime.MenuUpdateApplicationMenu` on macOS. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2588)
+- Fixed add package name for `libwebkit`/`pkg-config` and use shell.RunCommandWithENV instead of shell.RunCommand in `zypper.go`. Fixed by @wgjtyu in [PR](https://github.com/wailsapp/wails/pull/2593)
+- Make sure to start the CommonFileDialogs on Windows on the Main-Thread. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2606)
## v2.4.1 - 2023-03-20
### Changed
+
- Support single clicks on items with `--wails-draggable: drag` again on Windows. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2482)
### Fixed
+
- Fixed panic when using `wails dev` and the AssetServer tried to log to the logger. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2481)
- Fixed compatibility with WebView2 Runtime > `110.0.1587.69` which showed a `connection refused` html page before doing a reload of the frontend. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2496)
## v2.4.0 - 2023-03-08
### Added
+
- Added Webview GPU acceleration options for [Windows](/docs/reference/options#webviewgpuisdisabled) and [Linux](/docs/reference/options#webviewgpupolicy). Added by @Lyimmi in [PR](https://github.com/wailsapp/wails/pull/2266)
- Added `EnableFraudulentWebsiteDetection` option to opt-in to scan services for fraudulent content, such as malware or phishing attempts. Older releases had the scan services per default activated. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2269)
- Allow an [AssetServer Middleware](/docs/reference/options#middleware) to specify the `Content-Type` of a file served by the [Assets](/docs/reference/options#assets-1) `fs.FS`. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2286)
- The AssetServer now detects more mimetypes by extension, e.g. `.mjs`. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2391)
### Changed
+
- Improved fullscreen mode for frameless window on Windows. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279), [PR](https://github.com/wailsapp/wails/pull/2288) and [PR](https://github.com/wailsapp/wails/pull/2299)
- On Windows unmaximising a window has no effect anymore when the window is in fullscreen mode, this makes it consistent with e.g. macOS. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279)
- Frameless resize now sets the cursor on documentElement, otherwise resizing cursor won't be shown outside of the body rectangle. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2289)
@@ -42,11 +60,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- NSIS template now installs the shortcuts for all users and not only for the current user. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2373)
### Fixed
+
- Fixed failing build hooks when `build/bin` was missing. Fixed by @Lyimmi in [PR](https://github.com/wailsapp/wails/pull/2273)
- Fixed fullscreen mode for frameless window on Windows to fully cover the taskbar when changing into fullscreen from maximised state. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279)
- Fixed set window background colour on Windows when setting the colour via runtime. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279)
- Fixed the showing of a white border around a fullscreen window when `DisableWindowIcon` is active on Windows. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2299)
-- Fixed the sometimes lagging drag experience with `--wails-draggable` on Windows. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2302)
+- Fixed the sometimes lagging drag experience with `--wails-draggable` on Windows. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2302)
- Fixed applying the default arch to platform flag in wails cli. If only a `GOOS` has been supplied as platform flag e.g. `wails build --platform windows` the current architecture wasn't applied and the build failed. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2309)
- Fixed a segfault on opening the inspector on older macOS versions. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2397)
- Fixed the macos single architecture builds not respecting an output file name specified with the '-o' flag. Fixed by @gwynforthewyn in [PR](https://github.com/wailsapp/wails/pull/2358)
@@ -58,6 +77,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## v2.3.0 - 2022-12-29
### 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)
@@ -76,6 +96,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Added Korean translation for the website. Added by @cybertramp in [PR](https://github.com/wailsapp/wails/pull/2093)
### Fixed
+
- The `noreload` flag in wails dev wasn't applied. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2081)
- `build/bin` folder was duplicating itself on each reload in `wails dev` mode. Fixed by @OlegGulevskyy in this [PR](https://github.com/wailsapp/wails/pull/2103)
- Prevent a thin white line at the bottom of a frameless window on Windows. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2111)
@@ -91,6 +112,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Fixed React Hash Router link in docs. Fixed by @marvinhosea in [PR](https://github.com/wailsapp/wails/pull/2050)
### Changed
+
- Improve error message if no `index.html` could be found in the assets and validate assetserver options. Changed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2110)
- Promote the Go WebView2Loader from experimental to stable. This means now per default all Wails build use the new loader introduced with `v2.2.0`. The old loader remains usable with build tag `native_webview2loader` for the next few releases. Changed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2199)
- Refactored CLI. Changed by @leaanthony in this [PR](https://github.com/wailsapp/wails/pull/2123)
diff --git a/website/i18n/ru/docusaurus-plugin-content-pages/credits.mdx b/website/i18n/ru/docusaurus-plugin-content-pages/credits.mdx
index 78b5f0a2bd6..8292fbf1a64 100644
--- a/website/i18n/ru/docusaurus-plugin-content-pages/credits.mdx
+++ b/website/i18n/ru/docusaurus-plugin-content-pages/credits.mdx
@@ -12,9 +12,7 @@
## Contributors
-
-
-
+
-
-
-
-
+
## Special Mentions
diff --git a/website/i18n/ru/docusaurus-theme-classic/footer.json b/website/i18n/ru/docusaurus-theme-classic/footer.json
index e3340883cfe..4eb3c1e21b6 100644
--- a/website/i18n/ru/docusaurus-theme-classic/footer.json
+++ b/website/i18n/ru/docusaurus-theme-classic/footer.json
@@ -54,5 +54,9 @@
"link.item.label.Discord": {
"message": "Discord",
"description": "The label of footer link with label=Discord linking to https://discord.gg/JDdSxwjhGf"
+ },
+ "logo.alt": {
+ "message": "Wails Logo",
+ "description": "The alt text of footer logo"
}
}
diff --git a/website/i18n/ru/docusaurus-theme-classic/navbar.json b/website/i18n/ru/docusaurus-theme-classic/navbar.json
index 48a6e4b5014..1538bcbfd11 100644
--- a/website/i18n/ru/docusaurus-theme-classic/navbar.json
+++ b/website/i18n/ru/docusaurus-theme-classic/navbar.json
@@ -38,5 +38,9 @@
"item.label.Code of Conduct": {
"message": "Правила поведения",
"description": "Navbar item with label Code of Conduct"
+ },
+ "logo.alt": {
+ "message": "Wails Logo",
+ "description": "The alt text of navbar logo"
}
}
diff --git a/website/i18n/zh-Hans/code.json b/website/i18n/zh-Hans/code.json
index 6a978dfb0b9..91847c854c9 100644
--- a/website/i18n/zh-Hans/code.json
+++ b/website/i18n/zh-Hans/code.json
@@ -32,7 +32,7 @@
},
"theme.ErrorPageContent.tryAgain": {
"message": "重试",
- "description": "The label of the button to try again when the page crashed"
+ "description": "The label of the button to try again rendering when the React error boundary captures an error"
},
"theme.NotFound.title": {
"message": "找不到页面",
@@ -419,5 +419,13 @@
"theme.docs.sidebar.toggleSidebarButtonAriaLabel": {
"message": "切换导航栏",
"description": "The ARIA label for hamburger menu button of mobile navigation"
+ },
+ "theme.NavBar.navAriaLabel": {
+ "message": "Main",
+ "description": "The ARIA label for the main navigation"
+ },
+ "theme.docs.sidebar.navAriaLabel": {
+ "message": "文档侧边栏",
+ "description": "The ARIA label for the sidebar navigation"
}
}
diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/showcase/emailit.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/showcase/emailit.mdx
index c1817b70fff..701e96b5a95 100644
--- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/showcase/emailit.mdx
+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/showcase/emailit.mdx
@@ -7,4 +7,4 @@
```
-[EmailIt](https://github.com/raguay/EmailIt/) is a Wails 2 program that is a markdown based email sender only with nine notepads, scripts to manipulate the text, and templates. It also has a scripts terminal to run scripts in EmailIt on files in your system. The scripts and templates can be used from the commandline itself or with the Alfred, Keyboard Maestro, Dropzone, or PopClip extensions. It also supports scripts and themes downloaded form GitHub. Documentation is not complete, but the programs works. It’s built using Wails2 and Svelte, and the download is a universal macOS application.
+[EmailIt](https://github.com/raguay/EmailIt/) 是一个 Wails v2 程序,它是一个基于 Markdown 的电子邮件发送器,只有九个记事本、用于处理文本的脚本和模板。 它还有一个脚本终端,用于在 EmailIt 中对系统中的文件运行脚本。 脚本和模板可以从命令行本身使用,也可以与 Alfred、Keyboard Maestro、Dropzone 或 PopClip 扩展一起使用。 它还支持从 GitHub 下载的脚本和主题。 文档不完整,但程序有效。 它是使用 Wails v2 和 Svelte 构建的,下载的是一个通用的 macOS 应用程序。
diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/showcase/encrypteasy.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/showcase/encrypteasy.mdx
index 7504950ea76..df788c69cbd 100644
--- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/showcase/encrypteasy.mdx
+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/showcase/encrypteasy.mdx
@@ -7,6 +7,6 @@
```
-**[EncryptEasy](https://www.encrypteasy.app) is a simple and easy to use PGP encryption tool, managing all your and your contacts keys. Encryption should be simple. Developed with Wails.**
+**[EncryptEasy](https://www.encrypteasy.app) 是一个简单易用的 PGP 加密工具,管理您和您的所有联系人密钥。 加密应该很简单。 使用 Wails 开发。**
-Encrypting messages using PGP is the industry standard. Everyone has a private and a public key. Your private key, well, needs to be kept private so only you can read messages. Your public key is distributed to anyone who wants to send you secret, encrypted messages. Managing keys, encrypting messages and decrypting messages should be a smooth experience. EncryptEasy is all about making it easy.
+使用 PGP 加密消息是行业标准。 每个人都有私钥和公钥。 您的私钥需要保密,因此只有您可以阅读消息。 您的公钥会分发给任何想向您发送秘密加密消息的人。 管理密钥、加密消息和解密消息应该是一种流畅的体验。 EncryptEasy 就是要让它变得简单。
diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/showcase/filehound.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/showcase/filehound.mdx
index bc569c3fec4..a0566cccf7a 100644
--- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/showcase/filehound.mdx
+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/showcase/filehound.mdx
@@ -7,10 +7,10 @@
```
-[FileHound Export Utility](https://www.filehound.co.uk/) FileHound is a cloud document management platform made for secure file retention, business process automation and SmartCapture capabilities.
+[FileHound Export Utility](https://www.filehound.co.uk/) FileHound 是一个云文档管理平台,用于安全文件保留、业务流程自动化和 SmartCapture 功能。
-The FileHound Export Utility allows FileHound Administrators the ability to run a secure document and data extraction tasks for alternative back-up and recovery purposes. This application will download all documents and/or meta data saved in FileHound based on the filters you choose. The metadata will be exported in both JSON and XML formats.
+FileHound Export Utility 允许 FileHound 管理员运行安全文档和数据提取任务以备选备份和恢复目的。 此应用程序将根据您选择的过滤器下载保存在 FileHound 中的所有文档和/或元数据。 元数据将以 JSON 和 XML 格式导出。
-Backend built with: Go 1.15 Wails 1.11.0 go-sqlite3 1.14.6 go-linq 3.2
+后端构建使用:Go 1.15 Wails 1.11.0 go-sqlite3 1.14.6 go-linq 3.2
-Frontend with: Vue 2.6.11 Vuex 3.4.0 TypeScript Tailwind 1.9.6
+前端使用:Vue 2.6.11 Vuex 3.4.0 TypeScript Tailwind 1.9.6
diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/showcase/modalfilemanager.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/showcase/modalfilemanager.mdx
index bcd21239607..634ef3329bb 100644
--- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/showcase/modalfilemanager.mdx
+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/showcase/modalfilemanager.mdx
@@ -9,6 +9,6 @@
```
-[Modal File Manager](https://github.com/raguay/ModalFileManager) is a dual pane file manager using web technologies. My original design was based on NW.js and can be found [here](https://github.com/raguay/ModalFileManager-NWjs). This version uses the same Svelte based frontend code (but it has be greatly modified since the departure from NW.js), but the backend is a [Wails 2](https://wails.io/) implementation. By using this implementation, I no longer use command line `rm`, `cp`, etc. commands, but a git install has to be on the system to download themes and extensions. It is fully coded using Go and runs much faster than the previous versions.
+[Modal File Manager](https://github.com/raguay/ModalFileManager) 是一个使用网络技术的双面板文件管理器。 我最初的设计是基于 NW.js 的,可以在 [这里](https://github.com/raguay/ModalFileManager-NWjs) 找到。 此版本使用相同的基于 Svelte 的前端代码(但自从 NW.js 脱离以来已进行了很大修改),但后端是 [Wails v2](https://wails.io/) 实现。 通过使用这个实现,我不再使用命令行 `rm`、`cp` 等命令,而是必须在系统上安装 git 才能下载主题和扩展。 它完全使用 Go 编码,运行速度比以前的版本快得多。
-This file manager is designed around the same principle as Vim: a state controlled keyboard actions. The number of states isn't fixed, but very programmable. Therefore, an infinite number of keyboard configurations can be created and used. This is the main difference from other file managers. There are themes and extensions available to download from GitHub.
+这个文件管理器是围绕与 Vim 相同的原则设计的:状态控制键盘操作。 状态的数量不是固定的,但非常可编程。 因此,可以创建和使用无数种键盘配置。 这是与其他文件管理器的主要区别。 可以从 GitHub 下载主题和扩展。
diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/templates.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/templates.mdx
index 425423ad4ef..be09b3def2e 100644
--- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/templates.mdx
+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/templates.mdx
@@ -31,6 +31,7 @@ sidebar_position: 1
## Angular
+- [wails-template-angular](https://github.com/mateothegreat/wails-template-angular) - Angular 15+ 已打包并准备投入生产。
- [wails-angular-template](https://github.com/TAINCER/wails-angular-template) - 带有 TypeScript, Sass, 热重载, 代码拆分和 i18n 的 Angular
## React
@@ -47,6 +48,11 @@ sidebar_position: 1
- [wails-vite-svelte-tailwind-template](https://github.com/BillBuilt/wails-vite-svelte-tailwind-template) - 使用 Svelte 和 Vite 和 TailwindCSS v3 的模板
- [wails-template-nextjs](https://github.com/LGiki/wails-template-nextjs) - 基于 Next.js + TypeScript 的模板
+## Solid
+
+- [wails-template-vite-solid-ts](https://github.com/xijaja/wails-template-solid-ts) - 使用 Solid + Ts + Vite 的模版。
+- [wails-template-vite-solid-js](https://github.com/xijaja/wails-template-solid-js) - 使用 Solid + Js + Vite 的模版。
+
## Elm
- [wails-elm-template](https://github.com/benjamin-thomas/wails-elm-template) - 使用函数式编程和 **快速** 的热重载设置开发您的 GUI 应用程序 :tada: :rocket:
diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/routing.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/routing.mdx
index b1b4c66903b..33704c645bc 100644
--- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/routing.mdx
+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/routing.mdx
@@ -27,7 +27,7 @@ RouterModule.forRoot(routes, { useHash: true });
## React
-React 中推荐的路由方法是 [HashRouter](https://reactrouter.com/docs/en/v6/routers/hash-router):
+在 React 中推荐的路由方法是 [HashRouter](https://reactrouter.com/en/main/router-components/hash-router):
```jsx
import { HashRouter } from "react-router-dom";
diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/menus.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/menus.mdx
index da4672d83a2..4e87c3f48f8 100644
--- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/menus.mdx
+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/menus.mdx
@@ -9,12 +9,15 @@ sidebar_position: 4
如何创建菜单的示例:
```go
+
+ app := NewApp()
+
AppMenu := menu.NewMenu()
FileMenu := AppMenu.AddSubmenu("File")
FileMenu.AddText("&Open", keys.CmdOrCtrl("o"), openFile)
FileMenu.AddSeparator()
FileMenu.AddText("Quit", keys.CmdOrCtrl("q"), func(_ *menu.CallbackData) {
- runtime.Quit()
+ runtime.Quit(app.ctx)
})
if runtime.GOOS == "darwin" {
@@ -25,7 +28,7 @@ sidebar_position: 4
Title: "Menus Demo",
Width: 800,
Height: 600,
- Menu: AppMenu,
+ Menu: AppMenu, // reference the menu above
Bind: []interface{}{
app,
},
diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/options.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/options.mdx
index fe992fdea53..69f6b9f694d 100644
--- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/options.mdx
+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/options.mdx
@@ -73,11 +73,11 @@ func main() {
LightModeTitleText: windows.RGB(20, 20, 20),
LightModeBorder: windows.RGB(200, 200, 200),
},
- // 可自定义的用户消息
+ // User messages that can be customised
Messages *windows.Messages
- // 当 Windows 进入低电量模式时调用 OnSuspend
+ // OnSuspend is called when Windows enters low power mode
OnSuspend func()
- // 当 Windows 从低电量模式恢复时调用 OnResume
+ // OnResume is called when Windows resumes from low power mode
OnResume func(),
WebviewGpuDisabled: false,
},
@@ -234,8 +234,8 @@ func main() {
| PATCH | ✅ | ✅ | ✅ [^1] |
| DELETE | ✅ | ✅ | ✅ [^1] |
| Request Headers | ✅ | ✅ | ✅ [^1] |
-| Request Body | ✅ | ✅ | ❌ |
-| Request Body Streaming | ✅ | ✅ | ❌ |
+| Request Body | ✅ | ✅ | ✅ [^2] |
+| Request Body Streaming | ✅ | ✅ | ✅ [^2] |
| Response StatusCodes | ✅ | ✅ | ✅ [^1] |
| Response Headers | ✅ | ✅ | ✅ [^1] |
| Response Body | ✅ | ✅ | ✅ |
@@ -780,3 +780,4 @@ func main() {
名称: OpenInspectorOnStartup
类型: `bool`
[^1]: 这需要 WebKit2GTK 2.36+ 支持,并且您的应用程序需要使用构建标签 `webkit2_36` 来构建以激活对此功能的支持。 这也会将您应用程序的 WebKit2GTK 最低要求提高到 2.36。
+[^2]: 这需要 WebKit2GTK 2.40+ 支持,并且您的应用程序需要使用构建标签 `webkit2_40` 来构建以激活对此功能的支持。 这也将您的应用程序的 WebKit2GTK 最低要求提高到 2.40。
diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/project-config.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/project-config.mdx
index fcc3d53cb71..9f7efc749a0 100644
--- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/project-config.mdx
+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/project-config.mdx
@@ -24,15 +24,18 @@ sidebar_position: 5
"frontend:install": "",
// 构建资产的命令,在前端目录中运行 - 通常是 `npm run build`
"frontend:build": "",
- // 此命令已被 frontend:dev:build 取代。如果未指定 frontend:dev:build 将回退到此命令。如果此命令也未指定,将回退到 frontend:build
+ // 此命令已被 frontend:dev:build 取代。如果未指定 frontend:dev:build 将回退到此命令。
+ // 如果此命令也未指定,将回退到 frontend:build
"frontend:dev": "",
- // 此命令是 frontend:build 的 dev 等价物。如果未指定回退到 frontend:dev
+ // 此命令是 frontend:build 的 dev 等价物。
+ // 如果未指定回退到 frontend:dev
"frontend:dev:build": "",
// 此命令是 frontend:install 的 dev 等价物。如果未指定回退到 frontend:install
"frontend:dev:install": "",
// 此命令在 `wails dev`上的单独进程中运行。用于第 3 方观察者或启动 3d 方开发服务器
"frontend:dev:watcher": "",
- // 用于服务资产的第 3 方开发服务器的 URL,比如 Vite。如果设置为 'auto' 那么 devServerUrl 将从 Vite 输出中推断出来
+ // 用于服务资产的第 3 方开发服务器的 URL,比如 Vite。
+ // 如果设置为 'auto' 那么 devServerUrl 将从 Vite 输出中推断出来
"frontend:dev:serverUrl": "",
// 创建自动生成的 JS 模块的目录的相对路径
"wailsjsdir": "",
@@ -48,21 +51,25 @@ sidebar_position: 5
"runNonNativeBuildHooks": false,
// 构建前 Hooks
"preBuildHooks": {
- // 在构建指定的 GOOS/GOARCH 之前将执行的命令:${platform} 被替换为“GOOS/GOARCH”。 “GOOS/GOARCH” hook 在“GOOS/*”和“*/*” hook 之前执行。
+ // 在构建指定的 GOOS/GOARCH 之前将执行的命令:${platform} 被替换为“GOOS/GOARCH”。
+ // “GOOS/GOARCH” hook 在“GOOS/*”和“*/*” hook 之前执行。
"GOOS/GOARCH": "",
- // 在指定 GOOS 的构建之前将执行的命令:${platform} 被替换为“GOOS/GOARCH”。 “GOOS/*” hook 在“*/*” hook 之前执行。
+ // 在指定 GOOS 的构建之前将执行的命令:${platform} 被替换为“GOOS/GOARCH”。
+ // “GOOS/*” hook 在“*/*” hook 之前执行。
"GOOS/*": "",
// 将在每次构建之前执行的命令:${platform} 替换为“GOOS/GOARCH”。
"*/*": ""
},
// 构建后 Hooks
"postBuildHooks": {
- // 在构建指定的 GOOS/GOARCH 之后将执行的命令:${platform} 替换为“GOOS/GOARCH”,${bin} 替换为已编译二进制文件的路径。 “GOOS/GOARCH” hook 在“GOOS/*”和“*/*” hook 之前执行。
+ // 在构建指定的 GOOS/GOARCH 之后将执行的命令:${platform} 替换为“GOOS/GOARCH”,
+ // ${bin} 替换为已编译二进制文件的路径。 “GOOS/GOARCH” hook 在“GOOS/*”和“*/*” hook 之前执行。
"GOOS/GOARCH": "",
- // 在构建指定的 GOOS 之后将执行的命令:${platform} 替换为“GOOS/GOARCH”,${bin} 替换为已编译二进制文件的路径。 “GOOS/*” hook 在“*/*” hook 之前执行。
+ // 在构建指定的 GOOS 之后将执行的命令:${platform} 替换为“GOOS/GOARCH”,
+ // ${bin} 替换为已编译二进制文件的路径。 “GOOS/*” hook 在“*/*” hook 之前执行。
"GOOS/*": "",
- // The command that will be executed after every build: ${platform} is replaced with the "GOOS/GOARCH" and ${bin} with the path to the compiled binary.
- // 每次构建后将执行的命令:${platform} 替换为“GOOS/GOARCH”,${bin} 替换为已编译二进制文件的路径。
+ // 每次构建后将执行的命令:${platform} 替换为“GOOS/GOARCH”,
+ // ${bin} 替换为已编译二进制文件的路径。
"*/*": ""
},
// 用于填充 manifest 和版本信息的数据。
@@ -87,6 +94,7 @@ sidebar_position: 5
// 使用 obfuscated 标志时传递给乱码命令的参数
"garbleargs": ""
}
+
```
该文件将在运行 `wails build` 或 `wails dev` 时,由 Wails CLI 读取。
diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-pages/changelog.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-pages/changelog.mdx
index 11bc74a23fa..6e2ab3e4e48 100644
--- a/website/i18n/zh-Hans/docusaurus-plugin-content-pages/changelog.mdx
+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-pages/changelog.mdx
@@ -13,28 +13,46 @@
## [即将发布]
+### 新增
+
+- 在 `wails doctor` 中添加了 Nodejs 版本。 由 @misitebao 在这个 [PR](https://github.com/wailsapp/wails/pull/2546) 中添加。
+- 在 Linux 上添加了对 WebKit2GTK 2.40+ 的支持。 这为 [AssetServer](/docs/reference/options#资产服务器) 带来了额外的特性,比如对 HTTP 请求体的支持。 应用程序必须使用 Go 构建标签 `webkit2_40` 进行编译,以激活对此功能的支持。 这也会将您应用程序的 WebKit2GTK 最低要求提高到 2.40。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2592) 中添加。
+
### 变更
+
- [v3] 使用 `StructDef` 从新的基于 AST 的解析器生成 Typescript 模型。 由 @ATenderholt 在 [PR1](https://github.com/wailsapp/wails/pull/2428/files) 和 [PR2](https://github.com/wailsapp/wails/pull/2485) 中添加
+### 修复
+
+- 修复 `wails generate template` 的控制台打印。 由 @misitebao 在这个 [PR](https://github.com/wailsapp/wails/pull/2483) 中修复。
+- 修复了多符号字符的字符串的 unicode 编码。 由 @joshbuddy 在这个 [PR](https://github.com/wailsapp/wails/pull/2509) 中修复
+- 修复 `wails dev` 的 `-skipbindings` 标志。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2584) 中修复
+- 修复 macOS 上的 `runtime.MenuUpdateApplicationMenu`。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2588) 中修复
+- 修复了为 `libwebkit`/`pkg-config` 添加包名称并在 `zypper.go` 中使用 shell.RunCommandWithENV 而不是 shell.RunCommand。 由 @wgjtyu 在这个 [PR](https://github.com/wailsapp/wails/pull/2593) 中修复
+- 确保在 Windows 上的主线程上启动 CommonFileDialogs。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2606) 中修复
## v2.4.1 - 2023-03-20
### 变更
+
- 支持在窗口上再次单击带有 `--wails-draggable: drag` 的项。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2482) 中变更
### 修复
+
- 修复了使用 `wails dev` 和 AssetServer 尝试记录到记录器时的 panic。 由 @stffabi 在 [PR](https://github.com/wailsapp/wails/pull/2481) 中修复
- 修复了与 WebView2 运行时大于 `110.0.1587.69` 的兼容性,它在重新加载前端之前显示 `connection refused` 的 html 页面。 由 @stffabi 在 [PR](https://github.com/wailsapp/wails/pull/2496) 中修复
## v2.4.0 - 2023-03-08
### 新增
+
- 为 [Windows](/docs/reference/options#webviewgpuisdisabled) 和 [Linux 添加了WebView GPU 加速选项](/docs/reference/options#webviewgpupolicy). @Lyimmi 在 [PR](https://github.com/wailsapp/wails/pull/2266) 中添加
- Added `EnableFraudulentWebsiteDetection` option to opt-in to scan services for fraudulent content, such as malware or phishing attempts. Older releases had the scan services per default activated. @stffabi 在 [PR](https://github.com/wailsapp/wails/pull/2269) 中添加
- Allow an [AssetServer Middleware](/docs/reference/options#middleware) to specify the `Content-Type` of a file served by the [Assets](/docs/reference/options#assets-1) `fs.FS`. @stffabi 在 [PR](https://github.com/wailsapp/wails/pull/2286) 中添加
- The AssetServer now detects more mimetypes by extension, e.g. `.mjs`. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2391)
### 变更
+
- Improved fullscreen mode for frameless window on Windows. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279), [PR](https://github.com/wailsapp/wails/pull/2288) and [PR](https://github.com/wailsapp/wails/pull/2299)
- On Windows unmaximising a window has no effect anymore when the window is in fullscreen mode, this makes it consistent with e.g. macOS. @stffabi 在 [PR](https://github.com/wailsapp/wails/pull/2279) 中修改
- Frameless resize now sets the cursor on documentElement, otherwise resizing cursor won't be shown outside of the body rectangle. @stffabi 在 [PR](https://github.com/wailsapp/wails/pull/2289) 中修改
@@ -42,11 +60,12 @@
- NSIS template now installs the shortcuts for all users and not only for the current user. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2373)
### 修复
+
- Fixed failing build hooks when `build/bin` was missing. @Lyimmi 在 [PR](https://github.com/wailsapp/wails/pull/2273) 中修复
- Fixed fullscreen mode for frameless window on Windows to fully cover the taskbar when changing into fullscreen from maximised state. @stffabi 在 [PR](https://github.com/wailsapp/wails/pull/2279) 中修复
- Fixed set window background colour on Windows when setting the colour via runtime. @stffabi 在 [PR](https://github.com/wailsapp/wails/pull/2279) 中修复
- Fixed the showing of a white border around a fullscreen window when `DisableWindowIcon` is active on Windows. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2299)
-- Fixed the sometimes lagging drag experience with `--wails-draggable` on Windows. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2302)
+- Fixed the sometimes lagging drag experience with `--wails-draggable` on Windows. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2302)
- Fixed applying the default arch to platform flag in wails cli. If only a `GOOS` has been supplied as platform flag e.g. `wails build --platform windows` the current architecture wasn't applied and the build failed. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2309)
- Fixed a segfault on opening the inspector on older macOS versions. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2397)
- Fixed the macos single architecture builds not respecting an output file name specified with the '-o' flag. Fixed by @gwynforthewyn in [PR](https://github.com/wailsapp/wails/pull/2358)
@@ -58,6 +77,7 @@
## v2.3.0 - 2022-12-29
### 新增
+
- 添加 `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) 中添加。
@@ -76,6 +96,7 @@
- Added Korean translation for the website. Added by @cybertramp in [PR](https://github.com/wailsapp/wails/pull/2093)
### 修复
+
- wails dev 中 `noreload` 标志未被应用。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2081) 中修复。
- `build/bin` 文件夹在 `wails dev` 模式下每次重新加载时都会复制自身。 由 @OlegGulevskyy 在这个 [PR](https://github.com/wailsapp/wails/pull/2103) 中修复。
- 防止 Windows 上的无边框窗口底部出现细白线。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2111) 中修复。
@@ -91,6 +112,7 @@
- Fixed React Hash Router link in docs. Fixed by @marvinhosea in [PR](https://github.com/wailsapp/wails/pull/2050)
### 变更
+
- 如果在资产中找不到 `index.html` 并且验证资产服务器选项,则改进错误消息。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2110) 中变更
- Promote the Go WebView2Loader from experimental to stable. This means now per default all Wails build use the new loader introduced with `v2.2.0`. The old loader remains usable with build tag `native_webview2loader` for the next few releases. Changed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2199)
- Refactored CLI. Changed by @leaanthony in this [PR](https://github.com/wailsapp/wails/pull/2123)
diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-pages/credits.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-pages/credits.mdx
index 078a77d2149..552e000e04b 100644
--- a/website/i18n/zh-Hans/docusaurus-plugin-content-pages/credits.mdx
+++ b/website/i18n/zh-Hans/docusaurus-plugin-content-pages/credits.mdx
@@ -12,9 +12,7 @@
## 贡献者
-
-
-
+
-
-
-
-
+
## 特别提及
diff --git a/website/i18n/zh-Hans/docusaurus-theme-classic/footer.json b/website/i18n/zh-Hans/docusaurus-theme-classic/footer.json
index 0cb98ac63c3..ad17fd9fba2 100644
--- a/website/i18n/zh-Hans/docusaurus-theme-classic/footer.json
+++ b/website/i18n/zh-Hans/docusaurus-theme-classic/footer.json
@@ -54,5 +54,9 @@
"link.item.label.Discord": {
"message": "Discord",
"description": "The label of footer link with label=Discord linking to https://discord.gg/JDdSxwjhGf"
+ },
+ "logo.alt": {
+ "message": "Wails Logo",
+ "description": "The alt text of footer logo"
}
}
diff --git a/website/i18n/zh-Hans/docusaurus-theme-classic/navbar.json b/website/i18n/zh-Hans/docusaurus-theme-classic/navbar.json
index 3fa427092d3..cef5e48296e 100644
--- a/website/i18n/zh-Hans/docusaurus-theme-classic/navbar.json
+++ b/website/i18n/zh-Hans/docusaurus-theme-classic/navbar.json
@@ -38,5 +38,9 @@
"item.label.Code of Conduct": {
"message": "行为准则",
"description": "Navbar item with label Code of Conduct"
+ },
+ "logo.alt": {
+ "message": "Wails Logo",
+ "description": "The alt text of navbar logo"
}
}
From 7c1490a8b118c566cf2ef2ef10fef4d174f4e83f Mon Sep 17 00:00:00 2001
From: stffabi
Date: Thu, 20 Apr 2023 12:06:37 +0200
Subject: [PATCH 5/7] [assetServer] Improve release/close handling of webview
requests (#2612)
---
.../frontend/desktop/darwin/frontend.go | 1 -
.../frontend/desktop/linux/frontend.go | 1 -
v2/pkg/assetserver/assetserver_legacy.go | 12 +-----
v2/pkg/assetserver/assetserver_webview.go | 12 +++---
v2/pkg/assetserver/webview/request.go | 3 +-
v2/pkg/assetserver/webview/request_darwin.go | 24 +++++------
.../assetserver/webview/request_finalizer.go | 40 +++++++++++++++++++
v2/pkg/assetserver/webview/request_linux.go | 27 ++++++-------
v2/pkg/assetserver/webview/responsewriter.go | 4 +-
.../webview/responsewriter_darwin.go | 5 +--
.../webview/responsewriter_linux.go | 5 +--
v3/pkg/application/application.go | 4 --
12 files changed, 78 insertions(+), 60 deletions(-)
create mode 100644 v2/pkg/assetserver/webview/request_finalizer.go
diff --git a/v2/internal/frontend/desktop/darwin/frontend.go b/v2/internal/frontend/desktop/darwin/frontend.go
index a5517ffcb68..5187be2c041 100644
--- a/v2/internal/frontend/desktop/darwin/frontend.go
+++ b/v2/internal/frontend/desktop/darwin/frontend.go
@@ -113,7 +113,6 @@ func (f *Frontend) startMessageProcessor() {
func (f *Frontend) startRequestProcessor() {
for request := range requestBuffer {
f.assets.ServeWebViewRequest(request)
- request.Release()
}
}
func (f *Frontend) startCallbackProcessor() {
diff --git a/v2/internal/frontend/desktop/linux/frontend.go b/v2/internal/frontend/desktop/linux/frontend.go
index f8c83eac180..e02c6a92866 100644
--- a/v2/internal/frontend/desktop/linux/frontend.go
+++ b/v2/internal/frontend/desktop/linux/frontend.go
@@ -466,7 +466,6 @@ var requestBuffer = make(chan webview.Request, 100)
func (f *Frontend) startRequestProcessor() {
for request := range requestBuffer {
f.assets.ServeWebViewRequest(request)
- request.Release()
}
}
diff --git a/v2/pkg/assetserver/assetserver_legacy.go b/v2/pkg/assetserver/assetserver_legacy.go
index 2d315aca36f..4df671bc2ee 100644
--- a/v2/pkg/assetserver/assetserver_legacy.go
+++ b/v2/pkg/assetserver/assetserver_legacy.go
@@ -56,13 +56,7 @@ func (r legacyRequest) Response() webview.ResponseWriter {
return &legacyRequestNoOpCloserResponseWriter{r.rw}
}
-func (r legacyRequest) AddRef() error {
- return nil
-}
-
-func (r legacyRequest) Release() error {
- return nil
-}
+func (r legacyRequest) Close() error { return nil }
func (r *legacyRequest) request() (*http.Request, error) {
if r.req != nil {
@@ -81,6 +75,4 @@ type legacyRequestNoOpCloserResponseWriter struct {
http.ResponseWriter
}
-func (*legacyRequestNoOpCloserResponseWriter) Finish() error {
- return nil
-}
+func (*legacyRequestNoOpCloserResponseWriter) Finish() {}
diff --git a/v2/pkg/assetserver/assetserver_webview.go b/v2/pkg/assetserver/assetserver_webview.go
index 3a7178c20ca..ae85f2513ab 100644
--- a/v2/pkg/assetserver/assetserver_webview.go
+++ b/v2/pkg/assetserver/assetserver_webview.go
@@ -22,6 +22,7 @@ type assetServerWebView struct {
// ServeWebViewRequest processes the HTTP Request asynchronously by faking a golang HTTP Server.
// The request will be finished with a StatusNotImplemented code if no handler has written to the response.
+// The AssetServer takes ownership of the request and the caller mustn't close it or access it in any other way.
func (d *AssetServer) ServeWebViewRequest(req webview.Request) {
d.dispatchInit.Do(func() {
workers := d.dispatchWorkers
@@ -33,8 +34,11 @@ func (d *AssetServer) ServeWebViewRequest(req webview.Request) {
for i := 0; i < workers; i++ {
go func() {
for req := range workerC {
+ uri, _ := req.URL()
d.processWebViewRequest(req)
- req.Release()
+ if err := req.Close(); err != nil {
+ d.logError("Unable to call close for request for uri '%s'", uri)
+ }
}
}()
}
@@ -45,12 +49,6 @@ func (d *AssetServer) ServeWebViewRequest(req webview.Request) {
d.dispatchReqC = dispatchC
})
- if err := req.AddRef(); err != nil {
- uri, _ := req.URL()
- d.logError("Unable to call AddRef for request '%s'", uri)
- return
- }
-
d.dispatchReqC <- req
}
diff --git a/v2/pkg/assetserver/webview/request.go b/v2/pkg/assetserver/webview/request.go
index b0ce3d06973..18ff298901e 100644
--- a/v2/pkg/assetserver/webview/request.go
+++ b/v2/pkg/assetserver/webview/request.go
@@ -13,6 +13,5 @@ type Request interface {
Response() ResponseWriter
- AddRef() error
- Release() error
+ Close() error
}
diff --git a/v2/pkg/assetserver/webview/request_darwin.go b/v2/pkg/assetserver/webview/request_darwin.go
index 4f4919fabf7..653c195069e 100644
--- a/v2/pkg/assetserver/webview/request_darwin.go
+++ b/v2/pkg/assetserver/webview/request_darwin.go
@@ -118,11 +118,9 @@ import (
)
// NewRequest creates as new WebViewRequest based on a pointer to an `id`
-//
-// Please make sure to call Release() when finished using the request.
func NewRequest(wkURLSchemeTask unsafe.Pointer) Request {
C.URLSchemeTaskRetain(wkURLSchemeTask)
- return &request{task: wkURLSchemeTask}
+ return newRequestFinalizer(&request{task: wkURLSchemeTask})
}
var _ Request = &request{}
@@ -135,16 +133,6 @@ type request struct {
rw *responseWriter
}
-func (r *request) AddRef() error {
- C.URLSchemeTaskRetain(r.task)
- return nil
-}
-
-func (r *request) Release() error {
- C.URLSchemeTaskRelease(r.task)
- return nil
-}
-
func (r *request) URL() (string, error) {
return C.GoString(C.URLSchemeTaskRequestURL(r.task)), nil
}
@@ -205,6 +193,16 @@ func (r *request) Response() ResponseWriter {
return r.rw
}
+func (r *request) Close() error {
+ var err error
+ if r.body != nil {
+ err = r.body.Close()
+ }
+ r.Response().Finish()
+ C.URLSchemeTaskRelease(r.task)
+ return err
+}
+
var _ io.ReadCloser = &requestBodyStreamReader{}
type requestBodyStreamReader struct {
diff --git a/v2/pkg/assetserver/webview/request_finalizer.go b/v2/pkg/assetserver/webview/request_finalizer.go
new file mode 100644
index 00000000000..6a8c6a92868
--- /dev/null
+++ b/v2/pkg/assetserver/webview/request_finalizer.go
@@ -0,0 +1,40 @@
+package webview
+
+import (
+ "runtime"
+ "sync/atomic"
+)
+
+var _ Request = &requestFinalizer{}
+
+type requestFinalizer struct {
+ Request
+ closed int32
+}
+
+// newRequestFinalizer returns a request with a runtime finalizer to make sure it will be closed from the finalizer
+// if it has not been already closed.
+// It also makes sure Close() of the wrapping request is only called once.
+func newRequestFinalizer(r Request) Request {
+ rf := &requestFinalizer{Request: r}
+ // Make sure to async release since it might block the finalizer goroutine for a longer period
+ runtime.SetFinalizer(rf, func(obj *requestFinalizer) { rf.close(true) })
+ return rf
+}
+
+func (r *requestFinalizer) Close() error {
+ return r.close(false)
+}
+
+func (r *requestFinalizer) close(asyncRelease bool) error {
+ if atomic.CompareAndSwapInt32(&r.closed, 0, 1) {
+ runtime.SetFinalizer(r, nil)
+ if asyncRelease {
+ go r.Request.Close()
+ return nil
+ } else {
+ return r.Request.Close()
+ }
+ }
+ return nil
+}
diff --git a/v2/pkg/assetserver/webview/request_linux.go b/v2/pkg/assetserver/webview/request_linux.go
index ff758a06501..101ee12fbc6 100644
--- a/v2/pkg/assetserver/webview/request_linux.go
+++ b/v2/pkg/assetserver/webview/request_linux.go
@@ -18,13 +18,12 @@ import (
)
// NewRequest creates as new WebViewRequest based on a pointer to an `WebKitURISchemeRequest`
-//
-// Please make sure to call Release() when finished using the request.
func NewRequest(webKitURISchemeRequest unsafe.Pointer) Request {
webkitReq := (*C.WebKitURISchemeRequest)(webKitURISchemeRequest)
+ C.g_object_ref(C.gpointer(webkitReq))
+
req := &request{req: webkitReq}
- req.AddRef()
- return req
+ return newRequestFinalizer(req)
}
var _ Request = &request{}
@@ -37,16 +36,6 @@ type request struct {
rw *responseWriter
}
-func (r *request) AddRef() error {
- C.g_object_ref(C.gpointer(r.req))
- return nil
-}
-
-func (r *request) Release() error {
- C.g_object_unref(C.gpointer(r.req))
- return nil
-}
-
func (r *request) URL() (string, error) {
return C.GoString(C.webkit_uri_scheme_request_get_uri(r.req)), nil
}
@@ -82,3 +71,13 @@ func (r *request) Response() ResponseWriter {
r.rw = &responseWriter{req: r.req}
return r.rw
}
+
+func (r *request) Close() error {
+ var err error
+ if r.body != nil {
+ err = r.body.Close()
+ }
+ r.Response().Finish()
+ C.g_object_unref(C.gpointer(r.req))
+ return err
+}
diff --git a/v2/pkg/assetserver/webview/responsewriter.go b/v2/pkg/assetserver/webview/responsewriter.go
index 9e3c1952f43..d67802a056c 100644
--- a/v2/pkg/assetserver/webview/responsewriter.go
+++ b/v2/pkg/assetserver/webview/responsewriter.go
@@ -20,6 +20,6 @@ var (
type ResponseWriter interface {
http.ResponseWriter
- // Finish the response and flush all data.
- Finish() error
+ // Finish the response and flush all data. A Finish after the request has already been finished has no effect.
+ Finish()
}
diff --git a/v2/pkg/assetserver/webview/responsewriter_darwin.go b/v2/pkg/assetserver/webview/responsewriter_darwin.go
index 77de3c4554f..1c0cbee7224 100644
--- a/v2/pkg/assetserver/webview/responsewriter_darwin.go
+++ b/v2/pkg/assetserver/webview/responsewriter_darwin.go
@@ -133,16 +133,15 @@ func (rw *responseWriter) WriteHeader(code int) {
C.URLSchemeTaskDidReceiveResponse(rw.r.task, C.int(code), headers, C.int(headersLen))
}
-func (rw *responseWriter) Finish() error {
+func (rw *responseWriter) Finish() {
if !rw.wroteHeader {
rw.WriteHeader(http.StatusNotImplemented)
}
if rw.finished {
- return nil
+ return
}
rw.finished = true
C.URLSchemeTaskDidFinish(rw.r.task)
- return nil
}
diff --git a/v2/pkg/assetserver/webview/responsewriter_linux.go b/v2/pkg/assetserver/webview/responsewriter_linux.go
index 52e28aa5da4..9b3f53a78c4 100644
--- a/v2/pkg/assetserver/webview/responsewriter_linux.go
+++ b/v2/pkg/assetserver/webview/responsewriter_linux.go
@@ -84,19 +84,18 @@ func (rw *responseWriter) WriteHeader(code int) {
}
}
-func (rw *responseWriter) Finish() error {
+func (rw *responseWriter) Finish() {
if !rw.wroteHeader {
rw.WriteHeader(http.StatusNotImplemented)
}
if rw.finished {
- return nil
+ return
}
rw.finished = true
if rw.w != nil {
rw.w.Close()
}
- return nil
}
func (rw *responseWriter) finishWithError(code int, err error) {
diff --git a/v3/pkg/application/application.go b/v3/pkg/application/application.go
index aa2e0296c29..b2667bf0077 100644
--- a/v3/pkg/application/application.go
+++ b/v3/pkg/application/application.go
@@ -324,10 +324,6 @@ func (a *App) Run() error {
for {
request := <-webviewRequests
a.handleWebViewRequest(request)
- err := request.Release()
- if err != nil {
- a.error("Failed to release webview request: %s", err.Error())
- }
}
}()
go func() {
From 529ec569f737aa358727b8a769badbab969248ca Mon Sep 17 00:00:00 2001
From: stffabi
Date: Thu, 20 Apr 2023 12:37:40 +0200
Subject: [PATCH 6/7] [v2, dev] Use custom schemes for in-app dev mode (#2610)
This fixes some long-standing inconsistencies between
dev mode builds and production builds but is a breaking
change. Dev mode uses custom scheme for Vite versions >= 3.0.0
and for older it still behaves in the old way.
---
v2/cmd/wails/internal/dev/dev.go | 44 +++++++++++++----
v2/cmd/wails/internal/dev/stdout_scanner.go | 39 ++++++++++++++-
.../customlayout/myfrontend/package.json | 2 +-
v2/internal/app/app_dev.go | 49 +++++++++++++++++--
v2/internal/frontend/devserver/devserver.go | 42 ++--------------
.../assetserver/assethandler_external.go} | 35 ++++++-------
.../templates/svelte-ts/frontend/package.json | 2 +-
.../templates/svelte/frontend/package.json | 2 +-
.../vanilla-ts/frontend/package.json | 2 +-
.../templates/vanilla/frontend/package.json | 2 +-
website/src/pages/changelog.mdx | 4 ++
11 files changed, 145 insertions(+), 78 deletions(-)
rename v2/{internal/frontend/devserver/external.go => pkg/assetserver/assethandler_external.go} (68%)
diff --git a/v2/cmd/wails/internal/dev/dev.go b/v2/cmd/wails/internal/dev/dev.go
index ca40f36a409..b7fc4d10d74 100644
--- a/v2/cmd/wails/internal/dev/dev.go
+++ b/v2/cmd/wails/internal/dev/dev.go
@@ -22,6 +22,7 @@ import (
"github.com/wailsapp/wails/v2/cmd/wails/flags"
"github.com/wailsapp/wails/v2/cmd/wails/internal/gomod"
"github.com/wailsapp/wails/v2/cmd/wails/internal/logutils"
+ "golang.org/x/mod/semver"
"github.com/wailsapp/wails/v2/pkg/commands/buildtags"
@@ -36,6 +37,10 @@ import (
"github.com/wailsapp/wails/v2/pkg/commands/build"
)
+const (
+ viteMinVersion = "v3.0.0"
+)
+
func sliceToMap(input []string) map[string]struct{} {
result := map[string]struct{}{}
for _, value := range input {
@@ -88,10 +93,11 @@ func Application(f *flags.Dev, logger *clilogger.CLILogger) error {
buildOptions.IgnoreApplication = false
}
+ legacyUseDevServerInsteadofCustomScheme := false
// frontend:dev:watcher command.
frontendDevAutoDiscovery := projectConfig.IsFrontendDevServerURLAutoDiscovery()
if command := projectConfig.DevWatcherCommand; command != "" {
- closer, devServerURL, err := runFrontendDevWatcherCommand(projectConfig.GetFrontendDir(), command, frontendDevAutoDiscovery)
+ closer, devServerURL, devServerViteVersion, err := runFrontendDevWatcherCommand(projectConfig.GetFrontendDir(), command, frontendDevAutoDiscovery)
if err != nil {
return err
}
@@ -100,6 +106,12 @@ func Application(f *flags.Dev, logger *clilogger.CLILogger) error {
f.FrontendDevServerURL = devServerURL
}
defer closer()
+
+ if devServerViteVersion != "" && semver.Compare(devServerViteVersion, viteMinVersion) < 0 {
+ logutils.LogRed("Please upgrade your Vite Server to at least '%s' future Wails versions will require at least Vite '%s'", viteMinVersion, viteMinVersion)
+ time.Sleep(3 * time.Second)
+ legacyUseDevServerInsteadofCustomScheme = true
+ }
} else if frontendDevAutoDiscovery {
return fmt.Errorf("unable to auto discover frontend:dev:serverUrl without a frontend:dev:watcher command, please either set frontend:dev:watcher or remove the auto discovery from frontend:dev:serverUrl")
}
@@ -107,7 +119,7 @@ func Application(f *flags.Dev, logger *clilogger.CLILogger) error {
// Do initial build but only for the application.
logger.Println("Building application for development...")
buildOptions.IgnoreFrontend = true
- debugBinaryProcess, appBinary, err := restartApp(buildOptions, nil, f, exitCodeChannel)
+ debugBinaryProcess, appBinary, err := restartApp(buildOptions, nil, f, exitCodeChannel, legacyUseDevServerInsteadofCustomScheme)
buildOptions.IgnoreFrontend = ignoreFrontend || f.FrontendDevServerURL != ""
if err != nil {
return err
@@ -153,7 +165,7 @@ func Application(f *flags.Dev, logger *clilogger.CLILogger) error {
}()
// Watch for changes and trigger restartApp()
- debugBinaryProcess = doWatcherLoop(buildOptions, debugBinaryProcess, f, watcher, exitCodeChannel, quitChannel, f.DevServerURL())
+ debugBinaryProcess = doWatcherLoop(buildOptions, debugBinaryProcess, f, watcher, exitCodeChannel, quitChannel, f.DevServerURL(), legacyUseDevServerInsteadofCustomScheme)
// Kill the current program if running and remove dev binary
if err := killProcessAndCleanupBinary(debugBinaryProcess, appBinary); err != nil {
@@ -202,7 +214,7 @@ func runCommand(dir string, exitOnError bool, command string, args ...string) er
}
// runFrontendDevWatcherCommand will run the `frontend:dev:watcher` command if it was given, ex- `npm run dev`
-func runFrontendDevWatcherCommand(frontendDirectory string, devCommand string, discoverViteServerURL bool) (func(), string, error) {
+func runFrontendDevWatcherCommand(frontendDirectory string, devCommand string, discoverViteServerURL bool) (func(), string, string, error) {
ctx, cancel := context.WithCancel(context.Background())
scanner := NewStdoutScanner()
cmdSlice := strings.Split(devCommand, " ")
@@ -214,7 +226,7 @@ func runFrontendDevWatcherCommand(frontendDirectory string, devCommand string, d
if err := cmd.Start(); err != nil {
cancel()
- return nil, "", fmt.Errorf("unable to start frontend DevWatcher: %w", err)
+ return nil, "", "", fmt.Errorf("unable to start frontend DevWatcher: %w", err)
}
var viteServerURL string
@@ -224,10 +236,19 @@ func runFrontendDevWatcherCommand(frontendDirectory string, devCommand string, d
viteServerURL = serverURL
case <-time.After(time.Second * 10):
cancel()
- return nil, "", errors.New("failed to find Vite server URL")
+ return nil, "", "", errors.New("failed to find Vite server URL")
}
}
+ viteVersion := ""
+ select {
+ case version := <-scanner.ViteServerVersionC:
+ viteVersion = version
+
+ case <-time.After(time.Second * 5):
+ // That's fine, then most probably it was not vite that was running
+ }
+
logutils.LogGreen("Running frontend DevWatcher command: '%s'", devCommand)
var wg sync.WaitGroup
wg.Add(1)
@@ -255,11 +276,11 @@ func runFrontendDevWatcherCommand(frontendDirectory string, devCommand string, d
}
cancel()
wg.Wait()
- }, viteServerURL, nil
+ }, viteServerURL, viteVersion, nil
}
// restartApp does the actual rebuilding of the application when files change
-func restartApp(buildOptions *build.Options, debugBinaryProcess *process.Process, f *flags.Dev, exitCodeChannel chan int) (*process.Process, string, error) {
+func restartApp(buildOptions *build.Options, debugBinaryProcess *process.Process, f *flags.Dev, exitCodeChannel chan int, legacyUseDevServerInsteadofCustomScheme bool) (*process.Process, string, error) {
appBinary, err := build.Build(buildOptions)
println()
@@ -297,6 +318,9 @@ func restartApp(buildOptions *build.Options, debugBinaryProcess *process.Process
os.Setenv("assetdir", f.AssetDir)
os.Setenv("devserver", f.DevServer)
os.Setenv("frontenddevserverurl", f.FrontendDevServerURL)
+ if legacyUseDevServerInsteadofCustomScheme {
+ os.Setenv("legacyusedevsererinsteadofcustomscheme", "true")
+ }
// Start up new binary with correct args
newProcess := process.NewProcess(appBinary, args...)
@@ -316,7 +340,7 @@ func restartApp(buildOptions *build.Options, debugBinaryProcess *process.Process
}
// doWatcherLoop is the main watch loop that runs while dev is active
-func doWatcherLoop(buildOptions *build.Options, debugBinaryProcess *process.Process, f *flags.Dev, watcher *fsnotify.Watcher, exitCodeChannel chan int, quitChannel chan os.Signal, devServerURL *url.URL) *process.Process {
+func doWatcherLoop(buildOptions *build.Options, debugBinaryProcess *process.Process, f *flags.Dev, watcher *fsnotify.Watcher, exitCodeChannel chan int, quitChannel chan os.Signal, devServerURL *url.URL, legacyUseDevServerInsteadofCustomScheme bool) *process.Process {
// Main Loop
var extensionsThatTriggerARebuild = sliceToMap(strings.Split(f.Extensions, ","))
var dirsThatTriggerAReload []string
@@ -422,7 +446,7 @@ func doWatcherLoop(buildOptions *build.Options, debugBinaryProcess *process.Proc
rebuild = false
logutils.LogGreen("[Rebuild triggered] files updated")
// Try and build the app
- newBinaryProcess, _, err := restartApp(buildOptions, debugBinaryProcess, f, exitCodeChannel)
+ newBinaryProcess, _, err := restartApp(buildOptions, debugBinaryProcess, f, exitCodeChannel, legacyUseDevServerInsteadofCustomScheme)
if err != nil {
logutils.LogRed("Error during build: %s", err.Error())
continue
diff --git a/v2/cmd/wails/internal/dev/stdout_scanner.go b/v2/cmd/wails/internal/dev/stdout_scanner.go
index d84e4785eea..dad4e72cf34 100644
--- a/v2/cmd/wails/internal/dev/stdout_scanner.go
+++ b/v2/cmd/wails/internal/dev/stdout_scanner.go
@@ -2,30 +2,47 @@ package dev
import (
"bufio"
+ "fmt"
"net/url"
"os"
"strings"
"github.com/acarl005/stripansi"
"github.com/wailsapp/wails/v2/cmd/wails/internal/logutils"
+ "golang.org/x/mod/semver"
)
// stdoutScanner acts as a stdout target that will scan the incoming
// data to find out the vite server url
type stdoutScanner struct {
- ViteServerURLChan chan string
+ ViteServerURLChan chan string
+ ViteServerVersionC chan string
+ versionDetected bool
}
// NewStdoutScanner creates a new stdoutScanner
func NewStdoutScanner() *stdoutScanner {
return &stdoutScanner{
- ViteServerURLChan: make(chan string, 2),
+ ViteServerURLChan: make(chan string, 2),
+ ViteServerVersionC: make(chan string, 2),
}
}
// Write bytes to the scanner. Will copy the bytes to stdout
func (s *stdoutScanner) Write(data []byte) (n int, err error) {
input := stripansi.Strip(string(data))
+ if !s.versionDetected {
+ v, err := detectViteVersion(input)
+ if v != "" || err != nil {
+ if err != nil {
+ logutils.LogRed("ViteStdoutScanner: %s", err)
+ v = "v0.0.0"
+ }
+ s.ViteServerVersionC <- v
+ s.versionDetected = true
+ }
+ }
+
match := strings.Index(input, "Local:")
if match != -1 {
sc := bufio.NewScanner(strings.NewReader(input))
@@ -47,3 +64,21 @@ func (s *stdoutScanner) Write(data []byte) (n int, err error) {
}
return os.Stdout.Write(data)
}
+
+func detectViteVersion(line string) (string, error) {
+ s := strings.Split(strings.TrimSpace(line), " ")
+ if strings.ToLower(s[0]) != "vite" {
+ return "", nil
+ }
+
+ if len(line) < 2 {
+ return "", fmt.Errorf("unable to parse vite version")
+ }
+
+ v := s[1]
+ if !semver.IsValid(v) {
+ return "", fmt.Errorf("%s is not a valid vite version string", v)
+ }
+
+ return v, nil
+}
diff --git a/v2/examples/customlayout/myfrontend/package.json b/v2/examples/customlayout/myfrontend/package.json
index 4ac88179860..a1b6f8e1afc 100644
--- a/v2/examples/customlayout/myfrontend/package.json
+++ b/v2/examples/customlayout/myfrontend/package.json
@@ -8,6 +8,6 @@
"preview": "vite preview"
},
"devDependencies": {
- "vite": "^2.9.9"
+ "vite": "^3.0.7"
}
}
\ No newline at end of file
diff --git a/v2/internal/app/app_dev.go b/v2/internal/app/app_dev.go
index 32c27fa2ef1..8373d399fc1 100644
--- a/v2/internal/app/app_dev.go
+++ b/v2/internal/app/app_dev.go
@@ -8,9 +8,11 @@ import (
"flag"
"fmt"
iofs "io/fs"
+ "net"
"net/url"
"os"
"path/filepath"
+ "time"
"github.com/wailsapp/wails/v2/pkg/assetserver"
@@ -104,17 +106,35 @@ func CreateApp(appoptions *options.App) (*App, error) {
}
if frontendDevServerURL != "" {
- if devServer == "" {
- return nil, fmt.Errorf("Unable to use FrontendDevServerUrl without a DevServer address")
+ if os.Getenv("legacyusedevsererinsteadofcustomscheme") != "" {
+ startURL, err := url.Parse("http://" + devServer)
+ if err != nil {
+ return nil, err
+ }
+
+ ctx = context.WithValue(ctx, "starturl", startURL)
}
- startURL, err := url.Parse("http://" + devServer)
+ ctx = context.WithValue(ctx, "frontenddevserverurl", frontendDevServerURL)
+
+ externalURL, err := url.Parse(frontendDevServerURL)
if err != nil {
return nil, err
}
- ctx = context.WithValue(ctx, "starturl", startURL)
- ctx = context.WithValue(ctx, "frontenddevserverurl", frontendDevServerURL)
+ if externalURL.Host == "" {
+ return nil, fmt.Errorf("Invalid frontend:dev:serverUrl missing protocol scheme?")
+ }
+
+ waitCb := func() { myLogger.Debug("Waiting for frontend DevServer '%s' to be ready", externalURL) }
+ if !checkPortIsOpen(externalURL.Host, time.Minute, waitCb) {
+ myLogger.Error("Timeout waiting for frontend DevServer")
+ }
+
+ handler := assetserver.NewExternalAssetsHandler(myLogger, assetConfig, externalURL)
+ assetConfig.Assets = nil
+ assetConfig.Handler = handler
+ assetConfig.Middleware = nil
myLogger.Info("Serving assets from frontend DevServer URL: %s", frontendDevServerURL)
} else {
@@ -246,3 +266,22 @@ func tryInferAssetDirFromFS(assets iofs.FS) (string, error) {
return path, nil
}
+
+func checkPortIsOpen(host string, timeout time.Duration, waitCB func()) (ret bool) {
+ if timeout == 0 {
+ timeout = time.Minute
+ }
+
+ deadline := time.Now().Add(timeout)
+ for time.Now().Before(deadline) {
+ conn, _ := net.DialTimeout("tcp", host, 2*time.Second)
+ if conn != nil {
+ conn.Close()
+ return true
+ }
+
+ waitCB()
+ time.Sleep(1 * time.Second)
+ }
+ return false
+}
diff --git a/v2/internal/frontend/devserver/devserver.go b/v2/internal/frontend/devserver/devserver.go
index 47dde29535a..35b67e86aa0 100644
--- a/v2/internal/frontend/devserver/devserver.go
+++ b/v2/internal/frontend/devserver/devserver.go
@@ -10,13 +10,11 @@ import (
"encoding/json"
"fmt"
"log"
- "net"
"net/http"
"net/http/httputil"
"net/url"
"strings"
"sync"
- "time"
"github.com/wailsapp/wails/v2/pkg/assetserver"
@@ -67,7 +65,6 @@ func (d *DevWebServer) Run(ctx context.Context) error {
myLogger = _logger.(*logger.Logger)
}
- var assetHandler http.Handler
var wsHandler http.Handler
_fronendDevServerURL, _ := ctx.Value("frontenddevserverurl").(string)
@@ -77,33 +74,23 @@ func (d *DevWebServer) Run(ctx context.Context) error {
return c.String(http.StatusOK, assetdir)
})
- var err error
- assetHandler, err = assetserver.NewAssetHandler(assetServerConfig, myLogger)
- if err != nil {
- log.Fatal(err)
- }
} else {
externalURL, err := url.Parse(_fronendDevServerURL)
if err != nil {
return err
}
- if externalURL.Host == "" {
- return fmt.Errorf("Invalid frontend:dev:serverUrl missing protocol scheme?")
- }
-
- waitCb := func() { d.LogDebug("Waiting for frontend DevServer '%s' to be ready", externalURL) }
- if !checkPortIsOpen(externalURL.Host, time.Minute, waitCb) {
- d.logger.Error("Timeout waiting for frontend DevServer")
- }
-
- assetHandler = newExternalDevServerAssetHandler(d.logger, externalURL, assetServerConfig)
// WebSockets aren't currently supported in prod mode, so a WebSocket connection is the result of the
// FrontendDevServer e.g. Vite to support auto reloads.
// Therefore we direct WebSockets directly to the FrontendDevServer instead of returning a NotImplementedStatus.
wsHandler = httputil.NewSingleHostReverseProxy(externalURL)
}
+ assetHandler, err := assetserver.NewAssetHandler(assetServerConfig, myLogger)
+ if err != nil {
+ log.Fatal(err)
+ }
+
// Setup internal dev server
bindingsJSON, err := d.appBindings.ToJSON()
if err != nil {
@@ -307,22 +294,3 @@ func NewFrontend(ctx context.Context, appoptions *options.App, myLogger *logger.
result.server.HidePort = true
return result
}
-
-func checkPortIsOpen(host string, timeout time.Duration, waitCB func()) (ret bool) {
- if timeout == 0 {
- timeout = time.Minute
- }
-
- deadline := time.Now().Add(timeout)
- for time.Now().Before(deadline) {
- conn, _ := net.DialTimeout("tcp", host, 2*time.Second)
- if conn != nil {
- conn.Close()
- return true
- }
-
- waitCB()
- time.Sleep(1 * time.Second)
- }
- return false
-}
diff --git a/v2/internal/frontend/devserver/external.go b/v2/pkg/assetserver/assethandler_external.go
similarity index 68%
rename from v2/internal/frontend/devserver/external.go
rename to v2/pkg/assetserver/assethandler_external.go
index fd717e72364..588b350f531 100644
--- a/v2/internal/frontend/devserver/external.go
+++ b/v2/pkg/assetserver/assethandler_external.go
@@ -1,7 +1,7 @@
//go:build dev
// +build dev
-package devserver
+package assetserver
import (
"errors"
@@ -10,21 +10,12 @@ import (
"net/http/httputil"
"net/url"
- "github.com/wailsapp/wails/v2/internal/logger"
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
)
-func newExternalDevServerAssetHandler(logger *logger.Logger, url *url.URL, options assetserver.Options) http.Handler {
- handler := newExternalAssetsHandler(logger, url, options.Handler)
+func NewExternalAssetsHandler(logger Logger, options assetserver.Options, url *url.URL) http.Handler {
+ baseHandler := options.Handler
- if middleware := options.Middleware; middleware != nil {
- handler = middleware(handler)
- }
-
- return handler
-}
-
-func newExternalAssetsHandler(logger *logger.Logger, url *url.URL, handler http.Handler) http.Handler {
errSkipProxy := fmt.Errorf("skip proxying")
proxy := httputil.NewSingleHostReverseProxy(url)
@@ -37,7 +28,7 @@ func newExternalAssetsHandler(logger *logger.Logger, url *url.URL, handler http.
}
proxy.ModifyResponse = func(res *http.Response) error {
- if handler == nil {
+ if baseHandler == nil {
return nil
}
@@ -53,11 +44,11 @@ func newExternalAssetsHandler(logger *logger.Logger, url *url.URL, handler http.
}
proxy.ErrorHandler = func(rw http.ResponseWriter, r *http.Request, err error) {
- if handler != nil && errors.Is(err, errSkipProxy) {
+ if baseHandler != nil && errors.Is(err, errSkipProxy) {
if logger != nil {
- logger.Debug("[ExternalAssetHandler] Loading '%s' failed, using AssetHandler", r.URL)
+ logger.Debug("[ExternalAssetHandler] Loading '%s' failed, using original AssetHandler", r.URL)
}
- handler.ServeHTTP(rw, r)
+ baseHandler.ServeHTTP(rw, r)
} else {
if logger != nil {
logger.Error("[ExternalAssetHandler] Proxy error: %v", err)
@@ -66,18 +57,24 @@ func newExternalAssetsHandler(logger *logger.Logger, url *url.URL, handler http.
}
}
- return http.HandlerFunc(
+ var result http.Handler = http.HandlerFunc(
func(rw http.ResponseWriter, req *http.Request) {
if req.Method == http.MethodGet {
proxy.ServeHTTP(rw, req)
return
}
- if handler != nil {
- handler.ServeHTTP(rw, req)
+ if baseHandler != nil {
+ baseHandler.ServeHTTP(rw, req)
return
}
rw.WriteHeader(http.StatusMethodNotAllowed)
})
+
+ if middleware := options.Middleware; middleware != nil {
+ result = middleware(result)
+ }
+
+ return result
}
diff --git a/v2/pkg/templates/templates/svelte-ts/frontend/package.json b/v2/pkg/templates/templates/svelte-ts/frontend/package.json
index 8bbb15b1b75..2ee69eaf579 100644
--- a/v2/pkg/templates/templates/svelte-ts/frontend/package.json
+++ b/v2/pkg/templates/templates/svelte-ts/frontend/package.json
@@ -17,6 +17,6 @@
"svelte-preprocess": "^4.10.7",
"tslib": "^2.4.0",
"typescript": "^4.6.4",
- "vite": "^3.0.0"
+ "vite": "^3.0.7"
}
}
\ No newline at end of file
diff --git a/v2/pkg/templates/templates/svelte/frontend/package.json b/v2/pkg/templates/templates/svelte/frontend/package.json
index 8a935415018..8c9ae62a804 100644
--- a/v2/pkg/templates/templates/svelte/frontend/package.json
+++ b/v2/pkg/templates/templates/svelte/frontend/package.json
@@ -11,6 +11,6 @@
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^1.0.1",
"svelte": "^3.49.0",
- "vite": "^3.0.0"
+ "vite": "^3.0.7"
}
}
\ No newline at end of file
diff --git a/v2/pkg/templates/templates/vanilla-ts/frontend/package.json b/v2/pkg/templates/templates/vanilla-ts/frontend/package.json
index 37305b4c0fc..c57eb8610ce 100644
--- a/v2/pkg/templates/templates/vanilla-ts/frontend/package.json
+++ b/v2/pkg/templates/templates/vanilla-ts/frontend/package.json
@@ -9,6 +9,6 @@
},
"devDependencies": {
"typescript": "^4.5.4",
- "vite": "^2.9.9"
+ "vite": "^3.0.7"
}
}
\ No newline at end of file
diff --git a/v2/pkg/templates/templates/vanilla/frontend/package.json b/v2/pkg/templates/templates/vanilla/frontend/package.json
index 4ac88179860..a1b6f8e1afc 100644
--- a/v2/pkg/templates/templates/vanilla/frontend/package.json
+++ b/v2/pkg/templates/templates/vanilla/frontend/package.json
@@ -8,6 +8,6 @@
"preview": "vite preview"
},
"devDependencies": {
- "vite": "^2.9.9"
+ "vite": "^3.0.7"
}
}
\ No newline at end of file
diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx
index 0a0ab8359f7..7b596377bfa 100644
--- a/website/src/pages/changelog.mdx
+++ b/website/src/pages/changelog.mdx
@@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+### Breaking Changes
+
+- `wails dev` now uses the custom schemes `wails://` on macOS and Linux if Vite >= `v3.0.0` is used. This makes the dev application consistent in behaviour with the final production application and fixes some long-standing inconsistencies. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2610)
+
### Added
- Added Nodejs version in `wails doctor`. Added by @misitebao in [PR](https://github.com/wailsapp/wails/pull/2546)
From 0bf41090b0c4c905c96391cbb787ace1be2357d6 Mon Sep 17 00:00:00 2001
From: stffabi
Date: Thu, 20 Apr 2023 12:38:32 +0200
Subject: [PATCH 7/7] [v2, darwin] Add some missing default shortcuts (#2586)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* [v2, darwin] Add "Hide, Hide Others, Show All“ to appmenu
This also includes shortcuts support for those commands.
Arrange the menu items in the well known MacOS order.
* [v2, darwin] Add Window menu with well known shortcuts Minimize, Full-Screen and Zoom.
---
v2/internal/frontend/desktop/darwin/Role.h | 1 +
.../frontend/desktop/darwin/WailsMenu.m | 25 ++++++++++++++++---
v2/pkg/menu/menuroles.go | 9 ++++---
v2/pkg/options/options.go | 10 +++++---
website/src/pages/changelog.mdx | 2 ++
5 files changed, 38 insertions(+), 9 deletions(-)
diff --git a/v2/internal/frontend/desktop/darwin/Role.h b/v2/internal/frontend/desktop/darwin/Role.h
index 20e670689e5..6b8877a097e 100644
--- a/v2/internal/frontend/desktop/darwin/Role.h
+++ b/v2/internal/frontend/desktop/darwin/Role.h
@@ -12,5 +12,6 @@ typedef int Role;
static const Role AppMenu = 1;
static const Role EditMenu = 2;
+static const Role WindowMenu = 3;
#endif /* Role_h */
diff --git a/v2/internal/frontend/desktop/darwin/WailsMenu.m b/v2/internal/frontend/desktop/darwin/WailsMenu.m
index af03ca6b96b..66e5dd39948 100644
--- a/v2/internal/frontend/desktop/darwin/WailsMenu.m
+++ b/v2/internal/frontend/desktop/darwin/WailsMenu.m
@@ -68,12 +68,20 @@ - (void) appendRole :(WailsContext*)ctx :(Role)role {
appName = [[NSProcessInfo processInfo] processName];
}
WailsMenu *appMenu = [[[WailsMenu new] initWithNSTitle:appName] autorelease];
- id quitTitle = [@"Quit " stringByAppendingString:appName];
- NSMenuItem* quitMenuItem = [self newMenuItem:quitTitle :@selector(Quit) :@"q" :NSEventModifierFlagCommand];
- quitMenuItem.target = ctx;
+
if (ctx.aboutTitle != nil) {
[appMenu addItem:[self newMenuItemWithContext :ctx :[@"About " stringByAppendingString:appName] :@selector(About) :nil :0]];
+ [appMenu addItem:[NSMenuItem separatorItem]];
}
+
+ [appMenu addItem:[self newMenuItem:[@"Hide " stringByAppendingString:appName] :@selector(hide:) :@"h" :NSEventModifierFlagCommand]];
+ [appMenu addItem:[self newMenuItem:@"Hide Others" :@selector(hideOtherApplications:) :@"h" :(NSEventModifierFlagOption | NSEventModifierFlagCommand)]];
+ [appMenu addItem:[self newMenuItem:@"Show All" :@selector(unhideAllApplications:) :@""]];
+ [appMenu addItem:[NSMenuItem separatorItem]];
+
+ id quitTitle = [@"Quit " stringByAppendingString:appName];
+ NSMenuItem* quitMenuItem = [self newMenuItem:quitTitle :@selector(Quit) :@"q" :NSEventModifierFlagCommand];
+ quitMenuItem.target = ctx;
[appMenu addItem:quitMenuItem];
[self appendSubmenu:appMenu];
break;
@@ -100,6 +108,17 @@ - (void) appendRole :(WailsContext*)ctx :(Role)role {
[editMenu appendSubmenu:speechMenu];
[self appendSubmenu:editMenu];
+ break;
+ }
+ case WindowMenu:
+ {
+ WailsMenu *windowMenu = [[[WailsMenu new] initWithNSTitle:@"Window"] autorelease];
+ [windowMenu addItem:[self newMenuItem:@"Minimize" :@selector(performMiniaturize:) :@"m" :NSEventModifierFlagCommand]];
+ [windowMenu addItem:[self newMenuItem:@"Zoom" :@selector(performZoom:) :@""]];
+ [windowMenu addItem:[NSMenuItem separatorItem]];
+ [windowMenu addItem:[self newMenuItem:@"Full Screen" :@selector(enterFullScreenMode:) :@"f" :(NSEventModifierFlagControl | NSEventModifierFlagCommand)]];
+ [self appendSubmenu:windowMenu];
+
break;
}
}
diff --git a/v2/pkg/menu/menuroles.go b/v2/pkg/menu/menuroles.go
index 62a193c8e7e..e6b15b2433b 100644
--- a/v2/pkg/menu/menuroles.go
+++ b/v2/pkg/menu/menuroles.go
@@ -8,8 +8,9 @@ type Role int
// These constants need to be kept in sync with `v2/internal/frontend/desktop/darwin/Role.h`
const (
- AppMenuRole Role = 1
- EditMenuRole = 2
+ AppMenuRole Role = 1
+ EditMenuRole = 2
+ WindowMenuRole = 3
//AboutRole Role = "about"
//UndoRole Role = "undo"
//RedoRole Role = "redo"
@@ -142,14 +143,16 @@ func ViewMenu() *MenuItem {
Role: ViewMenuRole,
}
}
+*/
// WindowMenu provides a MenuItem with the whole default "Window" menu (Minimize, Zoom, etc.).
+// On MacOS currently all options in there won't work if the window is frameless.
func WindowMenu() *MenuItem {
return &MenuItem{
Role: WindowMenuRole,
}
}
-*/
+
// These roles are Mac only
// AppMenu provides a MenuItem with the whole default "App" menu (About, Services, etc.)
diff --git a/v2/pkg/options/options.go b/v2/pkg/options/options.go
index 204a267c613..74b2aef72ae 100644
--- a/v2/pkg/options/options.go
+++ b/v2/pkg/options/options.go
@@ -160,10 +160,14 @@ func processMenus(appoptions *App) {
switch runtime.GOOS {
case "darwin":
if appoptions.Menu == nil {
- appoptions.Menu = menu.NewMenuFromItems(
- menu.AppMenu(),
+ items := []*menu.MenuItem{
menu.EditMenu(),
- )
+ }
+ if !appoptions.Frameless {
+ items = append(items, menu.WindowMenu()) // Current options in Window Menu only work if not frameless
+ }
+
+ appoptions.Menu = menu.NewMenuFromItems(menu.AppMenu(), items...)
}
}
}
diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx
index 7b596377bfa..eb69875ff9d 100644
--- a/website/src/pages/changelog.mdx
+++ b/website/src/pages/changelog.mdx
@@ -22,6 +22,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added Nodejs version in `wails doctor`. Added by @misitebao in [PR](https://github.com/wailsapp/wails/pull/2546)
- Added support for WebKit2GTK 2.40+ on Linux. This brings additional features for the [AssetServer](/docs/reference/options#assetserver), like support for HTTP Request Bodies. The app must be compiled with the Go build tag `webkit2_40` to activate support for this features. This also bumps the minimum requirement of WebKit2GTK to 2.40 for your app. Added by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2592)
+- macOS: Added Window menu role with well known shortcuts "Minimize, Full-Screen and Zoom". Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2586)
+- macOS: Added "Hide, Hide Others, Show All“ to appmenu. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2586)
### Changed