Compare commits

..

4 Commits

Author SHA1 Message Date
Lea Anthony 3b764e8ce4 Fix logger for build type 2024-01-16 21:39:23 +11:00
Lea Anthony 26bb58e128 Moved to file config for watcher 2024-01-16 20:54:57 +11:00
Lea Anthony 0e20677116 Refactored handling of external dev server 2024-01-15 21:59:18 +11:00
Lea Anthony 62c47bd089 Fix external server URL 2024-01-14 20:14:24 +11:00
219 changed files with 4230 additions and 7331 deletions
+24 -27
View File
@@ -298,7 +298,6 @@ import "github.com/wailsapp/wails/v3/pkg/application"
- [func \(w \*WebviewWindow\) Size\(\) \(int, int\)](#WebviewWindow.Size)
- [func \(w \*WebviewWindow\) ToggleDevTools\(\)](#WebviewWindow.ToggleDevTools)
- [func \(w \*WebviewWindow\) ToggleFullscreen\(\)](#WebviewWindow.ToggleFullscreen)
- [func \(w \*WebviewWindow\) ToggleMaximise\(\)](#WebviewWindow.ToggleMaximise)
- [func \(w \*WebviewWindow\) UnFullscreen\(\)](#WebviewWindow.UnFullscreen)
- [func \(w \*WebviewWindow\) UnMaximise\(\)](#WebviewWindow.UnMaximise)
- [func \(w \*WebviewWindow\) UnMinimise\(\)](#WebviewWindow.UnMinimise)
@@ -1206,21 +1205,31 @@ AssetOptions defines the configuration of the AssetServer.
```go
type AssetOptions struct {
// Handler which serves all the content to the WebView.
Handler http.Handler
// FS defines the static assets to be used. A GET request is first tried to be served from this FS. If the FS returns
// `os.ErrNotExist` for that file, the request handling will fallback to the Handler and tries to serve the GET
// request from it.
//
// If set to nil, all GET requests will be forwarded to Handler.
FS fs.FS
// Middleware is a HTTP Middleware which allows to hook into the AssetServer request chain. It allows to skip the default
// request handler dynamically, e.g. implement specialized Routing etc.
// The Middleware is called to build a new `http.Handler` used by the AssetSever and it also receives the default
// handler used by the AssetServer as an argument.
//
// This middleware injects itself before any of Wails internal middlewares.
//
// If not defined, the default AssetServer request chain is executed.
//
// Multiple Middlewares can be chained together with:
// ChainMiddleware(middleware ...Middleware) Middleware
Middleware Middleware
// Handler will be called for every GET request that can't be served from FS, due to `os.ErrNotExist`. Furthermore all
// non GET requests will always be served from this Handler.
//
// If not defined, the result is the following in cases where the Handler would have been called:
// GET request: `http.StatusNotFound`
// Other request: `http.StatusMethodNotAllowed`
Handler http.Handler
// Middleware is HTTP Middleware which allows to hook into the AssetServer request chain. It allows to skip the default
// request handler dynamically, e.g. implement specialized Routing etc.
// The Middleware is called to build a new `http.Handler` used by the AssetSever and it also receives the default
// handler used by the AssetServer as an argument.
//
// If not defined, the default AssetServer request chain is executed.
//
// Multiple Middlewares can be chained together with:
// ChainMiddleware(middleware ...Middleware) Middleware
Middleware Middleware
// External URL can be set to a development server URL so that all requests are forwarded to it. This is useful
// when using a development server like `vite` or `snowpack` which serves the assets on a different port.
@@ -1760,8 +1769,6 @@ type MacTitleBar struct {
UseToolbar bool
// HideToolbarSeparator will hide the toolbar separator
HideToolbarSeparator bool
// ShowToolbarWhenFullscreen will keep the toolbar visible when the window is in fullscreen mode
ShowToolbarWhenFullscreen bool
// ToolbarStyle is the style of toolbar to use
ToolbarStyle MacToolbarStyle
}
@@ -3718,16 +3725,6 @@ func (w *WebviewWindow) ToggleFullscreen()
ToggleFullscreen toggles the window between fullscreen and normal
<a name="WebviewWindow.ToggleMaximise"></a>
### func \(\*WebviewWindow\) [ToggleMaximise](https://github.com/wailsapp/wails/blob/master/v3/pkg/application/webview_window.go#L720)
```go
func (w *WebviewWindow) ToggleMaximise()
```
ToggleMaximise toggles the window between maximised and normal
<a name="WebviewWindow.UnFullscreen"></a>
### func \(\*WebviewWindow\) [UnFullscreen](https://github.com/wailsapp/wails/blob/master/v3/pkg/application/webview_window.go#L859)
-7
View File
@@ -21,12 +21,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [darwin] add Event ApplicationShouldHandleReopen to be able to handle dock icon click by @5aaee9 in [#2991](https://github.com/wailsapp/wails/pull/2991)
- [darwin] add getPrimaryScreen/getScreens to impl by @tmclane in [#2618](https://github.com/wailsapp/wails/pull/2618)
- [darwin] add option for showing the toolbar in fullscreen mode on macOS by [@fbbdev](https://github.com/fbbdev) in [#3282](https://github.com/wailsapp/wails/pull/3282)
- [linux] add onKeyPress logic to convert linux keypress into an accelerator @[Atterpac](https://github.com/Atterpac) in[#3022](https://github.com/wailsapp/wails/pull/3022])
- [linux] add task `run:linux` by [@marcus-crane](https://github.com/marcus-crane) in [#3146](https://github.com/wailsapp/wails/pull/3146)
- export `SetIcon` method by @almas1992 in [PR](https://github.com/wailsapp/wails/pull/3147)
- Improve `OnShutdown` by @almas1992 in [PR](https://github.com/wailsapp/wails/pull/3189)
- restore `ToggleMaximise` method in `Window` interface by [@fbbdev](https://github.com/fbbdev) in [#3281](https://github.com/wailsapp/wails/pull/3281)
### Fixed
@@ -39,11 +37,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed bug for linux in doctor in the event user doesn't have proper drivers installed. Added by [@pylotlight](https://github.com/pylotlight) in [PR](https://github.com/wailsapp/wails/pull/3032)
- Fix dpi scaling on start up (windows). Changed by @almas1992 in [PR](https://github.com/wailsapp/wails/pull/3145)
- Fix replace line in `go.mod` to use relative paths. Fixes Windows paths with spaces - @leaanthony.
- Fix MacOS systray click handling when no attached window by [thomas-senechal](https://github.com/thomas-senechal) in PR [#3207](https://github.com/wailsapp/wails/pull/3207)
- Fix failing Windows build due to unknown option by [thomas-senechal](https://github.com/thomas-senechal) in PR [#3208](https://github.com/wailsapp/wails/pull/3208)
- Fix wrong baseURL when open window twice by @5aaee9 in PR [#3273](https://github.com/wailsapp/wails/pull/3273)
- Fix ordering of if branches in `WebviewWindow.Restore` method by [@fbbdev](https://github.com/fbbdev) in [#3279](https://github.com/wailsapp/wails/pull/3279)
- Correctly compute `startURL` across multiple `GetStartURL` invocations when `FRONTEND_DEVSERVER_URL` is present. [#3299](https://github.com/wailsapp/wails/pull/3299)
### Changed
@@ -164,7 +164,7 @@ Example:
2: 4021313248,
},
Assets: application.AssetOptions{
Handler: application.AssetFileServerFS(assets),
FS: assets,
},
Mac: application.MacOptions{
ApplicationShouldTerminateAfterLastWindowClosed: true,
@@ -15,8 +15,8 @@ posts before creating new ones. Here are the different ways to provide feedback:
- Open a [PR](https://github.com/wailsapp/wails/pulls) with the title `[v3 alpha test] <description of bug>`.
- Please include a link to the PR in your post.
!!! warning
*Remember*, unexpected behaviour isn't necessarily a bug - it might just not do what you expect it to do. Use [Suggestions](#suggestions) for this.
!!! warning
*Remember*, unexpected behaviour isn't necessarily a bug - it might just not do what you expect it to do. Use [Suggestions](#suggestions) for this.
=== "Fixes"
+1 -1
View File
@@ -32,7 +32,7 @@ Please note that this is an alpha version of Wails v3. Features may be added, re
## Feedback and Contributions
Your feedback is vital to making Wails better. If you encounter any issues or have suggestions, please use our [Feedback process](getting-started/feedback.md). Contributions to the project are also welcome!
Your feedback is vital to making Wails better. If you encounter any issues or have suggestions, please let us know through our [GitHub repository](https://github.com/wailsapp/wails). Contributions to the project are also welcome!
Thank you for trying out Wails v3 Alpha!
-57
View File
@@ -1,57 +0,0 @@
# Runtime
The Wails runtime is the standard library for Wails applications. It provides a number of features that may
be used in your applications, including:
- Window management
- Dialogs
- Browser integration
- Clipboard
- Frameless dragging
- Tray icons
- Menu management
- System information
- Events
- Calling Go code
- Context Menus
- Screens
- WML (Wails Markup Language)
The runtime is required for integration between Go and the frontend. There are 2 ways to integrate the runtime:
- Using the `@wailsio/runtime` package
- Using a pre-built version of the runtime
## Using the `@wailsio/runtime` package
The `@wailsio/runtime` package is a JavaScript package that provides access to the Wails runtime. It is used in by all
the standard templates and is the recommended way to integrate the runtime into your application. By using the package,
you will only include the parts of the runtime that you use.
The package is available on npm and can be installed using:
```shell
npm install --save @wailsio/runtime
```
## Using a pre-built version of the runtime
Some projects will not use a Javascript bundler and may prefer to use a pre-built version of the runtime. This is
the default for the examples in `v3/examples`. The pre-built version of the runtime can be generated using the
following command:
```shell
wails3 generate runtime
```
This will generate a `runtime.js` (and `runtime.debug.js`) file in the current directory.
This file can be used by your application by adding it to your assets directory (normally `frontend/dist`) and then including it in your HTML:
```html
<html>
<head>
<script src="/runtime.js"></script>
</head>
<!--- ... -->
</>
```
+20 -38
View File
@@ -10,36 +10,7 @@ we are aiming to achieve. These are subject to change.
## Alpha milestones
### Current: Alpha 5
#### Goals
The Alpha 5 cycle aims to bring Linux to parity (Alpha 4)with the other platforms.
#### How Can I Help?
!!! note
Report any issues you find using [this guide](./getting-started/feedback.md).
- Test all the things on Linux!
#### Status
Linux examples:
- :material-check-bold: - Working
- :material-minus: - Partially working
- :material-close: - Not working
{{ read_csv("alpha5.csv") }}
## Upcoming milestones
## Alpha 6
## Previous milestones
### Alpha 4 - Completed 2024-02-01
### Current: Alpha 4
#### Goals
@@ -66,7 +37,7 @@ The `wails package` command should do the following:
Report any issues you find using [this guide](./getting-started/feedback.md).
- Install the CLI using the instructions [here](./getting-started/installation.md).
- Install the CLI using the instructions [here](./getting-started/installation).
- Run `wails3 doctor` and ensure that all dependencies are installed.
- Generate a new project using `wails3 init`.
@@ -97,13 +68,6 @@ Basically, try to break it and let us know if you find any issues! :smile:
{{ read_csv("alpha4-wails3-dev.csv") }}
- Windows is partially working:
- Frontend changes work as expected
- Go changes cause the application to be built twice
- Mac is partially working:
- Frontend changes work as expectedFrontend changes work as expected
- Go changes terminates the vite process
`wails3 package` command:
@@ -164,6 +128,24 @@ Examples:
- [ ] All examples working on Linux
## Upcoming milestones
### Alpha 4
#### Goals
### Alpha 5
#### Goals
- [ ] Keyboard shortcuts
- Window Level shortcuts
- Application Level shortcuts (applies to all windows)
- Ensure Keydown/Keyup events are sent to JS if not handled by Go
## Previous milestones
### Alpha 2
#### Goals
+2 -2
View File
@@ -25,7 +25,7 @@ func main() {
app := application.New(application.Options{
Name: "Multi Window Demo",
Assets: application.AssetOptions{
Handler: application.AssetFileServerFS(assets),
FS: assets,
},
})
@@ -243,7 +243,7 @@ func main() {
Name: "Events Demo",
Description: "A demo of the Events API",
Assets: application.AssetOptions{
Handler: application.AssetFileServerFS(assets),
FS: assets,
},
Mac: application.MacOptions{
ApplicationShouldTerminateAfterLastWindowClosed: true,
@@ -141,7 +141,7 @@ window.go.main = {
2: 4021313248,
},
Assets: application.AssetOptions{
Handler: application.AssetFileServerFS(assets),
FS: assets,
},
Mac: application.MacOptions{
ApplicationShouldTerminateAfterLastWindowClosed: true,
+2 -2
View File
@@ -24,7 +24,7 @@ func main() {
app := application.New(application.Options{
Name: "多窗口演示",
Assets: application.AssetOptions{
Handler: application.AssetFileServerFS(assets),
FS: assets,
},
})
@@ -233,7 +233,7 @@ func main() {
Name: "Events Demo",
Description: "Events API演示",
Assets: application.AssetOptions{
Handler: application.AssetFileServerFS(assets),
FS: assets,
},
Mac: application.MacOptions{
ApplicationShouldTerminateAfterLastWindowClosed: true,
-2
View File
@@ -150,8 +150,6 @@ nav:
# - Links: community/links.md
- Your First Application: getting-started/your-first-app.md
- Next Steps: getting-started/next-steps.md
- Learn More:
- Runtime: learn/runtime.md
- Feedback: getting-started/feedback.md
- Feedback: getting-started/feedback.md
- What's New in v3?: whats-new.md
+16 -16
View File
@@ -1,16 +1,16 @@
" ",Linux,Notes
binding," "," "
build," "," "
clipboard," "," "
context menus," "," "
dialogs," "," "
drag-n-drop," "," "
events,:material-check-bold:," "
frameless," "," "
keybindings," "," "
plain," "," "
screen," "," "
systray," "," "
video," "," "
window," "," "
wml," "," "
" ",Mac,Windows,Linux
binding,:material-check-bold:,:material-check-bold:,:material-check-bold:
build,:material-check-bold:,:material-check-bold:,:material-check-bold:
clipboard,:material-check-bold:,:material-check-bold:,:material-check-bold:
context menus,:material-check-bold:,:material-check-bold:,:material-check-bold:
dialogs,:material-check-bold:,:material-check-bold:,:material-check-bold:
drag-n-drop,:material-check-bold:,:material-check-bold:,:material-check-bold:
events,:material-check-bold:,:material-check-bold:,:material-minus:
frameless,:material-check-bold:,:material-check-bold:,:material-check-bold:
keybindings,:material-check-bold:,:material-check-bold:,:material-minus:
plain,:material-check-bold:,:material-check-bold:,:material-check-bold:
screen,:material-check-bold:,:material-check-bold:,:material-check-bold:
systray,:material-check-bold:,:material-check-bold:,:material-check-bold:
video,:material-check-bold:,:material-check-bold:,:material-check-bold:
window,:material-check-bold:,:material-check-bold:,:material-minus:
wml,:material-check-bold:,:material-check-bold:,:material-check-bold:
1 Mac Notes Windows Linux
2 binding :material-check-bold: :material-check-bold: :material-check-bold:
3 build :material-check-bold: :material-check-bold: :material-check-bold:
4 clipboard :material-check-bold: :material-check-bold: :material-check-bold:
5 context menus :material-check-bold: :material-check-bold: :material-check-bold:
6 dialogs :material-check-bold: :material-check-bold: :material-check-bold:
7 drag-n-drop :material-check-bold: :material-check-bold: :material-check-bold:
8 events :material-check-bold: :material-check-bold: :material-check-bold: :material-minus:
9 frameless :material-check-bold: :material-check-bold: :material-check-bold:
10 keybindings :material-check-bold: :material-check-bold: :material-minus:
11 plain :material-check-bold: :material-check-bold: :material-check-bold:
12 screen :material-check-bold: :material-check-bold: :material-check-bold:
13 systray :material-check-bold: :material-check-bold: :material-check-bold:
14 video :material-check-bold: :material-check-bold: :material-check-bold:
15 window :material-check-bold: :material-check-bold: :material-minus:
16 wml :material-check-bold: :material-check-bold: :material-check-bold:
@@ -1,5 +1,5 @@
Scenario,Windows,Mac,Linux
Same package,:material-check-bold,:material-check-bold:,:material-check-bold:
Same package,:material-check-bold:,:material-check-bold:,:material-check-bold:
Different package,:material-check-bold:,:material-check-bold:,:material-check-bold:
Different package with same name,"on hold","on hold","on hold"
Containing another struct from same package,:material-check-bold:,:material-check-bold:,:material-check-bold:
1 Scenario Windows Mac Linux
2 Same package :material-check-bold :material-check-bold: :material-check-bold: :material-check-bold:
3 Different package :material-check-bold: :material-check-bold: :material-check-bold:
4 Different package with same name on hold on hold on hold
5 Containing another struct from same package :material-check-bold: :material-check-bold: :material-check-bold:
+1 -1
View File
@@ -1,2 +1,2 @@
" ",Mac,Windows,Linux
`wails3 dev`,:material-minus:,:material-minus:," "
`wails3 dev`," "," "," "
1 Mac Windows Linux
2 `wails3 dev` :material-minus: :material-minus:
@@ -1,4 +1,5 @@
" ",Mac,Windows,Linux
Standard Executable,:material-check-bold:,:material-check-bold:,:material-check-bold:
macOS Application Bundle,:material-check-bold:,:material-cancel:,:material-cancel:
NSIS,:material-cancel:,:material-check-bold:,:material-cancel:
Standard Executable," "," "," "
macOS Application Bundle," ",:material-cancel:,:material-cancel:
NSIS," "," "," "
macOS DMG," ",:material-cancel:,:material-cancel:
1 Mac Windows Linux
2 Standard Executable :material-check-bold: :material-check-bold: :material-check-bold:
3 macOS Application Bundle :material-check-bold: :material-cancel: :material-cancel:
4 NSIS :material-cancel: :material-check-bold: :material-cancel:
5 macOS DMG :material-cancel: :material-cancel:
-16
View File
@@ -1,16 +0,0 @@
Example,Linux
binding," "
build,:material-check-bold:
clipboard,:material-check-bold:
context menus,:material-minus:
dialogs,:material-minus:
drag-n-drop," "
events,:material-check-bold:
frameless,:material-check-bold:
keybindings,:material-check-bold:
plain," "
screen,:material-check-bold:
systray,:material-check-bold:
video,:material-check-bold:
window,:material-check-bold:
wml,:material-check-bold:
1 Example Linux
2 binding
3 build :material-check-bold:
4 clipboard :material-check-bold:
5 context menus :material-minus:
6 dialogs :material-minus:
7 drag-n-drop
8 events :material-check-bold:
9 frameless :material-check-bold:
10 keybindings :material-check-bold:
11 plain
12 screen :material-check-bold:
13 systray :material-check-bold:
14 video :material-check-bold:
15 window :material-check-bold:
16 wml :material-check-bold:
+1 -3
View File
@@ -1,8 +1,6 @@
module github.com/wailsapp/wails/v2
go 1.21
toolchain go1.22.0
go 1.20
require (
github.com/Masterminds/semver v1.5.0
+3 -3
View File
@@ -4,10 +4,10 @@ package linux
type WebviewGpuPolicy int
const (
// WebviewGpuPolicyOnDemand Hardware acceleration is enabled/disabled as request by web contents.
WebviewGpuPolicyOnDemand WebviewGpuPolicy = iota
// WebviewGpuPolicyAlways Hardware acceleration is always enabled.
WebviewGpuPolicyAlways
WebviewGpuPolicyAlways WebviewGpuPolicy = iota
// WebviewGpuPolicyOnDemand Hardware acceleration is enabled/disabled as request by web contents.
WebviewGpuPolicyOnDemand
// WebviewGpuPolicyNever Hardware acceleration is always disabled.
WebviewGpuPolicyNever
)
-2
View File
@@ -46,7 +46,6 @@ func main() {
generate.NewSubCommandFunction("constants", "Generate JS constants from Go", commands.GenerateConstants)
generate.NewSubCommandFunction(".desktop", "Generate .desktop file", commands.GenerateDotDesktop)
generate.NewSubCommandFunction("appimage", "Generate Linux AppImage", commands.GenerateAppImage)
generate.NewSubCommandFunction("runtime", "Generate the latest compiled runtime", commands.GenerateRuntime)
plugin := app.NewSubCommand("plugin", "Plugin tools")
//plugin.NewSubCommandFunction("list", "List plugins", commands.PluginList)
@@ -55,7 +54,6 @@ func main() {
tool := app.NewSubCommand("tool", "Various tools")
tool.NewSubCommandFunction("checkport", "Checks if a port is open. Useful for testing if vite is running.", commands.ToolCheckPort)
tool.NewSubCommandFunction("watcher", "Watches files and runs a command when they change", commands.Watcher)
tool.NewSubCommandFunction("cp", "Copy files", commands.Cp)
app.NewSubCommandFunction("version", "Print the version", commands.Version)
-1
View File
@@ -80,7 +80,6 @@
<input autofocus autocomplete="off" class="input" id="name" type="text"/>
<button class="btn" onclick="greet()">Greet</button>
</div>
<script src='runtime.js'></script>
<script src='bindings_main.js'></script>
<script>
let resultText = "";

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