* feat(v2): add runtime.ResetSignalHandlers() for Linux panic recovery
Add a new runtime function that allows users to reset signal handlers
before code that might panic from nil pointer dereferences.
On Linux, WebKit installs signal handlers without the SA_ONSTACK flag,
which prevents Go from properly recovering from panics caused by
SIGSEGV and other signals. This function adds SA_ONSTACK to the
relevant signal handlers (SIGSEGV, SIGBUS, SIGFPE, SIGABRT).
Usage:
```go
go func() {
defer func() {
if err := recover(); err != nil {
log.Printf("Recovered: %v", err)
}
}()
runtime.ResetSignalHandlers()
// Code that might panic...
}()
```
The function is a no-op on macOS and Windows.
Fixes#3965
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* test(v2): add panic-recovery-test example
Add an example that demonstrates the Linux signal handler issue (#3965)
and verifies the fix using runtime.ResetSignalHandlers().
The example includes:
- A Greet function that triggers a nil pointer dereference after a delay
- Auto-call from frontend after 5 seconds
- README with reproduction steps
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- Add test-cross-compile job that tests CGO builds for all 6 platform/arch combos
- Add test-non-cgo job for pure Go cross-compilation verification
- Add test-summary job with GitHub Actions summary output
- Add skip_tests input for manual workflow dispatch
- Verify Linux binaries link to required GTK/WebKit libraries
- Verify binary format matches expected architecture
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: add missing EventsOffAll export to runtime templates
The EventsOffAll function was implemented in the internal runtime
(desktop/events.js) and exported in the wrapper runtime files, but was
missing from the public runtime templates that are generated in user
projects. This caused a type mismatch where EventsOffAll was declared
in the TypeScript definition but the implementation was missing.
This commit adds the EventsOffAll export and type declaration to all
frontend framework templates:
- Common templates (generate/assets/common)
- React / React-TS
- Vue / Vue-TS
- Svelte / Svelte-TS
- Preact / Preact-TS
- Lit / Lit-TS
- Vanilla / Vanilla-TS
Fixes#4703
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* docs: add EventsOffAll to runtime events documentation
Added EventsOffAll function documentation to both English and Chinese
versions of the runtime events reference.
The function was already implemented in Go (pkg/runtime/events.go) and
JavaScript (internal/frontend/runtime/desktop/events.js), but was missing
from the public documentation.
Related to #4703
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* chore: add EventsOffAll fix to changelog
Added entry for the EventsOffAll fix to the Unreleased section
of the changelog.
Related to #4703
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* docs: translate EventsOffAll description to Chinese
Improved consistency in Chinese documentation by translating the
EventsOffAll description from English to Chinese, matching the
style of other event method descriptions.
Related to #4703
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
---------
Co-authored-by: cc <Zhuanz@MacBook-Pro.local>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* fix(v2/linux): fix crash on panic in JS-bound Go methods
WebKit2GTK installs signal handlers after gtk_main() starts, overriding
our SA_ONSTACK fix. This causes Go panics (e.g., nil pointer dereference)
in JS-bound methods to crash with 'non-Go code set up signal handler
without SA_ONSTACK flag'.
Fix by deferring signal handler installation via g_idle_add() to run
after GTK main loop starts, ensuring we fix handlers AFTER WebKit
has installed its own.
Fixes#3965
* docs: add changelog entry for Linux signal handler fix
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Update code block range in howdoesitwork.mdx
* docs: add changelog entry for PR #4884
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Disable suppressesIncrementalRendering on macOS 26+ (Tahoe) to prevent
WebView crashes when the frontend performs frequent UI updates.
Fixes#4592🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
* 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 <lea.anthony@gmail.com>
* 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 <noreply@anthropic.com>
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* [v2] docs(menu): add imports and complete the example (post merge conflict)
This partially redoes commit cb3305a2fc, 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](4c464b3092/website/docs/guides/application-development.mdx (L54))
* add changelog entry per PR template
* [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](4c464b3092/website/docs/guides/application-development.mdx (L54))
* add changelog entry per PR template
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* [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 <lea.anthony@gmail.com>
* [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 <lea.anthony@gmail.com>
* [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 <lea.anthony@gmail.com>
* 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 <lea.anthony@gmail.com>
* [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