* [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.
This fixes some long-standing inconsistencies between
dev mode builds and production builds but is a breaking
change. Dev mode uses custom scheme for Vite versions >= 3.0.0
and for older it still behaves in the old way.
* [assets] Improve error message if no `index.html` could be found in the assets
* [assetoptions] Valide options that at least one property has been set
* [assetserver] Move defaultHTML handling for 404 from assethandler to assetserver
* [assetserver] Add support for serving the index.html file when requesting a directory
* [docs] Update changelog
* [assetserver] Add support for HTTP Middlewares
* [dev] Disable frontend DevServer if no Assets has been defined and inform user
* [dev] Consistent WebSocket behaviour in dev and prod mode for assets handler and middleware
In prod mode we can't support WebSockets so make sure the
assets handler and middleware never see WebSockets in dev mode.
* [templates] Migrate to new AssetServer option
* [docs] Add assetserver.Options to the reference
* Add WindowExecJS
* [devserver] Embed the base frontend into the DevServer struct
* Update docs
Co-authored-by: stffabi <stffabi@users.noreply.github.com>
* get dimensions working for linux
* Cleaning up some GTK code
I was getting the following errors due to some bad casts.
Gdk-CRITICAL **: 18:58:51.943: gdk_monitor_get_geometry: assertion 'GDK_IS_MONITOR (monitor)' failed
Gdk-CRITICAL **: 18:58:51.943: gdk_display_get_monitor_at_window: assertion 'GDK_IS_DISPLAY (display)' failed
This commit fixes these errors
* Adding Screen namespace along with linux implementation
* moving ScreenGetAll into a more appropriate place
* Fixing typescript definition mistake, documentation, ordering of functions, and formatting
* add ScreenGetAll to more templates
* moving screen into its own javascript file
* fixing bug where screen objects are not returned from the runtime function
* rebuilding frontend wrapper package
* adding windows implementation of ScreenGetAll
* adding screen get all implementation for darwin
* reverting a change that is unrelated to the work on expose-dimensions
* removing duplicate comparison
* changing GetNthScreen in screen API on macos
To use frame instead of visibleframe to keep into account the space the the dock takes up
We want to include that space in the calculation in order to keep the sizes of screens consistent across platforms
* Correcting screen jsdoc
It used to say it returned a single screen object. Now it says that it returns an array of screen objects
* Fixing typo in function name
* reverting pointless spacing change
* reverting pointless spacing change
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Co-authored-by: shmuel.kamensky <shmuel.kamensky@shutterfly.com>
* [website] Fix devserver default value doc
* [v2] Add support for AssetsHandler
AssetsHandler is a http.Handler delegate, which gets called
as a fallback for all Non-GET requests and for GET requests
for which the Assets didn’t find the file.
Known Limitations on Linux:
- All requests are GET requests
- No request headers
- No request body
- No response status code, only StatusOK will be returned
- No response headers
Known Limitations on Windows:
- Request body is leaking memory. Seems to be a bug in
WebView2, investigation angoing.
Most of these limitations on Linux will be fixed in the future with
adding support for Webkit2Gtk 2.36.0+.
* [v2, linux] Add response streaming support
The complete response won’t be held anymore in memory and will
be streamed to WebKit2.
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* [v2] Consolidate AssetServers
* [v2] Support starturl for webview on linux and darwin
* [v2] Add support for frontend DevServer
* [v2] Activate frontend DevServer in svelte template
* [website] Add bleeding edge guide for PRs
* DoNotMerge: Bump Version for testing
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
* [linux] Move SetTitle and startDrag to main thread
* [linux] Move SetPosition, Center, Fullscreen and UnFullscreen to main thread
* Fix runtime Window Get/Set Position signatures
* Fix vanilla template keyboard handling
AssetDir is now inferred from the assets, if the assets is an
embed.FS, by taking the relativ path to the index.html joined with
the project root.
The assetDir flag still exists and can be used if the inferring doesn't
work, because the provided embed.FS wasn't defined in the main
package.