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

41 Commits

Author SHA1 Message Date
Fabio Massaioli
d4096868e3
[v3] Fix and optimise assetserver (#4049)
* Fix and optimize content type sniffer

- Minimize copying and buffering
- Ensure it sniffs the full 512-bytes prefix

* Fix assorted warnings

* Cleanup error formatting

- Remove unnecessary formatting calls
- Fix invalid format strings
- Standardise logging calls

* Fix and optimize index fallback method

- Pass through non-404 responses correctly
- Do not buffer original response

* Test content sniffing and index fallback

* Update changelog

* Remove obsolete check

* Add safety checks in sniffer
2025-02-09 00:02:54 +11:00
Lea Anthony
b3e81f5cbb
BREAKING CHANGE: wml attributes are now prefixed with data- 2025-01-28 07:37:17 +11:00
Lea Anthony
db61f9f263
Event cancellation for standard listeners.
Major doc updates.
Runtime build tidy up.
Removed redundant default event mappings.
2025-01-27 09:29:22 +11:00
Lea Anthony
7aa7534852
Fix build issue 2024-12-15 08:32:43 +11:00
Lea Anthony
a0b2ab7c0a
Fix default index.html serving.
Support multi-language default.
Remove default page from production builds.
Improve defaultindex.html.
2024-12-14 11:10:07 +11:00
Mohamed Gharib
efe0c8d534
[v3-Windows] New DIP system for Enhanced High DPI Monitor Support (#3665)
* [v3-Windows] New DIP system for Enhanced High DPI Monitor Support

* Update changelog

* Remove asset middleware

* Remove SetThreadDpiAwarenessContext()

* Fix macOS build.

* Fill missing screens fields (linux, darwin)

* Skip DPI transformation on unsupported platforms

* Simplify distanceFromRectSquared()

* Update v3/pkg/application/screenmanager.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-09-22 08:38:30 +10:00
Lea Anthony
4386f5fcb2
# Conflicts:
#	mkdocs-website/docs/en/changelog.md
2024-09-18 05:55:49 +10:00
Lea Anthony
ef8c886b10
Ignore internal service methods when binding (#3720)
* Ignore internal service methods when binding

* Updated changelog.md
2024-09-09 08:36:19 +10:00
Atterpac
e316cd0719
[V3] Plugins implemenations (#3570)
* plugin handler and lifecycle

* rebase

* remove reflect

s

* remove Config and NewPlugin from plugin template

* Remove plugin manager, generation of plugin interface

* implement http handlers for services

remove log

trim path

prefix wails/services

* update plugine example

* Misc updates

* Ported plugins to services, rewritten example

* Added fileserver

* Update OnStartup and use a context for the application

* Rename PathPrefix to Route. Create docs.

* Use service config copy. Add Name to Service Options. Improve service generation.

* Use service config copy. Add Name to Service Options. Improve service generation. Update README

* Remove rogue db

* Update changelog.md

---------

Co-authored-by: Lea O'Anthony <lea.anthony@gmail.com>
2024-09-01 17:26:22 +10:00
Mohamed Gharib
d5e289880f
[v3] Rename AbsolutePosition() to Position() (#3611) 2024-07-15 19:27:21 +10:00
Lea Anthony
9d488c97e0
Support raw messages from JS 2024-06-08 20:43:24 +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
Atterpac
71b2edc0fe
[V3-Linux] Upgrade to Webkitgtk4.1 (#3461)
* webkitgtk4.0->webkitgtk4.1

changelog

* Update mkdocs-website/docs/en/changelog.md

* Update deps in pipeline

* Update deps in pipeline

* Install 4.1 only when v3

* Install 4.1 only when v3

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2024-05-08 18:08:14 +10:00
Lea Anthony
0f9c7b1bbf
Fix nanoid dep for npm package 2024-04-28 19:43:37 +10:00
Lea Anthony
c7ed7e72d4
Major plugin updates 2024-04-14 21:41:33 +10:00
Fabio Massaioli
413191411f
Remove class fields (#3333) 2024-03-24 16:42:41 +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
bc0a9b2e52 Add BundledAssetFileServer for bundled /wails/runtime.js. Update examples. 2024-03-17 15:08:30 +11:00
Lea Anthony
acd6f7af5b Merge remote-tracking branch 'origin/v3-alpha-linux' into v3-alpha 2024-03-14 08:39:19 +11:00
Josh Drake
f38532bcf5
Correctly compute 'startURL' when using a frontend development server. (#3299)
* Fix computing 'startURL' when 'FRONTEND_DEVSERVER_URL' is present.

* Respect provided URL when computing 'startURL' and 'FRONTEND_DEVSERVER_URL' is present.

* Update changelog.

* Correctly produce absolute URI in 'GetStartURL' when input is provided.
2024-03-08 18:06:14 +11:00
Lea Anthony
065ca5f6d3 Move to latest webkit2 and remove older code.
Fix screen demo.
Update examples.
2024-03-06 16:59:13 -06:00
stffabi
bfe9a9d015 [runtime] Add cancelation of bound method calls and context passing 2024-03-04 10:34:14 +01:00
5aaee9
a9c22f0588
fix: wrong baseURL if open window twice (#3273) 2024-02-29 08:47:25 +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
773bdf8ea2
Fix small bugs in assetserver 2024-01-21 21:46:45 +11:00
Lea Anthony
b249f0d0ce
Bring linux up to date with dev changes 2024-01-21 21:24:30 +11: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
c82facd6ff
Move startURL calculation to assetserver 2024-01-20 11:50:20 +11:00
Lea Anthony
e5c14d24ae
Initial implementation of dev mode.
Huge thanks to @atterpac!
2024-01-19 21:34:49 +11:00
Lea Anthony
7f8c1c8a68
Remove redundant IPC endpoint.
Don't auto-inject runtime.
2023-12-29 12:42:03 +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
Lea Anthony
5958d9c646
[windows] Serve assets async 2023-10-05 19:18:32 +11:00
Travis McLane
f50c8f447e [v3 assetserver] cleanup logging
- remove type assertions
- update contentTypeSniffer to capture the status code
- move logic in ServeHTTP to serveHTTP
- wrap serveHTTP with ServeHTTP adding logging & duration calculation
2023-08-24 12:44:13 -05:00
Travis McLane
4804b34208
[v3 linux] api changes (#2830) 2023-08-19 06:12:34 +10:00
Lea Anthony
79deb37675
Fix return code in logging 2023-08-18 11:15:02 +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
Lea Anthony
db836b7a48
Move assetserver to internal 2023-08-14 08:31:55 +10:00