Create desktop apps using Go and Web Technologies.


Build desktop applications using Go & Web Technologies.

CodeFactor CodeFactor Awesome Release Pipelines

The traditional method of providing web interfaces to Go programs is via a built-in web server. Wails offers a different approach: it provides the ability to wrap both Go code and a web frontend into a single binary. Tools are provided to make this easy for you by handling project creation, compilation and bundling. All you have to do is get creative!

The official docs can be found at https://wails.app.

Features

  • Use standard Go for the backend
  • Use any frontend technology to build your UI
  • Quickly create Vue, Vuetify or React frontends for your Go programs
  • Expose Go methods/functions to the frontend via a single bind command
  • Uses native rendering engines - no embedded browser
  • Shared events system
  • Native file dialogs
  • Powerful cli tool
  • Multiplatform

Sponsors

This project is supported by these kind people / companies:

Installation

Wails uses cgo to bind to the native rendering engines so a number of platform dependent libraries are needed as well as an installation of Go. The basic requirements are:

  • Go 1.16
  • npm

MacOS

Make sure you have the xcode command line tools installed. This can be done by running:

xcode-select --install

Linux

Debian/Ubuntu

sudo apt install libgtk-3-dev libwebkit2gtk-4.0-dev

Debian: 8, 9, 10

Ubuntu: 16.04, 18.04, 19.04

Also succesfully tested on: Zorin 15, Parrot 4.7, Linuxmint 19, Elementary 5, Kali, Neon, Pop!_OS

Arch Linux / ArchLabs / Ctlos Linux

sudo pacman -S webkit2gtk gtk3

Also succesfully test on: Manjaro & ArcoLinux

Centos

sudo yum install webkitgtk3-devel gtk3-devel

CentOS 6, 7

Fedora

sudo yum install webkit2gtk3-devel gtk3-devel

Fedora 29, 30

VoidLinux & VoidLinux-musl

xbps-install gtk+3-devel webkit2gtk-devel

Gentoo

sudo emerge gtk+:3 webkit-gtk

Windows

Windows requires gcc and related tooling. The recommended download is from http://tdm-gcc.tdragon.net/download. Once this is installed, you are good to go.

Installation

Ensure Go modules are enabled: GO111MODULE=on and go/bin is in your PATH variable.

Installation is as simple as running the following command:

go get -u github.com/wailsapp/wails/cmd/wails

Next Steps

It is recommended at this stage to read the comprehensive documentation at https://wails.app.

FAQ

  • Is this an alternative to Electron?

    Depends on your requirements. It's designed to make it easy for Go programmers to make lightweight desktop applications or add a frontend to their existing applications. Whilst Wails does not currently offer hooks into native elements such as menus, this may change in the future.

  • Who is this project aimed at?

    Go programmers who want to bundle an HTML/JS/CSS frontend with their applications, without resorting to creating a server and opening a browser to view it.

  • What's with the name?

    When I saw WebView, I thought "What I really want is tooling around building a WebView app, a bit like Rails is to Ruby". So initially it was a play on words (Webview on Rails). It just so happened to also be a homophone of the English name for the Country I am from. So it stuck.

Contributors

Special Mentions

Without the following people, this project would never have existed:

  • Dustin Krysak - His support and feedback has been immense. More patience than you can throw a stick at (Not long now Dustin!).
  • Serge Zaitsev - Creator of Webview which Wails uses for the windowing.
  • Byron - At times, Byron has single handedly kept this project alive. Without his incredible input, we never would have got to v1.

This project was mainly coded to the following albums:

Licensing

FOSSA Status

Special Thanks


A *huge* thanks to Pace for sponsoring the project and helping the efforts to get Wails ported to Apple Silicon!

If you are looking for a Project Management tool that's powerful but quick and easy to use, check them out!

A special thank you to JetBrains for donating licenses to us!

Please click the logo to let them know your appreciation!

Owner
Wails
A Framework for building applications using Go and Web Technologies
Wails
Comments
  • [v2] Monteray (MacOS 12.0.1) Compatibility Issues

    [v2] Monteray (MacOS 12.0.1) Compatibility Issues

    Description When using Dialogs on Mac Monteray a warning popup saying the open failed, (this happens both with OpenFileDialog and OpenDirectoryDialog) error output:

    021-11-11 11:39:06.158 waterfall-dev-darwin-arm64[4414:100468] *** Assertion failure in -[NSOpenPanel beginServicePanel:asyncExHandler:], NSVBOpenAndSavePanels.m:1907
    2021-11-11 11:39:06.159 waterfall-dev-darwin-arm64[4414:100468] -[NSSavePanel beginSheetModalForWindow:completionHandler:]_block_invoke caught non-fatal NSInternalInconsistencyException '<NSOpenPanel: 0x135036f40> is attempting to advance this Open/Save panel to run phase while another self.advanceToRunPhaseCompletionHandler is in waiting for a previous attempt. An Open/Save panel cannot start to advance more than once.' with user dictionary {
        NSAssertFile = "NSVBOpenAndSavePanels.m";
        NSAssertLine = 1907;
    } and backtrace (
            0   CoreFoundation                      0x00000001b0c2c12c __exceptionPreprocess + 240
            1   libobjc.A.dylib                     0x00000001b097d808 objc_exception_throw + 60
            2   Foundation                          0x00000001b1b58324 -[NSCalendarDate initWithCoder:] + 0
            3   AppKit                              0x00000001b412ac90 -[NSSavePanel beginServicePanel:asyncExHandler:] + 512
            4   AppKit                              0x00000001b412c140 -[NSSavePanel runModal] + 332
            5   waterfall-dev-darwin-arm64          0x0000000105696478 __41-[WailsContext OpenFileDialog:::::::::::]_block_invoke.328 + 36
            6   libdispatch.dylib                   0x00000001b0920e60 _dispatch_call_block_and_release + 32
            7   libdispatch.dylib                   0x00000001b0922bac _dispatch_client_callout + 20
            8   libdispatch.dylib                   0x00000001b09310ac _dispatch_main_queue_callback_4CF + 944
            9   CoreFoundation                      0x00000001b0bede60 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
            10  CoreFoundation                      0x00000001b0bab820 __CFRunLoopRun + 2540
            11  CoreFoundation                      0x00000001b0baa694 CFRunLoopRunSpecific + 600
            12  HIToolbox                           0x00000001b9720990 RunCurrentEventLoopInMode + 292
            13  HIToolbox                           0x00000001b9720704 ReceiveNextEventCommon + 552
            14  HIToolbox                           0x00000001b97204c4 _BlockUntilNextEventMatchingListInModeWithFilter + 72
            15  AppKit                              0x00000001b36ffaec _DPSNextEvent + 844
            16  AppKit                              0x00000001b36fe390 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1332
            17  AppKit                              0x00000001b36f03b0 -[NSApplication run] + 596
            18  waterfall-dev-darwin-arm64          0x000000010569382c Run + 272
            19  waterfall-dev-darwin-arm64          0x0000000105691430 _cgo_43b532242a4e_Cfunc_Run + 36
            20  waterfall-dev-darwin-arm64          0x0000000105008afc runtime.asmcgocall + 124
    )
    
    

    To Reproduce Steps to reproduce the behaviour:

    I've created a repo, that fails for me on my mac, but works on windows https://github.com/KoduIsGreat/wails-v2-mac-os-dialog-issue

    1. Clone repo
    2. run wails dev
    3. Click on the greet button
    4. See error

    Expected behaviour The dialog should open.

    Screenshots If applicable, add screenshots to help explain your problem. Screen Shot 2021-11-11 at 11 39 35 AM

    System Details Wails CLI v2.0.0-beta.20

    Scanning system - Please wait (this may take a long time)...Done.

    System

    OS: MacOS Version: 12.0.1 ID: 199506 Go Version: go1.17.2 Platform: darwin Architecture: arm64

    Additional context Add any other context about the problem here.

  • [v2] Windows: Title bar in color of system theme (dark, light)

    [v2] Windows: Title bar in color of system theme (dark, light)

    Is your feature request related to a problem? Please describe. I use Windows with dark system theme. The title bar of an Wails applications stays light.

    Describe the solution you'd like On dark theme, the title bar should be dark as well. Ideally that switch happens automatically, even when the application runs.

  • Add garble support

    Add garble support

    This PR adds support for the garble obfuscation tool. It generates different bindings in the wailsjs directory to support this.

    Fixes #1634

    CC @osbornnnnn @aivaki

  • Cannot set size of window on Ubuntu 22.04 (heigh and width is 0)

    Cannot set size of window on Ubuntu 22.04 (heigh and width is 0)

    Description

    When running wails, both in dev and build mode on Ubuntu, the height and width are zero. I ran the same exact code on MacOS and it works.

    It's stuck at (seemingly) 0 width and 0 height. If you pass it the Fullscreen argument in app initialization, or call runtime.WindowFullscreen(ctx) from go, you still start off with 0 widht and 0 height, but it becomes resizable via the GUI.

    OS Version:

    Distributor ID:	Ubuntu
    Description:	Ubuntu 22.04 LTS
    Release:	22.04
    Codename:	jammy
    

    To Reproduce

    Initialize project: wails init -n wails_issue_repro -t react-ts Run wails dev or run wails build and execute build executable

    Expected behaviour

    Window respects size of initial app config and is programatically resizable.

    Screenshots

    image

    Attempted Fixes

    Search through github and did not find any fixes or same issues

    System Details

    ~/tmp/wails-issue-repro/wails_issue_repro$  wails doctor
    Wails CLI v2.0.0-beta.38
    
    
    Scanning system - Please wait (this may take a long time)...Done.
    
    System
    ------
    OS:		Ubuntu
    Version: 	22.04
    ID:		ubuntu
    Go Version:	go1.18.1
    Platform:	linux
    Architecture:	amd64
    
    Wails
    ------
    Version: 		v2.0.0-beta.38
    Package Manager: 	apt
    
    Dependency	Package Name		Status		Version
    ----------	------------		------		-------
    *docker		docker.io		Installed	20.10.17
    gcc		build-essential		Installed	11.2.0
    libgtk-3	libgtk-3-dev		Installed	3.24.33-1ubuntu2
    libwebkit	libwebkit2gtk-4.0-dev	Installed	2.36.3-0ubuntu0.22.04.1
    npm		npm			Installed	8.5.1~ds-1
    *nsis		nsis			Installed	v3.08-2
    pkg-config	pkg-config		Installed	0.29.2
    
    * - Optional Dependency
    
    Diagnosis
    ---------
    Your system is ready for Wails development!
    
    
    If Wails is useful to you or your company, please consider sponsoring the project:
    https://github.com/sponsors/leaanthony
    

    Additional context

    No response

  • Cannot start wails + create-react-app

    Cannot start wails + create-react-app

    Description I really don't know if this is a bug or simply wails does not supports react

    To Reproduce Steps to reproduce the behaviour:

    1. Init a wails project
    2. Create a react app in the frontend folder
    3. Add frontend build as assetdir in wails.json
    4. Add npm install as frontend:install
    5. Add npm run build as frontend:dev/frontend:build
    6. Executewails dev and wait or wails build an open the application

    Expected behaviour A correct opening of the application

    Screenshots If applicable, add screenshots to help explain your problem.

    System Details (running wails doctor) System

    OS: MacOS Version: 11.6 ID: 199506 Go Version: go1.17.2 Platform: darwin Architecture: amd64

    Additional context This is what I get when running wails dev (I see the same error when starting the application after wails build

    Executing: go mod tidy
    Executing: wails generate module
    Running frontend dev command: 'npm run build'
    Building application for development...
    Installing frontend dependencies: Done.
    Compiling frontend: 
    > [email protected] build
    > react-scripts build
    
    Creating an optimized production build...
    Compiled successfully.
    
    File sizes after gzip:
    
      41.33 KB  build/static/js/2.c2ca528f.chunk.js
      1.62 KB   build/static/js/3.1ef4b814.chunk.js
      1.16 KB   build/static/js/runtime-main.ff5ca5cf.js
      588 B     build/static/js/main.044cc9db.chunk.js
      531 B     build/static/css/main.8c8b27cf.chunk.css
    
    The project was built assuming it is hosted at /.
    You can control this with the homepage field in your package.json.
    
    The build folder is ready to be deployed.
    You may serve it with a static server:
    
      npm install -g serve
      serve -s build
    
    Find out more about deployment here:
    
      https://cra.link/deployment
    
    Done.
    Compiling application: Dev command exited!
    Done.
    
    DEB | [DesktopAssetServer] Loading assets from: %PROJECTPATH%/frontend/build
    panic: runtime error: index out of range [0] with length 0
    
    goroutine 1 [running, locked to thread]:
    github.com/wailsapp/wails/v2/internal/frontend/assetserver.PathToIndexHTML({0xc000307ce0})
            %USERPATH%/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/assetserver/assetserver_desktop.go:84 +0x156
    github.com/wailsapp/wails/v2/internal/frontend/assetserver.processAssets({0xc000307ce0})
            %USERPATH%/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/assetserver/assetserver_desktop.go:95 +0x39
    github.com/wailsapp/wails/v2/internal/frontend/assetserver.(*DesktopAssetServer).init(...)
            %USERPATH%/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/assetserver/assetserver_desktop.go:105
    github.com/wailsapp/wails/v2/internal/frontend/assetserver.NewDesktopAssetServer({0x4567200, 0xc0001eb9b0}, {0x4558c80}, {0xc000310000, 0x6f})
            %USERPATH%/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/assetserver/assetserver_desktop.go:47 +0x2d2
    github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin.NewFrontend({0x4567200, 0xc0001eb9b0}, 0xc0001ce0c0, 0xc0000bcb10, 0xc0000ce500, {0x455e160, 0xc0001eb9e0})
            %USERPATH%/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/darwin/frontend.go:84 +0x1cb
    github.com/wailsapp/wails/v2/internal/frontend/desktop.NewFrontend(...)
            %USERPATH%/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/frontend/desktop/desktop_darwin.go:18
    github.com/wailsapp/wails/v2/internal/appng.CreateApp(0xc0001ce0c0)
            %USERPATH%/go/pkg/mod/github.com/wailsapp/wails/[email protected]/internal/appng/app_dev.go:118 +0x6cb
    github.com/wailsapp/wails/v2.Run(0xc0000001a0)
            %USERPATH%/go/pkg/mod/github.com/wailsapp/wails/[email protected]/wails.go:19 +0x19
    main.main()
            %USERPATH%/Documents/golang/provoon/main.go:26 +0x385
    Watching (sub)/directory: %USERPATH%/Documents/golang/provoon
    Using Dev Server URL: http://localhost:34115
    Using reload debounce setting of 100 milliseconds
    ^C
    Caught quit
    Development mode exited
    
    If Wails is useful to you or your company, please consider sponsoring the project:
    https://github.com/sponsors/leaanthony
    

    Thanks in advance for your help, I really appreciate your work and love this project. I'll surely make a react template after this issue has been solved

  • Wails apps not displaying gui

    Wails apps not displaying gui

    Description

    As of yesterday morning I am no longer able to see any wails guis this is the case with my own app and also the Wally app for my keyboard

    To Reproduce Attempt to run the application you will be presented with a black screen

    If run from command line I get this message Overriding existing handler for signal 10. Set JSC_SIGNAL_FOR_GC if you want WebKit to use a different signal Control

    Expected behaviour I expect to see the gui

    Screenshots This is a screen shot of wally running which ran just fine the other day wally

    If running from cli you will see this message

    Overriding existing handler for signal 10. Set JSC_SIGNAL_FOR_GC if you want WebKit to use a different signal Control

    System Details

    | Name | Value | | ----- | ----- | | Wails Version | v1.16.0 | | Go Version | go1.16.3 | | Platform | linux | | Arch | amd64 | | GO111MODULE | (Set) | | GCC | 10.2.0 | | Npm | 7.8.0 | | Node | v15.14.0 | | Distro |Manjaro 21.0.1 | |Kernel |5.10.28| |Shell |Fish 3.2.0-60| |Windows Manager | I3 | |Processor |Ryzen 7 x1700| |Memory |DDR 4 32GB 2400MHz|

    Additional context Pretty straight forward "It don't work" it is possible that it is a problem with webkit.

  • Models  are not generated in Models.ts for output types

    Models are not generated in Models.ts for output types

    ##################################################### If you have a technical issue, please do not open a bug this way! Please use the wails issue command! If you do not do this then the issue may be closed automatically.

    NOTE: If your bug is related to Windows, make sure you read the Windows Developer Guide #####################################################

    Description As discussed on the discussion board here: https://github.com/wailsapp/wails/discussions/828#discussioncomment-1643354 it looks like the models are not generated for output types. Also if one access a list of objects via JavaScript it just returns plain objects. Methods on the JavaScript Objects will not be returned. Also shown in the discussion above.

    To Reproduce Steps to reproduce the behaviour: https://github.com/wailsapp/wails/discussions/828#discussioncomment-1643354

    Expected behaviour Models should be generated. And Methods on the Models should also be available by JavaScript.

    Screenshots If applicable, add screenshots to help explain your problem.

    System Details Please provide your platform, GO version and variables, etc

    Additional context Add any other context about the problem here.

  • Fix double quotes encoding in event Data passed from go to JS in NotifyEvent

    Fix double quotes encoding in event Data passed from go to JS in NotifyEvent

    Way to reproduce:

    test := map[string]string{
            "key": `"value"`,
    }
    
    runtime.Events.Emit("test", &test)
    

    Then in eval call JS will try to parse it and will fail:

    JSON.parse('{"key":"\"value\""}')
    VM287:1 Uncaught SyntaxError: Unexpected token h in JSON at position 10
        at JSON.parse (<anonymous>)
        at <anonymous>:1:6
    

    Proposed fix is to double encode it to json before evaluation. Not sure how it will affect performance. In any case \" should be replaced with \\" somehow to make event sender more robust.

    If you know any way to configure json marshaller to have it output proper data right away, feel free to close this PR.

  • feat: clojurescript+reagent template

    feat: clojurescript+reagent template

    So I'm writing a new template, which will use a tool called leiningen to have a clojurescript template, using reagent (clojurescript bindings to react) I was just wondering what tips I might have before embarking. It seems I make a minimum root project directory, but add a whole frontend/ directory as created exactly by the tool from its own templates, is that right? Or can I invoke lein from wails init?

    I also imagine I need to bind to certain wails javascript libraries?

  • Korean characters are displayed abnormally in Title

    Korean characters are displayed abnormally in Title

    Description

    Korean characters are displayed abnormally in Title

    • Ubuntu 18.04 : normal
    • macOS 10.14.6 : normal
    • Windows 10 1903 : abnormal

    To Reproduce Steps to reproduce the behaviour:

    1. Go to '...'
    2. Click on '....'
    3. Scroll down to '....'
    4. See error

    Expected behaviour A clear and concise description of what you expected to happen.

    Screenshots 2019-10-14-16-01-08

    System Details

    | Name | Value | | ----- | ----- | | Wails Version | v0.18.3 | | Go Version | go1.12.7 | | Platform | windows | | Arch | amd64 | | GO111MODULE | (Not Set) | | GCC | 5.1.0 | | Npm | v12.9.0 | | Node | 6.10.2 |

    Additional context

  • Concurrent write to WebSocket

    Concurrent write to WebSocket

    Description

    Wails crashes during websocket communication

    To Reproduce

    from TS:

    Wails.Events.On("update_status", (newStatus) => {
    			console.log("On STATUS: ", newStatus)
    		  });
    
    for(int i=0; I < 100; I++){
      backend.IntelliMech.SetStatus(`Count: ${i}`)
    }
    
    

    from GoLang

    func (im *IntelliMech) wailsRunner() {
    	for {
    		select {
    		case newStat := <-im.inStatus:
    			im.Lock()
    			im.status = newStat
    			im.Unlock()
    			im.Runtime.Events.Emit("update_status", newStat)
    		}
    	}
    }
    
    func (im *IntelliMech) SetStatus(data string) {
    	log.Printf("We Have New Status %s", data)
    	im.inStatus <- data
    
    }
    

    panic: concurrent write to websocket connection

    goroutine 6 [running]: github.com/gorilla/websocket.(*messageWriter).flushFrame(0xc00011b8b0, 0xc000173401, 0xc0001734b6, 0x0, 0xa, 0x40, 0xc000173480) /Users/svkior/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:591 +0x6f6 github.com/gorilla/websocket.(*Conn).WriteMessage(0xc000280160, 0x1, 0xc000173480, 0x36, 0x40, 0x40, 0x1) /Users/svkior/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:752 +0x24c github.com/wailsapp/wails/lib/renderer/bridge.(*session).sendMessage(0xc000154d70, 0xc000173440, 0x36, 0x0, 0x0) /Users/svkior/go/pkg/mod/github.com/wailsapp/[email protected]/lib/renderer/bridge/session.go:39 +0xef github.com/wailsapp/wails/lib/renderer/bridge.(*session).evalJS(...) /Users/svkior/go/pkg/mod/github.com/wailsapp/[email protected]/lib/renderer/bridge/session.go:88 github.com/wailsapp/wails/lib/renderer/bridge.(*Bridge).NotifyEvent(0xc000254070, 0xc0002c8960, 0x0, 0x0) /Users/svkior/go/pkg/mod/github.com/wailsapp/[email protected]/lib/renderer/bridge/bridge.go:165 +0x314 github.com/wailsapp/wails/lib/event.(*Manager).Start.func1(0xc000154820) /Users/svkior/go/pkg/mod/github.com/wailsapp/[email protected]/lib/event/manager.go:111 +0x36c created by github.com/wailsapp/wails/lib/event.(*Manager).Start /Users/svkior/go/pkg/mod/github.com/wailsapp/[email protected]/lib/event/manager.go:99 +0x12d Error: exit status 2

    Expected behaviour No Error

    System Details

    | Name | Value | | ----- | ----- | | Wails Version | v1.0.2 | | Go Version | go1.13.6 | | Platform | darwin | | Arch | amd64 | | GO111MODULE | (Not Set) | | GCC | 4.2.1 | | Npm | 6.13.6 | | Node | v13.7.0 |

    Additional context Add any other context about the problem here.

  •  OnBeforeClose called twice when the window is about to be closed(introduced in v2.3.1)

    OnBeforeClose called twice when the window is about to be closed(introduced in v2.3.1)

    Description

    The 'OnBeforeClose' handler will be called twice if you close the window. This bug is introduced in v2.3.1 i think.

    To Reproduce

    1. use latest wails cli to create a project
    2. main.go
    package main
    
    import (
    	"embed"
    
    	"github.com/wailsapp/wails/v2"
    	"github.com/wailsapp/wails/v2/pkg/options"
    	"github.com/wailsapp/wails/v2/pkg/options/assetserver"
    )
    
    //go:embed all:frontend/dist
    var assets embed.FS
    
    func main() {
    	// Create an instance of the app structure
    	app := NewApp()
    
    	// Create application with options
    	err := wails.Run(&options.App{
    		Title:  "wails-2.3.1-bug",
    		Width:  1024,
    		Height: 768,
    		AssetServer: &assetserver.Options{
    			Assets: assets,
    		},
    		BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 1},
    		OnStartup:        app.startup,
    		OnBeforeClose:    app.beforeClose,
    		Bind: []interface{}{
    			app,
    		},
    	})
    
    	if err != nil {
    		println("Error:", err.Error())
    	}
    }
    
    1. app.go
    package main
    
    import (
    	"context"
    	"fmt"
    )
    
    // App struct
    type App struct {
    	ctx context.Context
    }
    
    // NewApp creates a new App application struct
    func NewApp() *App {
    	return &App{}
    }
    
    // startup is called when the app starts. The context is saved
    // so we can call the runtime methods
    func (a *App) startup(ctx context.Context) {
    	a.ctx = ctx
    }
    
    // this will called twice every time you close the window
    func (a *App) beforeClose(context.Context) bool {
    	fmt.Println("beforeClose")
    	return false
    }
    
    // Greet returns a greeting for the given name
    func (a *App) Greet(name string) string {
    	return fmt.Sprintf("Hello %s, It's show time!", name)
    }
    
    1. wails dev
    2. close the window
    3. the output info in the console
    ......
    To develop in the browser and call your bound Go methods from Javascript, navigate to: http://localhost:34115
    beforeClose
    beforeClose
    Development mode exited
     ♥   If Wails is useful to you or your company, please consider sponsoring the project:
    https://github.com/sponsors/leaanthony
    

    Expected behaviour

    i think the OnBeforeClose handler should be called only once.

    Screenshots

    No response

    Attempted Fixes

    No response

    System Details

    # System
    
    OS           | Windows 10 Pro     
    Version      | 2009 (Build: 19044)
    ID           | 21H2
    Go Version   | go1.19.4
    Platform     | windows
    Architecture | amd64
    
    # Wails
    
    Version | v2.3.1
    
    # Dependencies
    
    Dependency | Package Name | Status    | Version      
    WebView2   | N/A          | Installed | 108.0.1462.54
    npm        | N/A          | Installed | 8.1.0
    *upx       | N/A          | Available | 
    *nsis      | N/A          | Available | 
    * - Optional Dependency
    
    # Diagnosis
    
    Your system is ready for Wails development!
    Optional package(s) installation details:
      - upx : Available at https://upx.github.io/
      - nsis : More info at https://wails.io/docs/guides/windows-installer/
    
     ♥   If Wails is useful to you or your company, please consider sponsoring the project:
    https://github.com/sponsors/leaanthony
    

    Additional context

    No response

  • Support WebView Hardware acceleration option

    Support WebView Hardware acceleration option

    Is your feature request related to a problem? Please describe.

    Sometimes we need to be able to disable Hardware / GPU acceleration in webview. I'd like to make it an app option, so developers can set it on start from a config (This way an application's users could switch it on and off for themselves theoretically), or baked in.

    I have a solution for this on Windows and Linux, I'll make a PR when its ready.

    Describe the solution you'd like

    I'd like to add a new WebviewGpuAcceleration property to the app options. With the following structure.

    
    // WebviewGpuAcceleration values used for determining the hardware acceleration policy.
    //   - WebviewGpuAccelerationOff
    //   - WebviewGpuAccelerationOn
    //   - WebviewGpuAccelerationOnDemand
    type WebviewGpuAcceleration int
    
    const (
    	// WebviewGpuAccelerationOn Hardware acceleration is always enabled, even for websites not requesting it.
    	WebviewGpuAccelerationOn WebviewGpuAcceleration = 0
    	// WebviewGpuAccelerationOnDemand Hardware acceleration is enabled/disabled as request by web contents. (linux only falls back to "on" on windows)
    	WebviewGpuAccelerationOnDemand WebviewGpuAcceleration = 1
    	// WebviewGpuAccelerationOff Hardware acceleration is always disabled, even for websites requesting it.
    	WebviewGpuAccelerationOff WebviewGpuAcceleration = 2
    )
    

    Usage would look like this:

    
    err := wails.Run(&options.App{
      Title:            "wailst",
      Width:            1024,
      Height:           768,
      Assets:           assets,
      BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 0},
      OnStartup:        app.startup,
      Frameless:        true,
      CSSDragProperty:  "--wails-draggable",
      CSSDragValue:     "drag",
      Bind: []interface{}{
    	  app,
      },
      Windows: &windows.Options{
    	  WindowIsTranslucent:  true,
    	  WebviewIsTransparent: true,
      },
      WebviewGpuAcceleration: options.WebviewGpuAccelerationOff, // <- it would be set here
    })
    

    Describe alternatives you've considered

    No response

    Additional context

    On Windows it can be set via browser flags in chromium. On Linux it can be set via webkit_settings_set_hardware_acceleration_policy(s,o) On macOs as far as I can tell this is not an option to be set. (Can't find anything about it in the docs.)

  • Random

    Random "TypeError: undefined is not an object (evaluating 'window['go']['backend']')"

    Description

    I am getting this error every time the app hot-reloads. First run is fine, but if I change anything on the frontend, I get a blank screen with this error in the console:

    TypeError: undefined is not an object (evaluating 'window['go']['backend']')
    

    Full output:

    [Error] TypeError: undefined is not an object (evaluating 'window['go']['backend']')
    	IsDark (Model.js:22)
    	Module Code (index.tsx:33)
    	evaluate
    	moduleEvaluation
    	(anonymous function)
    	promiseReactionJob
    

    The files it's pointing at are auto-generated.

    To Reproduce

    Honestly, I am not sure as it seemed to just appear out of the blue. For me it happens consistently. Whenever I update the front end, I have to kill wails dev and re-run it. Otherwise, I'm stuck with a blank screen.

    Expected behaviour

    I expected it to reload like before without any errors.

    Screenshots

    Screenshot 2022-12-31 at 07 56 33

    Attempted Fixes

    No response

    System Details

    Wails CLI v2.3.1
    
    Scanning system - Please wait (this may take a long time)...Done.
    
    # System
    
    OS           | MacOS
    Version      | 13.0.1
    ID           | 22A400
    Go Version   | go1.19.3
    Platform     | darwin
    Architecture | arm64
    
    # Wails
    
    Version | v2.3.1
    
    # Dependencies
    
    Dependency                | Package Name | Status    | Version
    Xcode command line tools  | N/A          | Installed | 2396
    npm                       | N/A          | Installed | 8.11.0
    *Xcode                    | N/A          | Available |
    *upx                      | N/A          | Available |
    *nsis                     | N/A          | Installed | v3.08
    * - Optional Dependency
    
    # Diagnosis
    
    Your system is ready for Wails development!
    Optional package(s) installation details:
      - Xcode: Available at https://apps.apple.com/us/app/xcode/id497799835
      - upx : Available at https://upx.github.io/
    
     ♥   If Wails is useful to you or your company, please consider sponsoring the project:
    https://github.com/sponsors/leaanthony
    
    
    
    ### Additional context
    
    This happens both on macOS and Windows as well.
  • Typescript type definitions do not match Go definitions

    Typescript type definitions do not match Go definitions

    Description

    Sometimes the generated types in models.ts and .d.ts files are inaccurate.

    For example, I have the following Go code:

    const (
    	A Enum = "A"
    	B Enum = "B"
    	C Enum = "C"
    )
    
    type Enum string
    
    type App struct {}
    
    func (app *App) DoSomething() Enum {
    	return A // returns a value of Enum, which is of string type
    }
    

    where an instance of the App struct is binded to Wails.

    However, for the generated wailsjs/go/main/App.d.ts:

    import {main} from '../models';
    
    export function DoSomething():Promise<main.Enum>;
    

    main.Enum is never declared in wailsjs/go/models.ts

    Perhaps it's because Wails generate TypeScript models for Go structs only?

    To Reproduce

    Let any method accepts or returns an "advanced" type, such as string type (as example above), function type, etc.

    Expected behaviour

    A model like the following should be generated in wailsjs/go/models.ts:

    export type Enum = string;
    

    Screenshots

    No response

    Attempted Fixes

    Possibly related to #1707 and #1476.

    System Details

    Wails CLI v2.3.1
    
    Scanning system - Please wait (this may take a long time)...Done.
    
    # System
    
    OS           | MacOS
    Version      | 11.4
    ID           | 20F71
    Go Version   | go1.19
    Platform     | darwin
    Architecture | amd64
    
    # Wails
    
    Version | v2.3.1
    
    # Dependencies
    
    Dependency                | Package Name | Status    | Version
    Xcode command line tools  | N/A          | Installed | 2384
    npm                       | N/A          | Installed | 8.19.3
    *Xcode                    | N/A          | Installed | 12.5.1 (12E507)
    *upx                      | N/A          | Installed | upx 3.96
    *nsis                     | N/A          | Available |
    * - Optional Dependency
    
    # Diagnosis
    
    Your system is ready for Wails development!
    Optional package(s) installation details:
      - nsis : More info at https://wails.io/docs/guides/windows-installer/
    
     ♥   If Wails is useful to you or your company, please consider sponsoring the project:
    https://github.com/sponsors/leaanthony
    

    Additional context

    No response

  • Replace more slack links with discord invites

    Replace more slack links with discord invites

    First try to add the discord links to more sites and "deprecate" the slack links.

    I just recognized there are a bunch of slack links "hidden" in the translations. I will try to add changes there aswell.

A full desktop environment for Linux/Unix using Fyne
A full desktop environment for Linux/Unix using Fyne

About FyneDesk is an easy to use Linux/Unix desktop environment following material design. It is build using the Fyne toolkit and is designed to be ea

Dec 31, 2022
Example Go desktop app using HTML

webview-example This repo contains an example/starter for building a webview app

Jun 14, 2022
A package to build progressive web apps with Go programming language and WebAssembly.
A package to build progressive web apps with Go programming language and WebAssembly.

go-app is a package to build progressive web apps (PWA) with Go programming language and WebAssembly. It uses a declarative syntax that allows creatin

Dec 28, 2022
An example desktop system tray application that can launch HTML5 windows. Go source with a build process for Windows, Mac and Linux.

ExampleTrayGUI An example cross-platform (Mac, Windows, Linux) system tray application that can launch HTML5 windows, developed in Go including functi

Dec 3, 2022
An example desktop system tray application that can launch HTML5 windows. Go source with a build process for Windows, Mac and Linux.

ExampleTrayGUI An example cross-platform (Mac, Windows, Linux) system tray application that can launch HTML5 windows, developed in Go including functi

Dec 3, 2022
An example desktop system tray application that can launch HTML5 windows. Go source with a build process for Windows, Mac and Linux.

An example cross-platform (Mac, Windows, Linux) system tray application that can launch HTML5 windows, developed in Go including functional build process. This repository is intended as a quick reference to help others start similar projects using the referenced libraries and will not be actively maintained.

Dec 3, 2022
An example desktop system tray application that can launch HTML5 windows. Go source with a build process for Windows, Mac and Linux.

ExampleTrayGUI An example cross-platform (Mac, Windows, Linux) system tray application that can launch HTML5 windows, developed in Go including functi

Dec 3, 2022
Kita is a declarative, reactive GUI toolkit for build cross platform apps with web technology with single codebase
Kita is a declarative, reactive GUI toolkit for build cross platform apps with web technology with single codebase

Kita is a declarative, reactive GUI toolkit for build cross platform apps with web technology with single codebase. Inspired by Flutter, React. S

Apr 18, 2022
UIKit - A declarative, reactive GUI toolkit for build cross platform apps with web technology with single codebase
 UIKit - A declarative, reactive GUI toolkit for build cross platform apps with web technology with single codebase

UIKit - A declarative, reactive GUI toolkit for build cross platform apps with web technology with single codebase

Apr 18, 2022
gosx-notifier is a Go framework for sending desktop notifications to OSX 10.8 or higher
gosx-notifier is a Go framework for sending desktop notifications to OSX 10.8 or higher

gosx-notifier A Go lib for sending desktop notifications to OSX Mountain Lion's (10.8 or higher REQUIRED) Notification Center. Update 4/3/2014 On OSX

Dec 28, 2022
A Go (golang) Custom Flutter Engine Embedder for desktop
A Go (golang) Custom Flutter Engine Embedder for desktop

Go Flutter desktop embedder ⚠️ Warning: this project has been moved to its own organization. Please take a look at its new location: github.com/go-flu

Jul 23, 2022
A unified graphical user experience toolkit for Go desktop applications

Unison A unified graphical user experience toolkit for Go desktop applications. macOS, Windows, and Linux are supported. Required setup Unison is buil

Dec 20, 2022
Ps4gdb desktop - PS4GDB consists of two components

PS4GDB PS4GDB consists of two components. The first component is the gdbstub run

Oct 4, 2022
Build cross platform GUI apps with GO and HTML/JS/CSS (powered by Electron)

Thanks to go-astilectron build cross platform GUI apps with GO and HTML/JS/CSS. It is the official GO bindings of astilectron and is powered by Electr

Jan 9, 2023
Build cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs)
Build cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs)

gowd Build cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs) How to use this library: Download and install nwjs Install this library g

Dec 11, 2022
Common library for Go GUI apps on Windows
Common library for Go GUI apps on Windows

winc Common library for Go GUI apps on Windows. It is for Windows OS only. This makes library smaller than some other UI libraries for Go.

Dec 12, 2022
Go Web UI Toolkit - Public Releases and Development
 Go Web UI Toolkit - Public Releases and Development

Welcome! Gowut (Go Web UI Toolkit) is a full-featured, easy to use, platform independent Web UI Toolkit written in pure Go, no platform dependent nati

Dec 5, 2022
Pglet - Web UI framework for backend developers
Pglet - Web UI framework for backend developers

Pglet - Web UI framework for backend developers

Nov 15, 2022
W32find - Find parent windows and their children windows using win32api.

w32find Package w32find provides a set of interface to win32 APIs that can be used to find windows and their controls. Install go get -v github.com/mo

Jan 5, 2022