From 9578b627fdd7f83f2cb8314743eefd37ded3c76c Mon Sep 17 00:00:00 2001 From: Anton Gilgur <4970083+agilgur5@users.noreply.github.com> Date: Tue, 25 Nov 2025 05:16:01 -0500 Subject: [PATCH 01/25] [v2] docs(how): fix inconsistent indentation (#4733) * [v2] docs(how): fix inconsistent indentation - several places had mixed indentation (tabs _and_ spaces) - some lines had incorrect indentation, partially due to the above * add changelog entry per PR template --- website/docs/howdoesitwork.mdx | 22 ++++++++++------------ website/src/pages/changelog.mdx | 4 ++++ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/website/docs/howdoesitwork.mdx b/website/docs/howdoesitwork.mdx index 48243f4eb..bdfbcb278 100644 --- a/website/docs/howdoesitwork.mdx +++ b/website/docs/howdoesitwork.mdx @@ -63,17 +63,17 @@ func main() { type App struct { - ctx context.Context + ctx context.Context } func (b *App) startup(ctx context.Context) { - b.ctx = ctx + b.ctx = ctx } func (b *App) shutdown(ctx context.Context) {} func (b *App) Greet(name string) string { - return fmt.Sprintf("Hello %s!", name) + return fmt.Sprintf("Hello %s!", name) } ``` @@ -178,18 +178,18 @@ func main() { type App struct { - ctx context.Context + ctx context.Context } func (a *App) Greet(name string) string { - return fmt.Sprintf("Hello %s!", name) + return fmt.Sprintf("Hello %s!", name) } ``` You may bind as many structs as you like. Just make sure you create an instance of it and pass it in `Bind`: ```go {10-12} - //... + //... err := wails.Run(&options.App{ Title: "Basic Demo", Width: 1024, @@ -203,7 +203,6 @@ You may bind as many structs as you like. Just make sure you create an instance &mystruct2{}, }, }) - ``` You may bind enums types as well. @@ -237,7 +236,7 @@ var AllWeekdays = []struct { ``` ```go {10-12} - //... + //... err := wails.Run(&options.App{ Title: "Basic Demo", Width: 1024, @@ -250,11 +249,10 @@ var AllWeekdays = []struct { &mystruct1{}, &mystruct2{}, }, - EnumBind: []interface{}{ - AllWeekdays, - }, + EnumBind: []interface{}{ + AllWeekdays, + }, }) - ``` When you run `wails dev` (or `wails generate module`), a frontend module will be generated containing the following: diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx index 25fab6e4c..8182af3fb 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] +### Fixed + +- Fixed indentation in "How does it work?" page by @agilgur5 in [#4733](https://github.com/wailsapp/wails/pull/4733) + ## v2.11.0 - 2025-11-08 ### Added From 467f70ada77b662276db89a89328a27620fb2e2f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 28 Nov 2025 23:24:03 +1100 Subject: [PATCH 02/25] chore: update sponsors.svg (#4735) Co-authored-by: leaanthony <1943904+leaanthony@users.noreply.github.com> --- website/static/img/sponsors.svg | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/website/static/img/sponsors.svg b/website/static/img/sponsors.svg index eb8c70dfd..84eb6b87a 100644 --- a/website/static/img/sponsors.svg +++ b/website/static/img/sponsors.svg @@ -240,10 +240,10 @@ text { - + - + @@ -254,10 +254,10 @@ text { - + - + @@ -358,10 +358,10 @@ text { - + - + From 4f71b22665dcfe5149a700106b6780714594cbe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E6=BE=AAAkimio?= Date: Sat, 29 Nov 2025 10:49:43 +0800 Subject: [PATCH 03/25] docs: fix typo of the window hiding method to "WindowHide" in the zh-Hans documentation (#4655) --- .../current/reference/runtime/window.mdx | 2 +- .../version-v2.10/reference/runtime/window.mdx | 2 +- .../version-v2.5.0/reference/runtime/window.mdx | 2 +- .../version-v2.6.0/reference/runtime/window.mdx | 2 +- .../version-v2.7.0/reference/runtime/window.mdx | 2 +- .../version-v2.8.0/reference/runtime/window.mdx | 2 +- .../version-v2.8.1/reference/runtime/window.mdx | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx index f1fc78c99..3645087e7 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx @@ -86,7 +86,7 @@ Go: `WindowSetDarkTheme(ctx context.Context)`
JS: `WindowSetDarkTheme()` Go: `WindowShow(ctx context.Context)`
JS: `WindowShow()` -### WindowShow 隐藏窗口 +### WindowHide 隐藏窗口 如果当前可见,则隐藏窗口。 diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.10/reference/runtime/window.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.10/reference/runtime/window.mdx index a9799f06a..0a0f434ae 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.10/reference/runtime/window.mdx +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.10/reference/runtime/window.mdx @@ -86,7 +86,7 @@ Go: `WindowSetDarkTheme(ctx context.Context)`
JS: `WindowSetDarkTheme()` Go: `WindowShow(ctx context.Context)`
JS: `WindowShow()` -### WindowShow 隐藏窗口 +### WindowHide 隐藏窗口 如果当前可见,则隐藏窗口。 diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.5.0/reference/runtime/window.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.5.0/reference/runtime/window.mdx index 9cad686ed..be711f34b 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.5.0/reference/runtime/window.mdx +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.5.0/reference/runtime/window.mdx @@ -86,7 +86,7 @@ Go: `WindowSetDarkTheme(ctx context.Context)`
JS: `WindowSetDarkTheme()` Go: `WindowShow(ctx context.Context)`
JS: `WindowShow()` -### WindowShow 隐藏窗口 +### WindowHide 隐藏窗口 如果当前可见,则隐藏窗口。 diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.6.0/reference/runtime/window.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.6.0/reference/runtime/window.mdx index 9cad686ed..be711f34b 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.6.0/reference/runtime/window.mdx +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.6.0/reference/runtime/window.mdx @@ -86,7 +86,7 @@ Go: `WindowSetDarkTheme(ctx context.Context)`
JS: `WindowSetDarkTheme()` Go: `WindowShow(ctx context.Context)`
JS: `WindowShow()` -### WindowShow 隐藏窗口 +### WindowHide 隐藏窗口 如果当前可见,则隐藏窗口。 diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.7.0/reference/runtime/window.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.7.0/reference/runtime/window.mdx index a4b9c1263..3b405c76b 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.7.0/reference/runtime/window.mdx +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.7.0/reference/runtime/window.mdx @@ -86,7 +86,7 @@ Go: `WindowSetDarkTheme(ctx context.Context)`
JS: `WindowSetDarkTheme()` Go: `WindowShow(ctx context.Context)`
JS: `WindowShow()` -### WindowShow 隐藏窗口 +### WindowHide 隐藏窗口 如果当前可见,则隐藏窗口。 diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.8.0/reference/runtime/window.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.8.0/reference/runtime/window.mdx index a4b9c1263..3b405c76b 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.8.0/reference/runtime/window.mdx +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.8.0/reference/runtime/window.mdx @@ -86,7 +86,7 @@ Go: `WindowSetDarkTheme(ctx context.Context)`
JS: `WindowSetDarkTheme()` Go: `WindowShow(ctx context.Context)`
JS: `WindowShow()` -### WindowShow 隐藏窗口 +### WindowHide 隐藏窗口 如果当前可见,则隐藏窗口。 diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.8.1/reference/runtime/window.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.8.1/reference/runtime/window.mdx index a4b9c1263..3b405c76b 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.8.1/reference/runtime/window.mdx +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.8.1/reference/runtime/window.mdx @@ -86,7 +86,7 @@ Go: `WindowSetDarkTheme(ctx context.Context)`
JS: `WindowSetDarkTheme()` Go: `WindowShow(ctx context.Context)`
JS: `WindowShow()` -### WindowShow 隐藏窗口 +### WindowHide 隐藏窗口 如果当前可见,则隐藏窗口。 From 27afad59f63db94d441fd4564239c43ea066eb55 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 30 Nov 2025 12:39:10 +1100 Subject: [PATCH 04/25] chore: update sponsors.svg (#4740) Co-authored-by: leaanthony <1943904+leaanthony@users.noreply.github.com> --- website/static/img/sponsors.svg | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/website/static/img/sponsors.svg b/website/static/img/sponsors.svg index 84eb6b87a..2231cd15d 100644 --- a/website/static/img/sponsors.svg +++ b/website/static/img/sponsors.svg @@ -234,44 +234,37 @@ text {
- + - + - + - - - - - - - - + - + - + - + - + - + - + Helpers From d16fd500df52af663ae2169b9f34bc0560f0817c Mon Sep 17 00:00:00 2001 From: Anton Gilgur <4970083+agilgur5@users.noreply.github.com> Date: Sun, 30 Nov 2025 01:19:38 -0500 Subject: [PATCH 05/25] docs(community): use absolute link to CoC instead of relative (#4732) * docs(community): use absolute link to CoC instead of relative - the relative link made it so that if you happen to land on https://wails.io/community-guide/ (with a trailing slash), it would take you to https://wails.io/community-guide/coc, which 404s - if you were at https://wails.io/community-guide (no trailing slash), it was fine. - use an absolute link so that it works the same regardless of the trailing slash or not * add changelog entry per PR template --------- Co-authored-by: Lea Anthony --- website/src/pages/changelog.mdx | 1 + website/src/pages/community-guide.mdx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx index 8182af3fb..76d85f653 100644 --- a/website/src/pages/changelog.mdx +++ b/website/src/pages/changelog.mdx @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed link to CoC in Community Guide when there was a trailing slash by @agilgur5 in [#4732](https://github.com/wailsapp/wails/pull/4732) - Fixed indentation in "How does it work?" page by @agilgur5 in [#4733](https://github.com/wailsapp/wails/pull/4733) ## v2.11.0 - 2025-11-08 diff --git a/website/src/pages/community-guide.mdx b/website/src/pages/community-guide.mdx index 585015942..a0be54ad9 100644 --- a/website/src/pages/community-guide.mdx +++ b/website/src/pages/community-guide.mdx @@ -6,7 +6,7 @@ The number of Wails users is growing at an incredible rate, and if you're readin ### Code of Conduct -This [Code of Conduct](./coc) is an easy guide to develop the technical communities in which we participate. +This [Code of Conduct](/coc) is an easy guide to develop the technical communities in which we participate. ### Stay in the Know From ef7d3301c9f4874d77aae9ca3a0f45a3b57d15ed Mon Sep 17 00:00:00 2001 From: Anton Gilgur <4970083+agilgur5@users.noreply.github.com> Date: Sun, 30 Nov 2025 01:21:27 -0500 Subject: [PATCH 06/25] [v2] docs(app-dev): add imports to `app.go` examples (#4731) * [v2] docs(app-dev): add imports to `app.go` examples - add `context` and `fmt` imports to the `app.go` examples - link to the docs for `context` when it is referenced for explicitness/beginner-friendliness * add changelog entry per PR template --------- Co-authored-by: Lea Anthony --- website/docs/guides/application-development.mdx | 13 +++++++++++-- website/src/pages/changelog.mdx | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/website/docs/guides/application-development.mdx b/website/docs/guides/application-development.mdx index ae3880fd9..c286bd8ed 100644 --- a/website/docs/guides/application-development.mdx +++ b/website/docs/guides/application-development.mdx @@ -10,6 +10,10 @@ The pattern used by the default templates are that `main.go` is used for configu The `app.go` file will define a struct that has 2 methods which act as hooks into the main application: ```go title="app.go" +import ( + "context" +) + type App struct { ctx context.Context } @@ -28,7 +32,7 @@ func (a *App) shutdown(ctx context.Context) { - The startup method is called as soon as Wails allocates the resources it needs and is a good place for creating resources, setting up event listeners and anything else the application needs at startup. - It is given a `context.Context` which is usually saved in a struct field. This context is needed for calling the + It is given a [`context.Context`](https://pkg.go.dev/context) which is usually saved in a struct field. This context is needed for calling the [runtime](../reference/runtime/intro.mdx). If this method returns an error, the application will terminate. In dev mode, the error will be output to the console. @@ -65,7 +69,12 @@ More information on application lifecycle hooks can be found [here](../howdoesit It is likely that you will want to call Go methods from the frontend. This is normally done by adding public methods to the already defined struct in `app.go`: -```go {16-18} title="app.go" +```go {3,21-23} title="app.go" +import ( + "context" + "fmt" +) + type App struct { ctx context.Context } diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx index 76d85f653..58bb80fef 100644 --- a/website/src/pages/changelog.mdx +++ b/website/src/pages/changelog.mdx @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Updated Application Development guide to show imports in the `app.go` snippets by @agilgur5 in [#4731](https://github.com/wailsapp/wails/pull/4731) - Fixed link to CoC in Community Guide when there was a trailing slash by @agilgur5 in [#4732](https://github.com/wailsapp/wails/pull/4732) - Fixed indentation in "How does it work?" page by @agilgur5 in [#4733](https://github.com/wailsapp/wails/pull/4733) From e37a7b9d4b2fa4953757be4f9bd70ec74a6d6a1d Mon Sep 17 00:00:00 2001 From: Anton Gilgur <4970083+agilgur5@users.noreply.github.com> Date: Sun, 30 Nov 2025 01:40:51 -0500 Subject: [PATCH 07/25] [v2] docs(app-dev): fix inconsistent indentation (#4730) * [v2] docs(app-dev): fix inconsistent indentation - several places had mixed indentation (tabs _and_ spaces) - some lines had incorrect indentation, partially due to the above * add changelog entry per PR template --------- Co-authored-by: Lea Anthony --- .../docs/guides/application-development.mdx | 36 +++++++++---------- website/src/pages/changelog.mdx | 1 + 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/website/docs/guides/application-development.mdx b/website/docs/guides/application-development.mdx index c286bd8ed..adefa4b04 100644 --- a/website/docs/guides/application-development.mdx +++ b/website/docs/guides/application-development.mdx @@ -59,7 +59,6 @@ func main() { log.Fatal(err) } } - ``` More information on application lifecycle hooks can be found [here](../howdoesitwork.mdx#application-lifecycle-callbacks). @@ -91,7 +90,7 @@ func (a *App) shutdown(ctx context.Context) { } func (a *App) Greet(name string) string { - return fmt.Sprintf("Hello %s!", name) + return fmt.Sprintf("Hello %s!", name) } ``` @@ -108,15 +107,14 @@ func main() { Height: 600, OnStartup: app.startup, OnShutdown: app.shutdown, - Bind: []interface{}{ - app, - }, + Bind: []interface{}{ + app, + }, }) if err != nil { log.Fatal(err) } } - ``` This will bind all public methods in our `App` struct (it will never bind the startup and shutdown methods). @@ -142,10 +140,10 @@ func main() { otherStruct.SetContext(ctx) }, OnShutdown: app.shutdown, - Bind: []interface{}{ - app, + Bind: []interface{}{ + app, otherStruct - }, + }, }) if err != nil { log.Fatal(err) @@ -196,18 +194,17 @@ func main() { Height: 600, OnStartup: app.startup, OnShutdown: app.shutdown, - Bind: []interface{}{ - app, - }, - EnumBind: []interface{}{ - AllWeekdays, - }, + Bind: []interface{}{ + app, + }, + EnumBind: []interface{}{ + AllWeekdays, + }, }) if err != nil { log.Fatal(err) } } - ``` This will add missing enums to your `model.ts` file. @@ -232,15 +229,14 @@ func main() { OnStartup: app.startup, OnShutdown: app.shutdown, Menu: app.menu(), - Bind: []interface{}{ - app, - }, + Bind: []interface{}{ + app, + }, }) if err != nil { log.Fatal(err) } } - ``` ## Assets diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx index 58bb80fef..b802414ac 100644 --- a/website/src/pages/changelog.mdx +++ b/website/src/pages/changelog.mdx @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed indentation in Application Development guide by @agilgur5 in [#4730](https://github.com/wailsapp/wails/pull/4730) - Updated Application Development guide to show imports in the `app.go` snippets by @agilgur5 in [#4731](https://github.com/wailsapp/wails/pull/4731) - Fixed link to CoC in Community Guide when there was a trailing slash by @agilgur5 in [#4732](https://github.com/wailsapp/wails/pull/4732) - Fixed indentation in "How does it work?" page by @agilgur5 in [#4733](https://github.com/wailsapp/wails/pull/4733) From c73b2dd753d7b379ec4496e5b2ec5db02a9a307f Mon Sep 17 00:00:00 2001 From: Anton Gilgur <4970083+agilgur5@users.noreply.github.com> Date: Sun, 30 Nov 2025 01:42:02 -0500 Subject: [PATCH 08/25] [v2] docs(menu): fix some syntax issues (#4726) * [v2] docs(menu): fix some syntax issues - one line wasn't properly indented - one line was missing a closing brace and wouldn't compile as such noticed this while [answering a question on SO](https://stackoverflow.com/a/79827672/3431180) which linked to this page * add changelog entry per PR template * consistent 4 space indentation --------- Co-authored-by: Lea Anthony --- website/docs/reference/menus.mdx | 5 ++--- website/src/pages/changelog.mdx | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/website/docs/reference/menus.mdx b/website/docs/reference/menus.mdx index 4a9b4da1b..c2b63291d 100644 --- a/website/docs/reference/menus.mdx +++ b/website/docs/reference/menus.mdx @@ -11,7 +11,6 @@ setting it in the [`Menu`](../reference/options.mdx#menu) application config, or An example of how to create a menu: ```go - app := NewApp() AppMenu := menu.NewMenu() @@ -29,7 +28,7 @@ An example of how to create a menu: }) if runtime.GOOS == "darwin" { - AppMenu.Append(menu.EditMenu()) // On macOS platform, EditMenu should be appended to enable Cmd+C, Cmd+V, Cmd+Z... shortcuts + AppMenu.Append(menu.EditMenu()) // On macOS platform, EditMenu should be appended to enable Cmd+C, Cmd+V, Cmd+Z... shortcuts } err := wails.Run(&options.App{ @@ -40,7 +39,7 @@ An example of how to create a menu: Bind: []interface{}{ app, }, - ) + }) // ... ``` diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx index b802414ac..0b1a30618 100644 --- a/website/src/pages/changelog.mdx +++ b/website/src/pages/changelog.mdx @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed menu reference syntax by @agilgur5 in [#4726](https://github.com/wailsapp/wails/pull/4726) - Fixed indentation in Application Development guide by @agilgur5 in [#4730](https://github.com/wailsapp/wails/pull/4730) - Updated Application Development guide to show imports in the `app.go` snippets by @agilgur5 in [#4731](https://github.com/wailsapp/wails/pull/4731) - Fixed link to CoC in Community Guide when there was a trailing slash by @agilgur5 in [#4732](https://github.com/wailsapp/wails/pull/4732) From cb3305a2fcae30aa36012c8a92c3503b7512f32a Mon Sep 17 00:00:00 2001 From: Anton Gilgur <4970083+agilgur5@users.noreply.github.com> Date: Sun, 30 Nov 2025 14:22:52 -0500 Subject: [PATCH 09/25] [v2] docs(menu): add imports and complete the example (#4727) * [v2] docs(menu): add imports and complete the example - the example was missing imports, which [confused a user](https://stackoverflow.com/q/79827619/3431180), particularly due to the `rt` import alias - plus there are a good number of imports too, which this makes explicit - it also didn't mention that it built on top of the `NewApp` / `app.go` scaffold, so mention and link to that as well - it wasn't clear where `NewApp` came from without that - give this file the title `menu.go` for clarity / explicitness - also handle the error at the end similar to [existing examples](https://github.com/wailsapp/wails/blob/4c464b3092fff35b993f31ca62ca612399dde970/website/docs/guides/application-development.mdx?plain=1#L54) * add changelog entry per PR template --------- Co-authored-by: Lea Anthony --- website/docs/reference/menus.mdx | 2 +- website/src/pages/changelog.mdx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/website/docs/reference/menus.mdx b/website/docs/reference/menus.mdx index c2b63291d..ca1f3f404 100644 --- a/website/docs/reference/menus.mdx +++ b/website/docs/reference/menus.mdx @@ -8,7 +8,7 @@ It is possible to add an application menu to Wails projects. This is achieved by setting it in the [`Menu`](../reference/options.mdx#menu) application config, or by calling the runtime method [MenuSetApplicationMenu](../reference/runtime/menu.mdx#menusetapplicationmenu). -An example of how to create a menu: +An example of how to create a menu, using [the `NewApp` scaffold](../guides/application-development.mdx): ```go app := NewApp() diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx index 0b1a30618..00d9ac455 100644 --- a/website/src/pages/changelog.mdx +++ b/website/src/pages/changelog.mdx @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Updated menu reference docs with complete imports by @agilgur5 in [#4727](https://github.com/wailsapp/wails/pull/4727) - Fixed menu reference syntax by @agilgur5 in [#4726](https://github.com/wailsapp/wails/pull/4726) - Fixed indentation in Application Development guide by @agilgur5 in [#4730](https://github.com/wailsapp/wails/pull/4730) - Updated Application Development guide to show imports in the `app.go` snippets by @agilgur5 in [#4731](https://github.com/wailsapp/wails/pull/4731) From 7b8355a385e6564809cbf8207d6a7da6cad82039 Mon Sep 17 00:00:00 2001 From: Anton Gilgur <4970083+agilgur5@users.noreply.github.com> Date: Mon, 1 Dec 2025 03:16:00 -0500 Subject: [PATCH 10/25] [v2] docs(menu): add imports and complete the example (post merge conflict) (#4742) * [v2] docs(menu): add imports and complete the example (post merge conflict) This partially redoes commit cb3305a2fcae30aa36012c8a92c3503b7512f32a, as a merge conflict resolution seemed to have accidentally removed a large portion of the changes - the example was missing imports, which [confused a user](https://stackoverflow.com/q/79827619/3431180), particularly due to the `rt` import alias - plus there are a good number of imports too, which this makes explicit - also give this file the title `menu.go` for clarity / explicitness, particularly to differentiate from the `NewApp` / `app.go` scaffold - also handle the error at the end similar to [existing examples](https://github.com/wailsapp/wails/blob/4c464b3092fff35b993f31ca62ca612399dde970/website/docs/guides/application-development.mdx?plain=1#L54) * add changelog entry per PR template --- website/docs/reference/menus.mdx | 21 +++++++++++++++++++-- website/src/pages/changelog.mdx | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/website/docs/reference/menus.mdx b/website/docs/reference/menus.mdx index ca1f3f404..52f399f0b 100644 --- a/website/docs/reference/menus.mdx +++ b/website/docs/reference/menus.mdx @@ -10,7 +10,21 @@ setting it in the [`Menu`](../reference/options.mdx#menu) application config, or An example of how to create a menu, using [the `NewApp` scaffold](../guides/application-development.mdx): -```go +```go title="main.go" +package main + +import ( + "log" + "runtime" + + "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2/pkg/menu" + "github.com/wailsapp/wails/v2/pkg/menu/keys" + "github.com/wailsapp/wails/v2/pkg/options" + rt "github.com/wailsapp/wails/v2/pkg/runtime" +) + +func main() { app := NewApp() AppMenu := menu.NewMenu() @@ -40,7 +54,10 @@ An example of how to create a menu, using [the `NewApp` scaffold](../guides/appl app, }, }) - // ... + if err != nil { + log.Fatal(err) + } +} ``` It is also possible to dynamically update the menu, by updating the menu struct and calling diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx index 00d9ac455..271f24a87 100644 --- a/website/src/pages/changelog.mdx +++ b/website/src/pages/changelog.mdx @@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- Updated menu reference docs with complete imports by @agilgur5 in [#4727](https://github.com/wailsapp/wails/pull/4727) +- Updated menu reference docs with complete imports by @agilgur5 in [#4727](https://github.com/wailsapp/wails/pull/4727) and [#4742](https://github.com/wailsapp/wails/pull/4742) - Fixed menu reference syntax by @agilgur5 in [#4726](https://github.com/wailsapp/wails/pull/4726) - Fixed indentation in Application Development guide by @agilgur5 in [#4730](https://github.com/wailsapp/wails/pull/4730) - Updated Application Development guide to show imports in the `app.go` snippets by @agilgur5 in [#4731](https://github.com/wailsapp/wails/pull/4731) From 8e77d9358ed713eaa2e9b4bfcf7a6a024b3525b2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 3 Dec 2025 21:59:51 +1100 Subject: [PATCH 11/25] chore: update sponsors.svg (#4744) Co-authored-by: leaanthony <1943904+leaanthony@users.noreply.github.com> --- website/static/img/sponsors.svg | 46 +++++++++++++++++---------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/website/static/img/sponsors.svg b/website/static/img/sponsors.svg index 2231cd15d..0dc715920 100644 --- a/website/static/img/sponsors.svg +++ b/website/static/img/sponsors.svg @@ -1,4 +1,4 @@ - + Bronze Sponsors - Cody Bentley + Cody Bentley - + - + - Kazuya Gokita + Kazuya Gokita - + - + - CodeRabbit + CodeRabbit - + - + - Daniel Grice + Daniel Grice - + - + - Argus Labs + Argus Labs - + - + + + + johnvcoleman-w24 + + + + + Covering Costs Marcus @@ -355,11 +363,5 @@ text { - - - - - - From 44a9d617e8098f41440929290c76c308e23a04b6 Mon Sep 17 00:00:00 2001 From: Paul Brickwell <68799815+paulbrickwell@users.noreply.github.com> Date: Thu, 4 Dec 2025 01:40:19 -0800 Subject: [PATCH 12/25] Add templates for Nuxt (#4750) Add Wails templates for Nuxt --- website/versioned_docs/version-v2.11.0/community/templates.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/versioned_docs/version-v2.11.0/community/templates.mdx b/website/versioned_docs/version-v2.11.0/community/templates.mdx index 3b020b60b..f10f51df3 100644 --- a/website/versioned_docs/version-v2.11.0/community/templates.mdx +++ b/website/versioned_docs/version-v2.11.0/community/templates.mdx @@ -29,6 +29,8 @@ If you are unsure about a template, inspect `package.json` and `wails.json` for - [wails-template-naive](https://github.com/tk103331/wails-template-naive) - Wails template based on Naive UI (A Vue 3 Component Library) - [wails-template-primevue-sakai](https://github.com/TekWizely/wails-template-primevue-sakai) - Wails starter using [PrimeVue's Sakai Application Template](https://sakai.primevue.org) (Vite, Vue, PrimeVue, TailwindCSS, Vue Router, Themes, Dark Mode, UI Components, and more) - [wails-template-tdesign-js](https://github.com/tongque0/wails-template-tdesign-js) - Wails template based on TDesign UI (a Vue 3 UI library by Tencent), using Vite, Pinia, Vue Router, ESLint, and Prettier. +- [wails-nuxt-template](https://github.com/paulbrickwell/wails-nuxt-template) - Wails template using Nuxt 4 +- [wails-nuxt-tailwind-template](https://github.com/paulbrickwell/wails-nuxt-tailwind-template) - Wails template using Nuxt 4 and the official Nuxt Tailwind and Nuxt Color Mode modules ## Angular From 7aaa203c5fba2de910b0fe12b7c29bfcdda8a5a7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 7 Dec 2025 17:05:54 +1100 Subject: [PATCH 13/25] chore: update sponsors.svg (#4754) Co-authored-by: leaanthony <1943904+leaanthony@users.noreply.github.com> --- website/static/img/sponsors.svg | 54 +++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/website/static/img/sponsors.svg b/website/static/img/sponsors.svg index 0dc715920..009160fa6 100644 --- a/website/static/img/sponsors.svg +++ b/website/static/img/sponsors.svg @@ -109,60 +109,68 @@ text { Buying Breakfast - Tai Groot + Tai Groot - + - + - Tom Wu + Tom Wu - + - + - vaaski + vaaski - + - + - Sander + Sander - + - + - Kevin + Kevin - + - + - elapse2039 + elapse2039 - + - + - Zach + Zach - + - + + + + zakaria + + + + + Buying Coffee @@ -255,10 +263,10 @@ text { - + - + From a0cb86ebff19f8a050e1b3c94682e7c511e172a0 Mon Sep 17 00:00:00 2001 From: Andrey Pshenkin Date: Wed, 10 Dec 2025 05:14:23 +0000 Subject: [PATCH 14/25] V2 - Add universal link support for macOS (#4693) * add universal link support * add changelog * add docs about universal links --------- Co-authored-by: Lea Anthony --- .../frontend/desktop/darwin/AppDelegate.m | 12 ++++++++++++ .../frontend/desktop/darwin/CustomProtocol.h | 2 +- .../frontend/desktop/darwin/CustomProtocol.m | 2 +- .../frontend/desktop/darwin/frontend.go | 4 ++-- .../docs/guides/custom-protocol-schemes.mdx | 18 ++++++++++++++++++ website/src/pages/changelog.mdx | 1 + 6 files changed, 35 insertions(+), 4 deletions(-) diff --git a/v2/internal/frontend/desktop/darwin/AppDelegate.m b/v2/internal/frontend/desktop/darwin/AppDelegate.m index 318c333d8..a73ec3ec3 100644 --- a/v2/internal/frontend/desktop/darwin/AppDelegate.m +++ b/v2/internal/frontend/desktop/darwin/AppDelegate.m @@ -9,6 +9,7 @@ #import #import "AppDelegate.h" +#import "CustomProtocol.h" #import "message.h" @implementation AppDelegate @@ -19,6 +20,17 @@ return YES; } +- (BOOL)application:(NSApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray> * _Nullable))restorationHandler { + if ([userActivity.activityType isEqualToString:NSUserActivityTypeBrowsingWeb]) { + NSURL *url = userActivity.webpageURL; + if (url) { + HandleOpenURL((char*)[[url absoluteString] UTF8String]); + return YES; + } + } + return NO; +} + - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender { return NO; } diff --git a/v2/internal/frontend/desktop/darwin/CustomProtocol.h b/v2/internal/frontend/desktop/darwin/CustomProtocol.h index da0e7079f..0698a4d45 100644 --- a/v2/internal/frontend/desktop/darwin/CustomProtocol.h +++ b/v2/internal/frontend/desktop/darwin/CustomProtocol.h @@ -3,7 +3,7 @@ #import -extern void HandleCustomProtocol(char*); +extern void HandleOpenURL(char*); @interface CustomProtocolSchemeHandler : NSObject + (void)handleGetURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent; diff --git a/v2/internal/frontend/desktop/darwin/CustomProtocol.m b/v2/internal/frontend/desktop/darwin/CustomProtocol.m index 7365e4f50..ebc61aa00 100644 --- a/v2/internal/frontend/desktop/darwin/CustomProtocol.m +++ b/v2/internal/frontend/desktop/darwin/CustomProtocol.m @@ -6,7 +6,7 @@ NSString *urlStr = [[event paramDescriptorForKeyword:keyDirectObject] stringValue]; - HandleCustomProtocol((char*)[[[event paramDescriptorForKeyword:keyDirectObject] stringValue] UTF8String]); + HandleOpenURL((char*)[[[event paramDescriptorForKeyword:keyDirectObject] stringValue] UTF8String]); } @end diff --git a/v2/internal/frontend/desktop/darwin/frontend.go b/v2/internal/frontend/desktop/darwin/frontend.go index c9e70d4be..6566445d5 100644 --- a/v2/internal/frontend/desktop/darwin/frontend.go +++ b/v2/internal/frontend/desktop/darwin/frontend.go @@ -518,8 +518,8 @@ func HandleOpenFile(filePath *C.char) { openFilepathBuffer <- goFilepath } -//export HandleCustomProtocol -func HandleCustomProtocol(url *C.char) { +//export HandleOpenURL +func HandleOpenURL(url *C.char) { goUrl := C.GoString(url) openUrlBuffer <- goUrl } diff --git a/website/docs/guides/custom-protocol-schemes.mdx b/website/docs/guides/custom-protocol-schemes.mdx index c56634f0e..216fb7100 100644 --- a/website/docs/guides/custom-protocol-schemes.mdx +++ b/website/docs/guides/custom-protocol-schemes.mdx @@ -59,6 +59,24 @@ func main() { } ``` +If you want to handle universal links as well, follow this [guide](https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app) to add required entitlements, add required keys to Info.plist and configure `apple-app-site-association` on your website. + +Here is example for Info.plist: +```xml +NSUserActivityTypes + + NSUserActivityTypeBrowsingWeb + +``` + +And for entitlements.plist +```xml +com.apple.developer.associated-domains + + applinks:myawesomeapp.com + +``` + ### Windows On Windows Custom Protocol Schemes is supported only with NSIS installer. During installation, the installer will create a diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx index 271f24a87..fba54f570 100644 --- a/website/src/pages/changelog.mdx +++ b/website/src/pages/changelog.mdx @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added `ContentProtection` option to allow hiding the application window from screen sharing software [#4241](https://github.com/wailsapp/wails/pull/4241) by [@Taiterbase](https://github.com/Taiterbase) - Added `build:tags` to project specification for automatically adding compilation tags by @symball in [PR](https://github.com/wailsapp/wails/pull/4439) - Support for binding generics in [PR](https://github.dev/wailsapp/wails/pull/3626) by @ktsivkov +- Add universal link support for macOS by @APshenkin in [PR](https://github.com/wailsapp/wails/pull/4693) ### Fixed - Added url validation for BrowserOpenURL by @APshenkin in [PR](https://github.com/wailsapp/wails/pull/4484) From 23bd70e05774cc6c5e79dff0c0420f7353ed33a9 Mon Sep 17 00:00:00 2001 From: Viktor Poletansky Date: Wed, 10 Dec 2025 10:20:22 +0300 Subject: [PATCH 15/25] Fix generated enums ordering (#4664) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * enumsort: enumsort * enumsort: update changelog * Add tests for enum ordering fix Tests added: - EnumOrderingTest: Verifies multiple enums are output in alphabetical order - EnumElementOrderingTest: Verifies enum elements are sorted by TSName - TSNameEnumElementOrderingTest: Verifies TSName() interface enums are also sorted 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --------- Co-authored-by: Lea Anthony Co-authored-by: Claude Opus 4.5 --- v2/internal/binding/binding.go | 12 +- .../binding_enum_ordering_test.go | 271 ++++++++++++++++++ .../binding/binding_test/binding_test.go | 4 + v2/internal/typescriptify/typescriptify.go | 8 +- website/src/pages/changelog.mdx | 1 + 5 files changed, 291 insertions(+), 5 deletions(-) create mode 100644 v2/internal/binding/binding_test/binding_enum_ordering_test.go diff --git a/v2/internal/binding/binding.go b/v2/internal/binding/binding.go index 4908635e1..b7bf07ae0 100644 --- a/v2/internal/binding/binding.go +++ b/v2/internal/binding/binding.go @@ -123,7 +123,15 @@ func (b *Bindings) GenerateModels() ([]byte, error) { // if we have enums for this package, add them as well var enums, enumsExist = b.enumsToGenerateTS[packageName] if enumsExist { - for enumName, enum := range enums { + // Sort the enum names first to make the output deterministic + sortedEnumNames := make([]string, 0, len(enums)) + for enumName := range enums { + sortedEnumNames = append(sortedEnumNames, enumName) + } + sort.Strings(sortedEnumNames) + + for _, enumName := range sortedEnumNames { + enum := enums[enumName] fqemumname := packageName + "." + enumName if seen.Contains(fqemumname) { continue @@ -172,7 +180,7 @@ func (b *Bindings) GenerateModels() ([]byte, error) { } // Sort the package names first to make the output deterministic - sortedPackageNames := make([]string, 0) + sortedPackageNames := make([]string, 0, len(models)) for packageName := range models { sortedPackageNames = append(sortedPackageNames, packageName) } diff --git a/v2/internal/binding/binding_test/binding_enum_ordering_test.go b/v2/internal/binding/binding_test/binding_enum_ordering_test.go new file mode 100644 index 000000000..0939535ec --- /dev/null +++ b/v2/internal/binding/binding_test/binding_enum_ordering_test.go @@ -0,0 +1,271 @@ +package binding_test + +// Test for PR #4664: Fix generated enums ordering +// This test ensures that enum output is deterministic regardless of map iteration order + +// ZFirstEnum - named with Z prefix to test alphabetical sorting +type ZFirstEnum int + +const ( + ZFirstEnumValue1 ZFirstEnum = iota + ZFirstEnumValue2 +) + +var AllZFirstEnumValues = []struct { + Value ZFirstEnum + TSName string +}{ + {ZFirstEnumValue1, "ZValue1"}, + {ZFirstEnumValue2, "ZValue2"}, +} + +// ASecondEnum - named with A prefix to test alphabetical sorting +type ASecondEnum int + +const ( + ASecondEnumValue1 ASecondEnum = iota + ASecondEnumValue2 +) + +var AllASecondEnumValues = []struct { + Value ASecondEnum + TSName string +}{ + {ASecondEnumValue1, "AValue1"}, + {ASecondEnumValue2, "AValue2"}, +} + +// MMiddleEnum - named with M prefix to test alphabetical sorting +type MMiddleEnum int + +const ( + MMiddleEnumValue1 MMiddleEnum = iota + MMiddleEnumValue2 +) + +var AllMMiddleEnumValues = []struct { + Value MMiddleEnum + TSName string +}{ + {MMiddleEnumValue1, "MValue1"}, + {MMiddleEnumValue2, "MValue2"}, +} + +type EntityWithMultipleEnums struct { + Name string `json:"name"` + EnumZ ZFirstEnum `json:"enumZ"` + EnumA ASecondEnum `json:"enumA"` + EnumM MMiddleEnum `json:"enumM"` +} + +func (e EntityWithMultipleEnums) Get() EntityWithMultipleEnums { + return e +} + +// EnumOrderingTest tests that multiple enums in the same package are output +// in alphabetical order by enum name. Before PR #4664, the order was +// non-deterministic due to Go map iteration order. +var EnumOrderingTest = BindingTest{ + name: "EnumOrderingTest", + structs: []interface{}{ + &EntityWithMultipleEnums{}, + }, + enums: []interface{}{ + // Intentionally add enums in non-alphabetical order + AllZFirstEnumValues, + AllASecondEnumValues, + AllMMiddleEnumValues, + }, + exemptions: nil, + shouldError: false, + TsGenerationOptionsTest: TsGenerationOptionsTest{ + TsPrefix: "", + TsSuffix: "", + }, + // Expected output should have enums in alphabetical order: ASecondEnum, MMiddleEnum, ZFirstEnum + want: `export namespace binding_test { + + export enum ASecondEnum { + AValue1 = 0, + AValue2 = 1, + } + export enum MMiddleEnum { + MValue1 = 0, + MValue2 = 1, + } + export enum ZFirstEnum { + ZValue1 = 0, + ZValue2 = 1, + } + export class EntityWithMultipleEnums { + name: string; + enumZ: ZFirstEnum; + enumA: ASecondEnum; + enumM: MMiddleEnum; + + static createFrom(source: any = {}) { + return new EntityWithMultipleEnums(source); + } + + constructor(source: any = {}) { + if ('string' === typeof source) source = JSON.parse(source); + this.name = source["name"]; + this.enumZ = source["enumZ"]; + this.enumA = source["enumA"]; + this.enumM = source["enumM"]; + } + } + +} +`, +} + +// EnumElementOrderingEnum tests sorting of enum elements by TSName +type EnumElementOrderingEnum string + +const ( + EnumElementZ EnumElementOrderingEnum = "z_value" + EnumElementA EnumElementOrderingEnum = "a_value" + EnumElementM EnumElementOrderingEnum = "m_value" +) + +// AllEnumElementOrderingValues intentionally lists values out of alphabetical order +// to test that AddEnum sorts them +var AllEnumElementOrderingValues = []struct { + Value EnumElementOrderingEnum + TSName string +}{ + {EnumElementZ, "Zebra"}, + {EnumElementA, "Apple"}, + {EnumElementM, "Mango"}, +} + +type EntityWithUnorderedEnumElements struct { + Name string `json:"name"` + Enum EnumElementOrderingEnum `json:"enum"` +} + +func (e EntityWithUnorderedEnumElements) Get() EntityWithUnorderedEnumElements { + return e +} + +// EnumElementOrderingTest tests that enum elements are sorted alphabetically +// by their TSName within an enum. Before PR #4664, elements appeared in the +// order they were added, which could be arbitrary. +var EnumElementOrderingTest = BindingTest{ + name: "EnumElementOrderingTest", + structs: []interface{}{ + &EntityWithUnorderedEnumElements{}, + }, + enums: []interface{}{ + AllEnumElementOrderingValues, + }, + exemptions: nil, + shouldError: false, + TsGenerationOptionsTest: TsGenerationOptionsTest{ + TsPrefix: "", + TsSuffix: "", + }, + // Expected output should have enum elements sorted: Apple, Mango, Zebra + want: `export namespace binding_test { + + export enum EnumElementOrderingEnum { + Apple = "a_value", + Mango = "m_value", + Zebra = "z_value", + } + export class EntityWithUnorderedEnumElements { + name: string; + enum: EnumElementOrderingEnum; + + static createFrom(source: any = {}) { + return new EntityWithUnorderedEnumElements(source); + } + + constructor(source: any = {}) { + if ('string' === typeof source) source = JSON.parse(source); + this.name = source["name"]; + this.enum = source["enum"]; + } + } + +} +`, +} + +// TSNameEnumElementOrdering tests sorting with TSName() method enum +type TSNameEnumElementOrdering string + +const ( + TSNameEnumZ TSNameEnumElementOrdering = "z_value" + TSNameEnumA TSNameEnumElementOrdering = "a_value" + TSNameEnumM TSNameEnumElementOrdering = "m_value" +) + +func (v TSNameEnumElementOrdering) TSName() string { + switch v { + case TSNameEnumZ: + return "Zebra" + case TSNameEnumA: + return "Apple" + case TSNameEnumM: + return "Mango" + default: + return "Unknown" + } +} + +// AllTSNameEnumValues intentionally out of order +var AllTSNameEnumValues = []TSNameEnumElementOrdering{TSNameEnumZ, TSNameEnumA, TSNameEnumM} + +type EntityWithTSNameEnumOrdering struct { + Name string `json:"name"` + Enum TSNameEnumElementOrdering `json:"enum"` +} + +func (e EntityWithTSNameEnumOrdering) Get() EntityWithTSNameEnumOrdering { + return e +} + +// TSNameEnumElementOrderingTest tests that enums using TSName() method +// also have their elements sorted alphabetically by the TSName. +var TSNameEnumElementOrderingTest = BindingTest{ + name: "TSNameEnumElementOrderingTest", + structs: []interface{}{ + &EntityWithTSNameEnumOrdering{}, + }, + enums: []interface{}{ + AllTSNameEnumValues, + }, + exemptions: nil, + shouldError: false, + TsGenerationOptionsTest: TsGenerationOptionsTest{ + TsPrefix: "", + TsSuffix: "", + }, + // Expected output should have enum elements sorted: Apple, Mango, Zebra + want: `export namespace binding_test { + + export enum TSNameEnumElementOrdering { + Apple = "a_value", + Mango = "m_value", + Zebra = "z_value", + } + export class EntityWithTSNameEnumOrdering { + name: string; + enum: TSNameEnumElementOrdering; + + static createFrom(source: any = {}) { + return new EntityWithTSNameEnumOrdering(source); + } + + constructor(source: any = {}) { + if ('string' === typeof source) source = JSON.parse(source); + this.name = source["name"]; + this.enum = source["enum"]; + } + } + +} +`, +} diff --git a/v2/internal/binding/binding_test/binding_test.go b/v2/internal/binding/binding_test/binding_test.go index d358d8b0f..41f0618ce 100644 --- a/v2/internal/binding/binding_test/binding_test.go +++ b/v2/internal/binding/binding_test/binding_test.go @@ -55,6 +55,10 @@ func TestBindings_GenerateModels(t *testing.T) { Generics2Test, IgnoredTest, DeepElementsTest, + // PR #4664: Enum ordering tests + EnumOrderingTest, + EnumElementOrderingTest, + TSNameEnumElementOrderingTest, } testLogger := &logger.Logger{} diff --git a/v2/internal/typescriptify/typescriptify.go b/v2/internal/typescriptify/typescriptify.go index 216fba820..e732c5976 100644 --- a/v2/internal/typescriptify/typescriptify.go +++ b/v2/internal/typescriptify/typescriptify.go @@ -2,6 +2,7 @@ package typescriptify import ( "bufio" + "cmp" "fmt" "io" "log" @@ -9,6 +10,7 @@ import ( "path" "reflect" "regexp" + "slices" "strings" "time" @@ -372,6 +374,9 @@ func (t *TypeScriptify) AddEnum(values interface{}) *TypeScriptify { elements = append(elements, el) } + slices.SortFunc(elements, func(a, b enumElement) int { + return cmp.Compare(a.name, b.name) + }) ty := reflect.TypeOf(elements[0].value) t.enums[ty] = elements t.enumTypes = append(t.enumTypes, EnumType{Type: ty}) @@ -516,9 +521,6 @@ func (t TypeScriptify) ConvertToFile(fileName string, packageName string) error if _, err := f.WriteString(converted); err != nil { return err } - if err != nil { - return err - } return nil } diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx index fba54f570..3c4b1822b 100644 --- a/website/src/pages/changelog.mdx +++ b/website/src/pages/changelog.mdx @@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed C compilation error in onWayland on Linux due to declaration after label [#4446](https://github.com/wailsapp/wails/pull/4446) by [@jaesung9507](https://github.com/jaesung9507) - Use computed style when adding 'wails-drop-target-active' [PR](https://github.com/wailsapp/wails/pull/4420) by [@riannucci](https://github.com/riannucci) - Fixed panic when adding menuroles on Linux [#4558](https://github.com/wailsapp/wails/pull/4558) by [@jaesung9507](https://github.com/jaesung9507) +- Fixed generated enums ordering [#4664](https://github.com/wailsapp/wails/pull/4664) by [@rprtr258](https://github.com/rprtr258). - Fixed Discord badge in README by @sharkmu in [PR](https://github.com/wailsapp/wails/pull/4626) - Fixed HTML DnD by @leaanthony From 764f9bb17573eb7a1adc3e066dc61dda17f391c9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 12 Dec 2025 06:33:46 +1100 Subject: [PATCH 16/25] chore: update sponsors.svg (#4763) Co-authored-by: leaanthony <1943904+leaanthony@users.noreply.github.com> --- website/static/img/sponsors.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/static/img/sponsors.svg b/website/static/img/sponsors.svg index 009160fa6..ac52efb99 100644 --- a/website/static/img/sponsors.svg +++ b/website/static/img/sponsors.svg @@ -360,10 +360,10 @@ text { - + - + From 216c9961a5218fff72d65ccce43dc745941ef805 Mon Sep 17 00:00:00 2001 From: Tilak Sasmal Date: Sat, 13 Dec 2025 04:30:19 +0530 Subject: [PATCH 17/25] Add installation command for Wails CLI (#4692) * Add installation command for Wails CLI Added code block for Wails CLI installation command. This will allow coying the command with one click. * Improve wails installation documentation Updated wails installation documentation for easier command copying. --------- Co-authored-by: Lea Anthony --- website/src/pages/changelog.mdx | 1 + .../version-v2.10/gettingstarted/installation.mdx | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx index 3c4b1822b..671d209c9 100644 --- a/website/src/pages/changelog.mdx +++ b/website/src/pages/changelog.mdx @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated Application Development guide to show imports in the `app.go` snippets by @agilgur5 in [#4731](https://github.com/wailsapp/wails/pull/4731) - Fixed link to CoC in Community Guide when there was a trailing slash by @agilgur5 in [#4732](https://github.com/wailsapp/wails/pull/4732) - Fixed indentation in "How does it work?" page by @agilgur5 in [#4733](https://github.com/wailsapp/wails/pull/4733) +- Updated wails installation documentation to allow copying the `install wails` command with one click by @tilak999 in [#4692](https://github.com/wailsapp/wails/pull/4692) ## v2.11.0 - 2025-11-08 diff --git a/website/versioned_docs/version-v2.10/gettingstarted/installation.mdx b/website/versioned_docs/version-v2.10/gettingstarted/installation.mdx index 1511e3865..19f349f3e 100644 --- a/website/versioned_docs/version-v2.10/gettingstarted/installation.mdx +++ b/website/versioned_docs/version-v2.10/gettingstarted/installation.mdx @@ -73,6 +73,10 @@ import TabItem from "@theme/TabItem"; Run `go install github.com/wailsapp/wails/v2/cmd/wails@latest` to install the Wails CLI. +```shell +go install github.com/wailsapp/wails/v2/cmd/wails@latest +``` + Note: If you get an error similar to this: ```shell From db11f350cd830c443ec3679ecf9fdddd574e2a1f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 14 Dec 2025 11:56:20 +1100 Subject: [PATCH 18/25] chore: update sponsors.svg (#4787) Co-authored-by: leaanthony <1943904+leaanthony@users.noreply.github.com> --- website/static/img/sponsors.svg | 82 ++++++++++++++++----------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/website/static/img/sponsors.svg b/website/static/img/sponsors.svg index ac52efb99..7698b96ca 100644 --- a/website/static/img/sponsors.svg +++ b/website/static/img/sponsors.svg @@ -250,126 +250,126 @@ text { - + - + - + - + - + - + - + - + - + - + + + + + + + + Helpers - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - + From 6a2619880c43a9693445267ecfbfc2ff0218e4e9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 22:20:33 +1100 Subject: [PATCH 19/25] chore: update sponsors.svg (#4795) Co-authored-by: leaanthony <1943904+leaanthony@users.noreply.github.com> --- website/static/img/sponsors.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/static/img/sponsors.svg b/website/static/img/sponsors.svg index 7698b96ca..d803a8181 100644 --- a/website/static/img/sponsors.svg +++ b/website/static/img/sponsors.svg @@ -367,9 +367,9 @@ text { - + - + From ebe8de8d2b14cfb8505d2d4290d2607ea70358a8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 21:53:35 +1100 Subject: [PATCH 20/25] chore: update sponsors.svg (#4804) Co-authored-by: leaanthony <1943904+leaanthony@users.noreply.github.com> --- website/static/img/sponsors.svg | 108 +++++++++++++++----------------- 1 file changed, 50 insertions(+), 58 deletions(-) diff --git a/website/static/img/sponsors.svg b/website/static/img/sponsors.svg index d803a8181..a12952fc2 100644 --- a/website/static/img/sponsors.svg +++ b/website/static/img/sponsors.svg @@ -78,36 +78,28 @@ text { Covering Costs - Marcus + Marcus - + - + - Iain + Iain - + - + - Michael + Michael - + - - - - BlueSky... - - - - - + Buying Breakfast Tai Groot @@ -250,126 +242,126 @@ text { - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + Helpers - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - + - + - + - + - + - + - + From bc62140ac0be4e3be77f829ea4ea09c988621b14 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 21:17:03 +1100 Subject: [PATCH 21/25] chore: update sponsors.svg (#4809) Co-authored-by: leaanthony <1943904+leaanthony@users.noreply.github.com> --- website/static/img/sponsors.svg | 35 ++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/website/static/img/sponsors.svg b/website/static/img/sponsors.svg index a12952fc2..7054c3e90 100644 --- a/website/static/img/sponsors.svg +++ b/website/static/img/sponsors.svg @@ -242,51 +242,58 @@ text { - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + Helpers From 00b0ce936d68cd610f0ce81f9ed89c8b00a09ef3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 21 Dec 2025 13:15:25 +1100 Subject: [PATCH 22/25] chore: update sponsors.svg (#4822) Co-authored-by: leaanthony <1943904+leaanthony@users.noreply.github.com> --- website/static/img/sponsors.svg | 39 +++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/website/static/img/sponsors.svg b/website/static/img/sponsors.svg index 7054c3e90..5088ac6e8 100644 --- a/website/static/img/sponsors.svg +++ b/website/static/img/sponsors.svg @@ -242,58 +242,65 @@ text { - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + Helpers From b25fe7496f629e63b858aa935b78c7c8d8c3e6ac Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 22 Dec 2025 19:23:37 +1100 Subject: [PATCH 23/25] chore: update sponsors.svg (#4824) Co-authored-by: leaanthony <1943904+leaanthony@users.noreply.github.com> --- website/static/img/sponsors.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/static/img/sponsors.svg b/website/static/img/sponsors.svg index 5088ac6e8..453a1de03 100644 --- a/website/static/img/sponsors.svg +++ b/website/static/img/sponsors.svg @@ -15,8 +15,8 @@ text { font-size: 20px; } -Silver Sponsors - letheanVPN +Silver Sponsors + LetheanNetwork From 7957d23c250dc49bca48673061f97ff1d6f7712b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 28 Dec 2025 20:53:38 +1100 Subject: [PATCH 24/25] chore: update sponsors.svg (#4833) Co-authored-by: leaanthony <1943904+leaanthony@users.noreply.github.com> --- website/static/img/sponsors.svg | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/website/static/img/sponsors.svg b/website/static/img/sponsors.svg index 453a1de03..871854cb1 100644 --- a/website/static/img/sponsors.svg +++ b/website/static/img/sponsors.svg @@ -78,28 +78,44 @@ text { Covering Costs - Marcus + Marcus - + - + - Iain + Iain - + - + - Michael + Michael + + + + + + BlueSky... + + - + + + + Sergio + + + + + Buying Breakfast Tai Groot From 6630fa5647fa4be4d9d1e8789e4da61ffc3215b5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 2 Jan 2026 21:19:34 +1100 Subject: [PATCH 25/25] chore: update sponsors.svg (#4846) Co-authored-by: leaanthony <1943904+leaanthony@users.noreply.github.com> --- website/static/img/sponsors.svg | 101 ++++++++++++-------------------- 1 file changed, 39 insertions(+), 62 deletions(-) diff --git a/website/static/img/sponsors.svg b/website/static/img/sponsors.svg index 871854cb1..ac7e8aa23 100644 --- a/website/static/img/sponsors.svg +++ b/website/static/img/sponsors.svg @@ -15,68 +15,52 @@ text { font-size: 20px; } -Silver Sponsors - LetheanNetwork - - - - - - - - Orb +Silver Sponsors + Orb - + - + Bronze Sponsors - Cody Bentley + Cody Bentley - + - + - Kazuya Gokita + Kazuya Gokita - + - + - CodeRabbit + CodeRabbit - + - + - Daniel Grice + Daniel Grice - + - + - Argus Labs + Argus Labs - + - - - - johnvcoleman-w24 - - - - - + Covering Costs Marcus @@ -320,78 +304,71 @@ text { Helpers - + - + - + - + - + - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +