Compare commits

...

81 Commits

Author SHA1 Message Date
Misite Bao 7670273d43 feat(website): init the website 2023-05-30 16:57:54 +08:00
Lea Anthony a15c0a5441 [v3] Website skeleton 2023-05-30 16:56:35 +08:00
Lea Anthony 19be7f61ac [v3 windows] Fix resizing. Add resize debouncing 2023-05-30 16:36:00 +08:00
Misite Bao bbf0e8cdad chore: split Taskfile (#2654) 2023-05-30 16:35:59 +08:00
Lea Anthony 7e2d2a29a1 [v3 windows] Initial webview2 working 2023-05-30 16:33:34 +08:00
Lea Anthony 671dc2aa3a [v3 windows] Implement start x/y + parent window for dialogs 2023-05-30 16:33:34 +08:00
Lea Anthony 294a2c701e [v3] Update esbuild 2023-05-30 16:33:34 +08:00
Lea Anthony 01f03c552d [v3] Improve invoke 2023-05-30 16:33:33 +08:00
Lea Anthony dc46154d94 [v3 mac] Support drag 2023-05-30 16:33:33 +08:00
Lea Anthony 87737c23eb [v3 mac] DisableWindowShadow -> DisableShadow 2023-05-30 16:33:33 +08:00
Lea Anthony 6e6f099a99 [v3 mac] Basic common event support. Taskfile refactor 2023-05-30 16:33:32 +08:00
Lea Anthony 4cb3321c39 [v3 mac] Update README 2023-05-30 16:32:02 +08:00
Lea Anthony 6a2343a1a0 [v3 mac] Add DisableWindowShadow option 2023-05-30 16:32:01 +08:00
Lea Anthony f2d6dba2cf [v3 windows] initial dialog support. Refactor button callback name 2023-05-30 16:32:01 +08:00
stffabi dd1ef7fae9 [v3 darwin] Add darwin identifier darwin only file 2023-05-30 16:32:01 +08:00
stffabi 527cff9ec3 [v3 darwin] Add darwin identifier to all C files of darwin 2023-05-30 16:32:00 +08:00
stffabi ba150eccae [v3 windows] Add close handling: HideOnClose, QuitOnLastWindowClosed and DisableQuitOnLastWindowClosed 2023-05-30 16:32:00 +08:00
Travis McLane fa74986f1e [v3 example] menu text toggle 2023-05-30 16:32:00 +08:00
Travis McLane d1085b5bea [v3 example] add menuitem.Hidden / setHidden example 2023-05-30 16:31:59 +08:00
Travis McLane 4d0a14d2eb [v3 darwin] menuitem.setHidden implementation 2023-05-30 16:31:59 +08:00
Travis McLane 8c3439b733 [dialogs] remove default title
without this removal a user would have to call `SetTitle("")` in order to
erase the default if they desire a title-less dialog.
2023-05-30 16:31:59 +08:00
stffabi a0534d527a [v3 application] Fix race conditions between starting a window/systray and starting the application
Make sure a window is never run before the windowCreated hooks have been executed.
2023-05-30 16:31:59 +08:00
Lea Anthony a5b52f2795 [v3 windows] initial systray support 2023-05-30 16:31:58 +08:00
Lea Anthony b526ebd679 [v3 mac] Update api. New template icon. 2023-05-30 16:31:58 +08:00
Lea Anthony 51b9315ae9 [v3 windows] update status 2023-05-30 16:31:58 +08:00
Lea Anthony 8edf44dc31 [v3 windows] New icons 2023-05-30 16:31:57 +08:00
Lea Anthony 9b7626e59e [v3 windows] Move icons to own package, systray dark mode icon, window.Focus(), 2023-05-30 16:31:57 +08:00
Lea Anthony 6dd092c7a9 [v3 windows] Rename systray callback handlers 2023-05-30 16:31:57 +08:00
Lea Anthony 46a0d467c0 [v3 windows] Dialogs to use invokeSync 2023-05-30 16:31:56 +08:00
Lea Anthony e3b164ae93 [v3 windows] Systray callback handlers 2023-05-30 16:31:56 +08:00
stffabi d8f58ab20f [v3 windows] Fix wndproc default case with WMMessageToString 2023-05-30 16:31:56 +08:00
stffabi 0de2bccd28 [v3 windows] Do not disable WndProc messaging for systray when updating icon 2023-05-30 16:31:55 +08:00
Lea Anthony 2eaf724710 [v3 windows] Fix systray icon size 2023-05-30 16:31:55 +08:00
Lea Anthony 58138ac09b [v3 windows] Initial systray support 2023-05-30 16:31:55 +08:00
Lea Anthony 143f090422 [v3] Use invokeSync for systray methods 2023-05-30 16:31:55 +08:00
Lea Anthony f8f466ba7e [v3 windows] Support irregular shaped windows. Centered option. 2023-05-30 16:31:54 +08:00
Lea Anthony cb28de47f8 [v3 windows] Support irregular shaped windows 2023-05-30 16:31:54 +08:00
stffabi 4ad2475ed6 [v3] Add some missing methods for darwin and windows 2023-05-30 16:31:54 +08:00
Travis McLane 0172078536 [w32] move windows specific code to impl file 2023-05-30 16:31:53 +08:00
Travis McLane 0bb1fb512a [w32] add missing build constraint 2023-05-30 16:31:53 +08:00
Lea Anthony b6940d95a2 [v3 windows] Add frameless resize 2023-05-30 16:31:53 +08:00
stffabi 75f0457375 [v3 windows] Add HiDPI awareness 2023-05-30 16:31:52 +08:00
stffabi ffe31b6265 [v3 windows] Add frameless support 2023-05-30 16:31:52 +08:00
Lea Anthony 8963610722 [v3 windows] Implement getScreen 2023-05-30 16:31:52 +08:00
Lea Anthony 66bfcf0e36 [v3] Ensure impl calls from WebvieWindow are on the main thread. Support size. 2023-05-30 16:31:52 +08:00
Lea Anthony 0b3559abfe [v3] Fix examples 2023-05-30 16:31:51 +08:00
Lea Anthony 773389ee5e [v3] Update examples to use correct options. 2023-05-30 16:31:51 +08:00
Lea Anthony 4c04991d4d [v3] Change WebviewWindow options to be a value, not a pointer. Support Un/Fullscreen. Remove main thread switching. Use parent options instead of local variables. 2023-05-30 16:31:51 +08:00
Lea Anthony d56bb59b72 [v3 Windows] Support application hide/show. Add WebviewWindow.IsVisible(). 2023-05-30 16:31:50 +08:00
Lea Anthony 6e92a4f71e [v3 Windows] Support setMin/MaxSize, setPosition 2023-05-30 16:31:50 +08:00
Lea Anthony 1f6217c0d8 [v3 Windows] Add Support for SetTitle, Center, Un/Minimise/Maximise, IsMin/Maximised, IsNormal, Show/Hide 2023-05-30 16:31:50 +08:00
Lea Anthony 17204bebd0 [v3 Breaking Change] Add NativeWindowHandle method to WebviewWindow. 2023-05-30 16:31:49 +08:00
Lea Anthony 728e2019d8 [v3 windows] Moved w32 from internal to pkg so it may be used by applications 2023-05-30 16:31:49 +08:00
Lea Anthony 7f3fdd6977 [v3 windows] Add WndProcInterceptor for custom message processing 2023-05-30 16:31:49 +08:00
Lea Anthony e8798f8371 [v3 windows] Rename options_windows.go -> options_win.go 2023-05-30 16:31:48 +08:00
Lea Anthony 402b743553 [v3 windows] Add APM Events 2023-05-30 16:31:48 +08:00
Lea Anthony f08ae2fc62 [v3] Update application.On and window.On to return functions that unregister the listener. WebviewWindow.onApplicationEvent is a helper which will manage the unregistering for you on window destroy. 2023-05-30 16:31:48 +08:00
Lea Anthony 178ea9c8c5 [windows] Split out wndProc. Generate windows events, support per-window themes 2023-05-30 16:31:48 +08:00
Lea Anthony 7c63cee9e8 [windows] Support AlwaysOnTop, EnableResize at runtime. Added Solid/Transparent/Translucent options. 2023-05-30 16:31:47 +08:00
stffabi 4a60dfc373 [v3, windows] Add MainThread dispatching and fixes the blocking window 2023-05-30 16:31:47 +08:00
Lea Anthony 829a829cb4 [windows] WIP 2023-05-30 16:31:47 +08:00
Travis McLane 34896ccb4e [darwin] add getPrimaryScreen/getScreens to impl (#2618) 2023-05-30 16:31:46 +08:00
Lea Anthony 5df5eb6a04 Fix module path for non-modified repo 2023-05-30 16:31:46 +08:00
Lea Anthony 31ba36baf3 [windows] Initial commit 2023-05-30 16:31:46 +08:00
Lea Anthony bf10f71760 [windows] Fix paths for wails init 2023-05-30 16:31:45 +08:00
Lea Anthony 8aa61fff6d Intial STATUS.md commit 2023-05-30 16:31:45 +08:00
Misite Bao d3a4d89786 chore: add Prettier as format tool (#2689) 2023-05-30 07:40:54 +10:00
Lea Anthony 84919468ba [v2 docs] Fix cli.mdx 2023-05-27 13:30:24 +10:00
Misite Bao bd5b7e5e3f feat(website): update the Crowdin branch (#2688) 2023-05-27 12:51:43 +10:00
Lea Anthony 4f3dc1b0e1 [v2 docs] Fix changelog + cli options. 2023-05-27 12:49:10 +10:00
Marvin Wendt 65c68301a0 Change style of doctor command (#2660)
* Refactor doctor command

* Refactor doctor command

* Refactor doctor command

* Refactor doctor command

* Added changelog entry
2023-05-26 17:55:53 +10:00
Misite Bao 37e43dabc0 docs: improve documentation (#2686)
* docs: fix changelog format

* fix: fix release tools

* chore: set sync translated documents as a scheduled task
2023-05-26 17:49:50 +10:00
github-actions[bot] ec19458c1b docs: sync translations (#2616)
Co-authored-by: misitebao <misitebao@users.noreply.github.com>
2023-05-25 18:43:31 +10:00
Amin Yahyaabadi 35eb1e0160 fix: avoid app crashing when the Linux GTK key is empty (#2672)
* fix: avoid app crash when the Linux GTK key is empty

Fixes this error:

```
DEBUG | Log dir is: /root/.config/surrealdb_explorer/log.txt

Overriding existing handler for signal 10. Set JSC_SIGNAL_FOR_GC if you want WebKit to use a different signal
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running, locked to thread]:
github.com/wailsapp/wails/v2/internal/frontend/desktop/linux.parseKey({0x0, 0x0})
        /home/aminya/go/pkg/mod/github.com/wailsapp/wails/v2@v2.5.1/internal/frontend/desktop/linux/keys.go:87 +0xa5
github.com/wailsapp/wails/v2/internal/frontend/desktop/linux.acceleratorToGTK(0xc0001c5f20)
        /home/aminya/go/pkg/mod/github.com/wailsapp/wails/v2@v2.5.1/internal/frontend/desktop/linux/keys.go:72 +0x2c
github.com/wailsapp/wails/v2/internal/frontend/desktop/linux.processMenuItem(0x866bc0?, 0xc0001c8a80, 0xc0001c8a80?)
        /home/aminya/go/pkg/mod/github.com/wailsapp/wails/v2@v2.5.1/internal/frontend/desktop/linux/menu.go:159 +0x40b
github.com/wailsapp/wails/v2/internal/frontend/desktop/linux.processSubmenu(0xc0001c8a20, 0x79a2a9?)
        /home/aminya/go/pkg/mod/github.com/wailsapp/wails/v2@v2.5.1/internal/frontend/desktop/linux/menu.go:99 +0xdc
github.com/wailsapp/wails/v2/internal/frontend/desktop/linux.processMenu(0xc00021f6c0, 0x12?)
        /home/aminya/go/pkg/mod/github.com/wailsapp/wails/v2@v2.5.1/internal/frontend/desktop/linux/menu.go:82 +0x46
github.com/wailsapp/wails/v2/internal/frontend/desktop/linux.(*Window).SetApplicationMenu(0xc00021f6c0, 0xc000128dc8)
        /home/aminya/go/pkg/mod/github.com/wailsapp/wails/v2@v2.5.1/internal/frontend/desktop/linux/menu.go:75 +0x1b6
github.com/wailsapp/wails/v2/internal/frontend/desktop/linux.NewWindow(0xc00011ba40, 0x0)
        /home/aminya/go/pkg/mod/github.com/wailsapp/wails/v2@v2.5.1/internal/frontend/desktop/linux/window.go:126 +0x37b
github.com/wailsapp/wails/v2/internal/frontend/desktop/linux.NewFrontend({0x1cea4e8?, 0xc00023b890}, 0xc00011ba40, 0xc000128e40, 0xc0001c8b40, {0x1ce7480?, 0xc000139840})
        /home/aminya/go/pkg/mod/github.com/wailsapp/wails/v2@v2.5.1/internal/frontend/desktop/linux/frontend.go:182 +0x5c5
github.com/wailsapp/wails/v2/internal/frontend/desktop.NewFrontend(...)
        /home/aminya/go/pkg/mod/github.com/wailsapp/wails/v2@v2.5.1/internal/frontend/desktop/desktop_linux.go:16
github.com/wailsapp/wails/v2/internal/app.CreateApp(0xc00011ba40)
        /home/aminya/go/pkg/mod/github.com/wailsapp/wails/v2@v2.5.1/internal/app/app_production.go:84 +0x5a5
github.com/wailsapp/wails/v2/pkg/application.(*Application).Run(0xc000131940)
        /home/aminya/go/pkg/mod/github.com/wailsapp/wails/v2@v2.5.1/pkg/application/application.go:57 +0x29
wails_vue/backend.BootApplication(0xc000131640, 0xc000138a40, 0xc0001c5320, 0xc0001c55c0, 0xc000128b40, 0xc00012ec30, 0xc000131880)
        /home/aminya/Documents/GitHub/teamnoon/SurrealDB-Explorer/backend/Application.go:103 +0x718
reflect.Value.call({0x874160?, 0x1c761f0?, 0xc000138a00?}, {0x8e263d, 0x4}, {0xc0001584d0, 0x7, 0x1c761f0?})
        /usr/local/go/src/reflect/value.go:586 +0xb0b
reflect.Value.Call({0x874160?, 0x1c761f0?, 0x1c761f0?}, {0xc0001584d0?, 0x0?, 0x1c761f0?})
        /usr/local/go/src/reflect/value.go:370 +0xbc
github.com/Envuso/go-ioc-container.(*Invocable).CallMethodWith(0xc000138a00, 0x1c761f0?, {0x0?, 0x1cef290?, 0x8bd180?})
        /home/aminya/go/pkg/mod/github.com/!envuso/go-ioc-container@v0.0.5/invocable.go:149 +0xad
github.com/Envuso/go-ioc-container.(*ContainerInstance).Call(0xc00011c630?, {0x874160?, 0x1c761f0?}, {0x0, 0x0, 0x0})
        /home/aminya/go/pkg/mod/github.com/!envuso/go-ioc-container@v0.0.5/container_invocation.go:30 +0x6c
main.main()
        /home/aminya/Documents/GitHub/teamnoon/SurrealDB-Explorer/main.go:34 +0x112
```

* fix: merge the key length comparison
2023-05-25 18:40:37 +10:00
github-actions[bot] 12a9ff17d6 chore: update sponsors.svg (#2683)
Co-authored-by: leaanthony <leaanthony@users.noreply.github.com>
2023-05-25 17:05:48 +10:00
Lea Anthony a7116ff5e7 [website] Add windows icon troubleshooting guide 2023-05-21 17:55:38 +10:00
Lea Anthony 62d97f85ec v2.5.1 2023-05-16 19:43:41 +10:00
stffabi 496461920f [v2] DevServer improvements and fixes (#2664)
* [assetserver, darwin] Fix copying request headers by using strdup

* [assetserver, linux] Fake some basic http headers for legacy webkit2 versions to support proxying requests to other servers

This fixes the devserver on v2 for newer vite versions that use the custom
scheme.

* [v2, windows] 304 responses are going to hang the WebView2 so prevent them by removing cache related headers in the request.

* [v2, dev] Now uses the custom schemes `wails://` on macOS and Linux for all Vite versions.

Prevent missing reload after fast multiple savings on Linux and Windows.
2023-05-16 09:35:48 +02:00
stffabi 22b53192e6 [v2, webview2loader] Prevent env and registry overrides when using the go loader (#2668) 2023-05-15 21:12:16 +02:00
Lea Anthony c1a0e1338f Add PR template 2023-05-14 08:46:57 +10:00
Lea Anthony 7266f2a78a Add PR template 2023-05-14 08:42:03 +10:00
263 changed files with 17192 additions and 1231 deletions
+37
View File
@@ -0,0 +1,37 @@
# Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
## Type of change
Please delete options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
# How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration using `wails doctor`.
- [ ] Windows
- [ ] macOS
- [ ] Linux
## Test Configuration
Please paste the output of `wails doctor`. If you are unable to run this command, please describe your environment in as much detail as possible.
# Checklist:
- [ ] I have updated `website/src/pages/changelog.mdx` with details of this PR
- [ ] My code follows the general coding style of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
@@ -0,0 +1,37 @@
name: Format Markdown Files
on:
workflow_dispatch:
push:
branches: [master]
jobs:
format_markdown_files:
runs-on: ubuntu-latest
if: github.repository == 'wailsapp/wails'
steps:
- uses: actions/checkout@v3
- name: Setup Nodejs
uses: actions/setup-node@v2
with:
node-version: 18.x
- name: Install Task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Format All Markdown Files
run: task format-all-md
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: "docs: format document"
title: "docs: format document"
body: "- [x] Format all Markdown(x) documents"
branch: chore/format-markdown-files
delete-branch: true
draft: false
@@ -2,6 +2,8 @@ name: Sync Translations
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
sync-translated-documents:
+3
View File
@@ -0,0 +1,3 @@
website
v2
v3
+6
View File
@@ -0,0 +1,6 @@
overrides:
- files:
- "**/*.md"
options:
printWidth: 80
proseWrap: always
+28 -5
View File
@@ -2,8 +2,19 @@
version: "3"
vars:
GREETING: Hello, World!
includes:
website:
taskfile: website
dir: website
v2:
taskfile: v2
dir: v2
optional: true
v3:
taskfile: v3
dir: v3
optional: true
tasks:
contributors:check:
@@ -18,7 +29,19 @@ tasks:
cmds:
- npx -y all-contributors-cli generate
release:
dir: v2/tools/release
format:md:
cmds:
- go run release.go {{.CLI_ARGS}}
- npx prettier --write "**/*.md"
format:
cmds:
- task: format:md
format-all-md:
cmds:
- task: format:md
- task: website:format:md
- task: v2:format:md
# - task: v2:website:format
- task: v3:format:md
# - task: v3:website:format:md
+1
View File
@@ -0,0 +1 @@
website
+6
View File
@@ -0,0 +1,6 @@
overrides:
- files:
- "**/*.md"
options:
printWidth: 80
proseWrap: always
+17
View File
@@ -0,0 +1,17 @@
# https://taskfile.dev
version: "3"
tasks:
release:
dir: tools/release
cmds:
- go run release.go {{.CLI_ARGS}}
format:md:
cmds:
- npx prettier --write "**/*.md"
format:
cmds:
- task: format:md
+49 -39
View File
@@ -14,43 +14,33 @@ import (
)
func diagnoseEnvironment(f *flags.Doctor) error {
if f.NoColour {
pterm.DisableColor()
colour.ColourEnabled = false
}
app.PrintBanner()
pterm.DefaultSection = *pterm.DefaultSection.
WithBottomPadding(0).
WithStyle(pterm.NewStyle(pterm.FgBlue, pterm.Bold))
spinner, _ := pterm.DefaultSpinner.Start("Scanning system - Please wait (this may take a long time)...")
pterm.Println() // Spacer
pterm.DefaultHeader.WithBackgroundStyle(pterm.NewStyle(pterm.BgLightBlue)).WithMargin(10).Println("Wails Doctor")
pterm.Println() // Spacer
spinner, _ := pterm.DefaultSpinner.WithRemoveWhenDone().Start("Scanning system - Please wait (this may take a long time)...")
// Get system info
info, err := system.GetInfo()
if err != nil {
spinner.Fail("Failed.")
return err
}
spinner.Success("Done.")
pterm.DefaultSection.Println("System")
systemTabledata := [][]string{
{"OS", info.OS.Name},
{"Version", info.OS.Version},
{"ID", info.OS.ID},
{"Go Version", runtime.Version()},
{"Platform", runtime.GOOS},
{"Architecture", runtime.GOARCH},
}
err = pterm.DefaultTable.WithData(systemTabledata).Render()
if err != nil {
spinner.Fail()
pterm.Error.Println("Failed to get system information")
return err
}
spinner.Success()
pterm.DefaultSection.Println("Wails")
wailsTableData := [][]string{
wailsTableData := pterm.TableData{
{"Version", app.Version()},
}
@@ -78,41 +68,57 @@ func diagnoseEnvironment(f *flags.Doctor) error {
return err
}
pterm.DefaultSection.Println("System")
systemTabledata := pterm.TableData{
{pterm.Bold.Sprint("OS"), info.OS.Name},
{pterm.Bold.Sprint("Version"), info.OS.Version},
{pterm.Bold.Sprint("ID"), info.OS.ID},
{pterm.Bold.Sprint("Go Version"), runtime.Version()},
{pterm.Bold.Sprint("Platform"), runtime.GOOS},
{pterm.Bold.Sprint("Architecture"), runtime.GOARCH},
}
err = pterm.DefaultTable.WithBoxed().WithData(systemTabledata).Render()
if err != nil {
return err
}
pterm.DefaultSection.Println("Dependencies")
// Output Dependencies Status
var dependenciesMissing = []string{}
var externalPackages = []*packagemanager.Dependency{}
var dependenciesMissing []string
var externalPackages []*packagemanager.Dependency
var dependenciesAvailableRequired = 0
var dependenciesAvailableOptional = 0
dependenciesTableData := [][]string{
dependenciesTableData := pterm.TableData{
{"Dependency", "Package Name", "Status", "Version"},
}
hasOptionalDependencies := false
// Loop over dependencies
for _, dependency := range info.Dependencies {
name := dependency.Name
if dependency.Optional {
name = "*" + name
name = pterm.Gray("*") + name
hasOptionalDependencies = true
}
packageName := "Unknown"
status := "Not Found"
status := pterm.LightRed("Not Found")
// If we found the package
if dependency.PackageName != "" {
packageName = dependency.PackageName
// If it's installed, update the status
if dependency.Installed {
status = "Installed"
status = pterm.LightGreen("Installed")
} else {
// Generate meaningful status text
status = "Available"
status = pterm.LightMagenta("Available")
if dependency.Optional {
dependenciesAvailableOptional++
@@ -133,22 +139,19 @@ func diagnoseEnvironment(f *flags.Doctor) error {
dependenciesTableData = append(dependenciesTableData, []string{name, packageName, status, dependency.Version})
}
err = pterm.DefaultTable.WithHasHeader(true).WithData(dependenciesTableData).Render()
dependenciesTableString, _ := pterm.DefaultTable.WithHasHeader(true).WithData(dependenciesTableData).Srender()
dependenciesBox := pterm.DefaultBox.WithTitleBottomCenter()
if hasOptionalDependencies {
pterm.Println("* - Optional Dependency")
dependenciesBox = dependenciesBox.WithTitle(pterm.Gray("*") + " - Optional Dependency")
}
dependenciesBox.Println(dependenciesTableString)
pterm.DefaultSection.Println("Diagnosis")
// Generate an appropriate diagnosis
if len(dependenciesMissing) == 0 && dependenciesAvailableRequired == 0 {
pterm.Println("Your system is ready for Wails development!")
} else {
pterm.Println("Your system has missing dependencies!")
}
if dependenciesAvailableRequired != 0 {
pterm.Println("Required package(s) installation details: \n" + info.Dependencies.InstallAllRequiredCommand())
}
@@ -157,11 +160,18 @@ func diagnoseEnvironment(f *flags.Doctor) error {
pterm.Println("Optional package(s) installation details: \n" + info.Dependencies.InstallAllOptionalCommand())
}
if len(dependenciesMissing) == 0 && dependenciesAvailableRequired == 0 {
pterm.Success.Println("Your system is ready for Wails development!")
} else {
pterm.Warning.Println("Your system has missing dependencies!")
}
if len(dependenciesMissing) != 0 {
pterm.Println("Fatal:")
pterm.Println("Required dependencies missing: " + strings.Join(dependenciesMissing, " "))
pterm.Println("Please read this article on how to resolve this: https://wails.io/guides/resolving-missing-packages")
}
pterm.Println() // Spacer for sponsor message
return nil
}
-3
View File
@@ -318,9 +318,6 @@ 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...)
+1 -1
View File
@@ -1 +1 @@
v2.5.0
v2.5.1
+5 -7
View File
@@ -106,15 +106,13 @@ func CreateApp(appoptions *options.App) (*App, error) {
}
if frontendDevServerURL != "" {
if os.Getenv("legacyusedevsererinsteadofcustomscheme") != "" {
startURL, err := url.Parse("http://" + devServer)
if err != nil {
return nil, err
}
ctx = context.WithValue(ctx, "starturl", startURL)
_, port, err := net.SplitHostPort(devServer)
if err != nil {
return nil, fmt.Errorf("unable to determine port of DevServer: %s", err)
}
ctx = context.WithValue(ctx, "assetserverport", port)
ctx = context.WithValue(ctx, "frontenddevserverurl", frontendDevServerURL)
externalURL, err := url.Parse(frontendDevServerURL)
@@ -19,6 +19,7 @@ import (
"fmt"
"html/template"
"log"
"net"
"net/url"
"unsafe"
@@ -78,6 +79,10 @@ func NewFrontend(ctx context.Context, appoptions *options.App, myLogger *logger.
if _starturl, _ := ctx.Value("starturl").(*url.URL); _starturl != nil {
result.startURL = _starturl
} else {
if port, _ := ctx.Value("assetserverport").(string); port != "" {
result.startURL.Host = net.JoinHostPort(result.startURL.Host+".localhost", port)
}
var bindings string
var err error
if _obfuscated, _ := ctx.Value("obfuscated").(bool); !_obfuscated {
@@ -78,6 +78,7 @@ import (
"encoding/json"
"fmt"
"log"
"net"
"net/url"
"os"
"runtime"
@@ -149,6 +150,10 @@ func NewFrontend(ctx context.Context, appoptions *options.App, myLogger *logger.
if _starturl, _ := ctx.Value("starturl").(*url.URL); _starturl != nil {
result.startURL = _starturl
} else {
if port, _ := ctx.Value("assetserverport").(string); port != "" {
result.startURL.Host = net.JoinHostPort(result.startURL.Host+".localhost", port)
}
var bindings string
var err error
if _obfuscated, _ := ctx.Value("obfuscated").(bool); !_obfuscated {
+2 -1
View File
@@ -81,7 +81,8 @@ func parseKey(key string) C.guint {
return result
}
// Check for unknown namedkeys
if len(key) > 1 {
// Check if we only have a single character
if len(key) != 1 {
return C.guint(0)
}
keyval := rune(key[0])
@@ -9,6 +9,7 @@ import (
"fmt"
"io"
"log"
"net"
"net/http"
"net/http/httptest"
"net/url"
@@ -92,6 +93,10 @@ func NewFrontend(ctx context.Context, appoptions *options.App, myLogger *logger.
return result
}
if port, _ := ctx.Value("assetserverport").(string); port != "" {
result.startURL.Host = net.JoinHostPort(result.startURL.Host, port)
}
var bindings string
var err error
if _obfuscated, _ := ctx.Value("obfuscated").(bool); !_obfuscated {
@@ -589,8 +594,16 @@ func (f *Frontend) processRequest(req *edge.ICoreWebView2WebResourceRequest, arg
headers = append(headers, fmt.Sprintf("%s: %s", k, strings.Join(v, ",")))
}
code := rw.Code
if code == http.StatusNotModified {
// WebView2 has problems when a request returns a 304 status code and the WebView2 is going to hang for other
// requests including IPC calls.
f.logger.Error("%s: AssetServer returned 304 - StatusNotModified which are going to hang WebView2, changed code to 505 - StatusInternalServerError", uri)
code = http.StatusInternalServerError
}
env := f.chromium.Environment()
response, err := env.CreateWebResourceResponse(rw.Body.Bytes(), rw.Code, http.StatusText(rw.Code), strings.Join(headers, "\n"))
response, err := env.CreateWebResourceResponse(rw.Body.Bytes(), code, http.StatusText(code), strings.Join(headers, "\n"))
if err != nil {
f.logger.Error("CreateWebResourceResponse Error: %s", err)
return
@@ -829,6 +842,12 @@ func coreWebview2RequestToHttpRequest(coreReq *edge.ICoreWebView2WebResourceRequ
}
}
// WebView2 has problems when a request returns a 304 status code and the WebView2 is going to hang for other
// requests including IPC calls.
// So prevent 304 status codes by removing the headers that are used in combinationwith caching.
header.Del("If-Modified-Since")
header.Del("If-None-Match")
method, err := coreReq.GetMethod()
if err != nil {
return nil, fmt.Errorf("GetMethod Error: %s", err)
@@ -4,6 +4,7 @@ package webviewloader
import (
"fmt"
"os"
"path/filepath"
"syscall"
"unsafe"
@@ -14,6 +15,7 @@ import (
func init() {
fmt.Println("DEB | Using go webview2loader")
preventEnvAndRegistryOverrides()
}
type webView2RunTimeType int32
@@ -104,6 +106,8 @@ func createWebViewEnvironmentWithClientDll(lpLibFileName string, runtimeType web
envCompletedCom := combridge.New[iCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler](envCompletedHandler)
defer envCompletedCom.Close()
preventEnvAndRegistryOverrides()
const unknown = 1
hr, _, err := createProc.Call(
uintptr(unknown),
@@ -157,3 +161,16 @@ func (r *environmentCreatedHandler) EnvironmentCompleted(errorCode HRESULT, crea
return HRESULT(windows.S_OK)
}
func preventEnvAndRegistryOverrides() {
// Setting these env variables to empty string also prevents registry overrides because webview2
// checks for existence and not for empty value
os.Setenv("WEBVIEW2_PIPE_FOR_SCRIPT_DEBUGGER", "")
os.Setenv("WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS", "")
os.Setenv("WEBVIEW2_RELEASE_CHANNEL_PREFERENCE", "0")
// The following seems not be be required because those are only used by the webview2loader which
// in this case is implemented on our own. But nevertheless set them to empty to be consistent.
os.Setenv("WEBVIEW2_BROWSER_EXECUTABLE_FOLDER", "")
os.Setenv("WEBVIEW2_USER_DATA_FOLDER", "")
}
+6 -2
View File
@@ -97,13 +97,17 @@ func (d *DevWebServer) Run(ctx context.Context) error {
log.Fatal(err)
}
assetServer, err := assetserver.NewDevAssetServer(assetHandler, wsHandler, bindingsJSON, ctx.Value("assetdir") != nil, myLogger, runtime.RuntimeAssetsBundle)
assetServer, err := assetserver.NewDevAssetServer(assetHandler, bindingsJSON, ctx.Value("assetdir") != nil, myLogger, runtime.RuntimeAssetsBundle)
if err != nil {
log.Fatal(err)
}
d.server.Any("/*", func(c echo.Context) error {
assetServer.ServeHTTP(c.Response(), c.Request())
if c.IsWebSocket() {
wsHandler.ServeHTTP(c.Response(), c.Request())
} else {
assetServer.ServeHTTP(c.Response(), c.Request())
}
return nil
})
+2 -7
View File
@@ -32,7 +32,6 @@ type RuntimeHandler interface {
type AssetServer struct {
handler http.Handler
wsHandler http.Handler
runtimeJS []byte
ipcJS func(*http.Request) []byte
@@ -107,12 +106,8 @@ func (d *AssetServer) AddPluginScript(pluginName string, script string) {
func (d *AssetServer) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
if isWebSocket(req) {
// Forward WebSockets to the distinct websocket handler if it exists
if wsHandler := d.wsHandler; wsHandler != nil {
wsHandler.ServeHTTP(rw, req)
} else {
rw.WriteHeader(http.StatusNotImplemented)
}
// WebSockets are not supported by the AssetServer
rw.WriteHeader(http.StatusNotImplemented)
return
}

Some files were not shown because too many files have changed in this diff Show More