5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-04 21:50:32 +08:00
Commit Graph

113 Commits

Author SHA1 Message Date
Lea Anthony
b0fb67451d Fix icon issue for darwin. 2024-06-08 13:05:06 +10:00
Fabio Massaioli
90b7ea944d
[v3] New binding generator (#3468)
* Support variadic arguments and slice, pointer types

* Fix computation of type namespaces

* Improve comments and general formatting

* Set default values correctly for composite types

* Add templates for bindings

Additionally:
* fixes generation of tuple return type
* improves imports and namespacing in JS mode
* general cleanup of generated code

* Simplify import list construction

* Refactor type generation code

Improves support for unknown types (encoded as any) and maps (using
Typescript index signatures)

* Support slices with pointer elements

* Match encoding/json behaviour in struct parser

* Update tests and example

* Add tests for complex method signatures and json tag parsing

* Add test `function_multiple_files`

* Attempt looking up idents with missing denotation

* Update test data

* fix quoted bool field

* Test quoted booleans

* Delete old parser code

* Remove old test data

* Update bindgen flags

* Makes call by ID the default

* Add package loading code

* Add static analyser

* Temporarily ignore binding generation code

* Add complex slice expressions test

* Fix variable reference analysis

* Unwrap casts to interface types

* Complete code comments

* Refactor static analyser

* Restrict options struct usage

* Update tests

* Fix method selector sink and source processing

* Improve Set API

* Add package info collector

* Rename analyser package to analyse

* Improve template functions

* Add index file templates

* Add glue code for binding generation

* Refactor collection and rendering code

* Implement binding generator

* Implement global index generation

* Improve marshaler and alias handling

* Use package path in binding calls by name

* Implement model collection and rendering

* Fix wrong exit condition in analyser

* Fix enum rendering

* Generate shortcuts for all packages.

* Implement generator tests

* Ignore non-pointer bound types

* Treat main package specially

* Compute stats

* Plug new API into generate command

* Support all named types

* Update JS runtime

* Report dual role types

* Remove go1.22 syntax

* Fix type assertion in TS bindings

* encoding/json compliance for arrays and slices

* Ignore got files in testdata

* Cleanup type rendering mechanism

* Update JS runtime

* Implement generic models

* Add missing field in renderer initialisation

* Improve generic creation code

* Add generic model test

* Add error reporting infrastructure

* Support configurable file names

* Detect file naming collisions

* Print final error report

* New shortcut file structure + collision detection

* Update test layout and data

* Autoconfiguration for analyser tests

* Live progress reporting

* Update code comments

* Fix model doc rendering

* Simplify name resolution

* Add test for out of tree types

* Fix generic creation code

* Fix potential collisions between methods and models

* Fix generic class alias rendering

* Report model discovery in debug mode

* Add interface mode for JS

* Collect interface method comments

* Add interface methods test

* Unwrap generic instantiations in method receivers

* Fix rendering of nullable types in interface mode

* Fix rendering of class aliases

* Expose promise cancel method to typescript

* Update test data

* Update binding example

* Fix rendering of aliased quoted type params

* Move to strongly typed bindings

* Implement lightweight analyser

* Update test cases

* Update binding example

* Add complex instantiation test

* Load full dependency tree

* Rewrite collector

* Update renderer to match new collector

* Update generator to match new collector

* Update test data

* Update binding example

* Configure includes and injections by language

* Improve system path resolution

* Support rich conditions in inject/include directives

* Fix error handling in Generator.Generate

* Retrieve compiled go file paths from fileset

* Do not rely on struct info in struct flattening algorithm

* Fix doc comment for findDeclaraion

* Fix bugs in embedded field handling

* Fix bugs and comments in package collection

* Remove useless fields from ServiceInfo

* Fix empty line at the beginning of TS indexes

* Remove global index and shortcuts

* Remove generation tests for individual packages

* Enforce lower-case file names

* Update test data

* Improve error reporting

* Update binding example

* Reintroduce go1.22 syntax

* Improve relative import path computation

* Improve alias support

* Add alias test

* Update test data

* Remove no services error

* Rename global analyser test

* Add workaround and test for bug in typeutil.Map

* Update test data

* Do not split fully qualified names

* Update typeutil package and remove workaround

* Unify alias/named type handling

* Fix rendering of generic named class aliases

* Fix rendering of array types

* Minor tweaks and cleanups

* Rmove namespaced export construct

* Update test data

* Update binding example

* Break type cycles

* Fix typo in comment

* Fix creation code for cyclic types

* Fix type of variadic params in interface mode

* Update test data

* Fix bad whitespace

* Refactor type assertions inside bound methods

* Update test data

* Rename field application.Options.Bind to Services

* Rename parser package to generator

* Update binding example

* Update test data

* Update generator readme

* Add typescript test harness

* Move test output to new subfolder

* Fix code generation bugs

* Use .js extensions in TS mode imports

* Update test data

* Revert default generator output dir to frontend/bindings

* Bump runtime package version

* Update templates

* Update changelog

* Improve newline handling

---------

Co-authored-by: Andreas Bichinger <andreas.bichinger@gmail.com>
2024-05-19 20:40:44 +10:00
Travis McLane
99537f2816 remove Register/UnregisterWindow functionality
- this is no longer needed
2024-05-02 09:37:23 -05:00
Harry Fox
b384bb885b
add missing map init from application.init() (#3426)
* add missing map init from `application.init()`

* add changelog entry for #3426

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2024-05-02 21:57:51 +10:00
Travis McLane
021efab84d
allow for non-Window WailsEvent listeners (#3406)
* allow for non-Window WailsEvent listeners

- adds a RegisterListener function on the App struct such
  that code can listen for WailsEvent(s) even if it isn't a Window
- rename dispatchEventToWindows -> dispatchEventToListeners
- add all windows and WailsEventListeners to slice before emitting

* Update v3/pkg/application/application.go

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2024-04-20 09:39:57 +10:00
Lea Anthony
85b1f909a7 Plugin updates 2024-03-26 20:56:58 +11:00
Fabio Massaioli
2b9891da2c
[v3] Update and fix runtime JS API (#3295)
* Cleanup bundled runtime entry point

* Fix JS representation of Screen struct

* Expose IsFocused method in Window interface

* Update JS window API

* Fix cleanup of WML listeners

* Bundle runtime as ES module

* Update runtime dependencies

* Update runtime types and events

* Update bundled runtime

* Update changelog

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2024-03-20 20:30:14 +11:00
Lea Anthony
aba82cc527 Update system.Environment 2024-03-19 20:37:03 +11:00
Lea Anthony
bc0a9b2e52 Add BundledAssetFileServer for bundled /wails/runtime.js. Update examples. 2024-03-17 15:08:30 +11:00
stffabi
723dd976b4 [v3, assetServer] Use middlewares for runtime, caps and falgs instead of having the implementation in the assetserver 2024-02-16 07:38:28 +01:00
stffabi
65251cdafa [v3, assetServer] Remove fs.FS from options and always use a http.Handler 2024-02-16 07:38:27 +01:00
Lea Anthony
6522657893
Refactor menu functions and streamline devtools toggle across systems
This update adds implementation to several menu item functions, replacing their previous 'not implemented' state. This includes actions for close, reload, forcing reload, toggling of fullscreen, reset zoom, and others. The update also includes modifications for the handling of developer tools toggle under different build configurations. This refactoring is aimed to standardize devtools configuration across different operating systems.
2024-01-21 20:52:32 +11:00
Lea Anthony
e5c14d24ae
Initial implementation of dev mode.
Huge thanks to @atterpac!
2024-01-19 21:34:49 +11:00
Lea Anthony
861ddea1b2
Add option to prevent application shutdown
This update allows the application shutdown to be cancelled. It implements the shouldQuit function, which can prevent the application from quitting if it returns false. Additional checks have been added to ensure cleanup and quit processes are performed only if required. The darwin delegate and linux and windows applications were modified to include this new functionality.
2024-01-17 20:45:30 +11:00
Lea Anthony
a6757c352f
Add shutdown tasks functionality to application
A new method OnShutdown was introduced to allow adding tasks to be run when the application shuts down. The shutdown tasks are run on the main thread and in the order they were added, with the application option `OnShutdown` being run first. This allows more controlled and managed shutdown of the application.
2024-01-14 08:17:17 +11:00
ALMAS
3cd26a2220
[v3] Improve OnShutdown (#3190)
* [v3] Improve OnShutdown

* add change log
2024-01-10 23:28:15 +11:00
Lea Anthony
6c3bd124ce
Added option to disable AssetServer logging.
An option to disable AssetServer logging has been introduced in the application options. This will suppress every request log from the AssetServer if set to true. This adjustment is useful for preventing log saturation in certain scenarios or environments.
2024-01-09 22:15:42 +11:00
Lea Anthony
68b12d4fff
Refactored application shutdown process to streamline app termination.
The application shutdown process has been significantly reworked to be more efficient and robust. The refactored code removes the event listener for the 'ApplicationTerminate' event. Instead, an in-process flag is added to the 'Quit' method to prevent recursive calls. Additionally, an optional 'OnShutdown' function variable is introduced to allow custom cleanup operations upon app termination.
2024-01-09 18:19:09 +11:00
Lea Anthony
1195464acb Improve window teardown on termination
This commit adds a robust teardown process for windows on application shutdown. It introduces a field to track the destruction state of each window and checks such before performing window operations. Also, it enhances the destroy functions within application for thorough clean up. Finally, redundant event handlers related to application termination were removed while fixing file generating challenge in go tasks.
2024-01-09 07:45:56 +11:00
Lea Anthony
68e779d64e
[darwin] add support for quitting app 2024-01-08 21:22:33 +11:00
stffabi
2f3eb70a4d [windows] Use msWebView2BrowserHitTransparent for non working NC area clicks on unfocused window
Without this patch there's a really strange behaviour if there are
multiple windows.
Having two windows with a webview open with an input field.
Focusing the input field on one window, then focusing the input
field on the second one. Then clicking directly on the non client
area of the first one, e.g. to trigger a minimze, the minimize is
not executed until the mouse is getting moved. As long as the
mouse is not moved the event for the click is blocked and not
executed.

Using this new mode fixes that problem, but we need to handle
‘alt+f4’ on our own.
2023-12-30 23:34:54 +01:00
Lea Anthony
9f567fe2bc
Application: increase message buffer sizes, process all messages in goroutine, Add IsDebug to environment info. 2023-12-29 12:48:26 +11:00
Lea Anthony
b08126d745
Radical JS runtime overhaul. New @wailsio/runtime package 2023-12-28 19:18:26 +11:00
ALMAS
e0b8da86ed
[v3] export SetIcon method (#3147)
* export `SetIcon` method

* add change log
2023-12-19 23:43:28 +11:00
Lea Anthony
8242834fbd
[windows] improvements to dev 2023-11-27 21:24:58 +11:00
Lea Anthony
814e1ec059
[windows] initial wails dev support 2023-11-27 20:38:42 +11:00
Travis McLane
46a0030387 [v3] noop: gofmt changes 2023-11-06 10:41:14 -06:00
Lea Anthony
8463c01123
[windows] Drag-n-drop support 2023-10-21 11:21:10 +11:00
Lea Anthony
8e0671306a
Mac examples + readme updated 2023-10-17 20:25:36 +11:00
5aaee9
a8641672cd
[v3] fix deadlock when quit (#2982)
* fix: dead lock when quit

* docs: update changelog
2023-10-14 20:34:00 +11:00
Lea Anthony
4c75b288bb
Add BrowserOpenURL and BrowserOpenFile to App.
Better WML assets for demo
Fix dialog responses.
Add `wml-openurl`
Rename: data-wml -> wml
Fix Alpha Feedback URL
2023-10-11 20:23:59 +11:00
Lea Anthony
83ed7fd2df
[windows] Fix production logger. Add alpha assets 2023-10-09 17:36:06 +11:00
Lea Anthony
ce6d587771
Fix multiple window weirdness. Update deps 2023-10-05 20:54:12 +11:00
Travis McLane
29859ceedf [v3] correct return types for CurrentWindow
this shouldn't have been changed to Window
2023-09-28 16:46:19 -05:00
Travis McLane
1c48d567e1 [v3] NewWebviewWindow* return *WebviewWindow 2023-09-28 13:30:47 -05:00
Travis McLane
c87489adf3 [v3] implement Window interface 2023-09-28 11:39:39 -05:00
Lea Anthony
7cdab16ba9
Add API docs. Do small refactors 2023-09-24 08:57:40 +10:00
Lea Anthony
af8ee6703e [darwin] Support keybindings 2023-09-20 21:34:50 +10:00
Lea Anthony
793191a479
Initial key binding support 2023-09-17 20:48:30 +10:00
Lea Anthony
b49f135e31
Add context to application/common events 2023-09-15 17:12:35 +10:00
Lea Anthony
ed58949d24
try logging in goroutine 2023-09-13 16:47:14 +10:00
Lea Anthony
ea3509d2e7
Add LogLevel application option. Update log plugin to have log levels. 2023-09-13 09:44:37 +10:00
Travis McLane
2f7c6834d0 [v3 linux] use invokeSync 2023-09-11 17:12:57 -05:00
Lea Anthony
d44c8eba1c
[v3] Use system logger instead of println 2023-08-28 20:30:40 +10:00
Lea Anthony
e5571defb7
[v3] Support bound methodID aliases. Support []any for bindings generation. Use CallByID in bindings. 2023-08-27 20:39:35 +10:00
Lea Anthony
3352ebef6e
[v3] Tidy up logging 2023-08-19 17:15:15 +10:00
Lea Anthony
ffed41553a [v3 mac] Add IsDarkMode to application and JS runtime. Add Common.ThemeChanged event 2023-08-18 17:36:14 +10:00
Lea Anthony
946a4c56a0 [v3 mac] Better logging 2023-08-18 09:58:43 +10:00
Lea Anthony
763c7708f4
Fix HMR. Better logging. 2023-08-15 20:19:02 +10:00
Lea Anthony
e6c691a376
Support external asset server 2023-08-14 20:49:09 +10:00