mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-15 23:25:49 +01:00
7 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
9a363d7be5 |
feat(v3): add server mode for headless HTTP deployment (#4903)
* feat(v3): add server mode for headless HTTP deployment Server mode allows Wails applications to run as pure HTTP servers without native GUI dependencies. Enable with `-tags server` build tag. Features: - HTTP server with configurable host/port via ServerOptions - WAILS_SERVER_HOST and WAILS_SERVER_PORT env var overrides - WebSocket event broadcasting to connected browsers - Browser clients represented as BrowserWindow (Window interface) - Health check endpoint at /health - Graceful shutdown with configurable timeout - Docker support with Dockerfile.server template and tasks Build and run: wails3 task build:server wails3 task run:server wails3 task build:docker wails3 task run:docker Documentation at docs/guides/server-build.mdx Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(v3): add server mode for headless HTTP deployment Server mode allows Wails applications to run as pure HTTP servers without native GUI dependencies. Enable with `-tags server` build tag. Features: - HTTP server with configurable host/port via ServerOptions - WAILS_SERVER_HOST and WAILS_SERVER_PORT env var overrides - WebSocket event broadcasting to connected browsers - Browser clients represented as BrowserWindow (Window interface) - Health check endpoint at /health - Graceful shutdown with configurable timeout - Docker support with Dockerfile.server template and tasks Build and run: wails3 task build:server wails3 task run:server wails3 task build:docker wails3 task run:docker Documentation at docs/guides/server-build.mdx Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: address CodeRabbit review comments - Fix corrupted test file with embedded terminal output - Fix module name mismatch in gin-routing (was gin-example) - Fix replace directive version mismatch in gin-service - Fix placeholder module name in ios example (was changeme) - Fix Dockerfile COPY path to work from both build contexts - Fix bare URL in README (MD034 compliance) - Fix comment accuracy in getScreens (returns error, not empty slice) - Remove deprecated docker-compose version field - Add port documentation in Taskfile template Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: address CodeRabbit review comments - Add note about healthcheck wget not being available in distroless images - Add !server build constraint to menu_windows.go and menu_darwin.go - Downgrade window-visibility-test go.mod from 1.25 to 1.24 to match CI Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
41ba4e7d11 |
feat(linux): generate .desktop file during build (#4575) (#4780)
* ## Summary I've implemented the fix for issue #4575. Here's what was changed: ### Changes Made **File: `v3/internal/commands/build_assets/linux/Taskfile.yml`** 1. Added `generate:dotdesktop` as a dependency to `build:native` task (line 45) 2. Added `generate:dotdesktop` as a dependency to `build:docker` task (line 63) This ensures that the `.desktop` file is generated during every Linux build (both native and Docker-based), not just during packaging operations. ### How it works - When running `wails build` or `wails dev` on Linux, the build process now automatically generates a `.desktop` file at `build/linux/<app-name>.desktop` - The `.desktop` file contains: - Application name - Executable path - Icon reference - Categories (defaulting to "Development") - This allows Linux desktop environments to properly display the application icon and metadata even during development ### Testing To test the changes: 1. Create a new Wails v3 project: `wails3 init -n testapp` 2. Build it: `cd testapp && wails3 build` 3. Verify the `.desktop` file exists: `cat build/linux/testapp.desktop` Would you like me to run a test or make any additional changes? * feat(linux): generate .desktop file during build (#4575) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
561473d992 |
[V3] Refactor binding transport layer (#4702)
* custom transport initial * transport codecs * runtime set transport * events transport * clauded example * bundled runtime * wip: transport * rework transports * rework dialog responses * cleanup * cleanup * improve error handling in HTTPTransport * cleanup * cleanup * cleanup * cleanup * review changes * review changes * review changes * review changes * review changes * review changes * review changes * move documentation to website docs * update doc * update changelog * introduce JSClient method for transport for embedding JS part in transport --------- Co-authored-by: Atterpac <Capretta.Michael@gmail.com> Co-authored-by: Lea Anthony <lea.anthony@gmail.com> |
||
|
|
3087ba0bdc |
Refactor Manager API to use singular naming convention (#4367)
* Refactor Manager API to use singular naming convention This is a RENAME-ONLY exercise that converts the Wails v3 Manager API from plural to singular naming for better consistency and clarity. ## Changes Applied ### API Transformations: - `app.Windows.*` → `app.Window.*` - `app.Events.*` → `app.Event.*` - `app.ContextMenus.*` → `app.ContextMenu.*` - `app.KeyBindings.*` → `app.KeyBinding.*` - `app.Dialogs.*` → `app.Dialog.*` - `app.Menus.*` → `app.Menu.*` - `app.Screens.*` → `app.Screen.*` ### Files Updated: - **Core Application**: 22 files in `v3/pkg/application/` - **Examples**: 43+ files in `v3/examples/` - **Documentation**: 13 files in `docs/src/content/docs/` - **CLI Tests**: 1 file in `v3/internal/commands/` ### Critical Constraints Preserved: - ✅ Event string constants unchanged (e.g., "windows:WindowShow") - ✅ Platform event names preserved (events.Windows, events.Mac, etc.) - ✅ TypeScript API remains compatible - ✅ All functionality intact ### Verification: - ✅ All examples build successfully (`task test:examples` passes) - ✅ Application package compiles without errors - ✅ Documentation reflects new API patterns ## Benefits - **Improved Clarity**: Singular names are more intuitive (`app.Window` vs `app.Windows`) - **Better Consistency**: Aligns with Go naming conventions - **Enhanced Developer Experience**: Clearer autocomplete and API discovery 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix generator testcases and add cross-platform test cleanup - Update 28 generator testcase files to use singular API (app.Window.New() vs app.Windows.New()) - Add cross-platform cleanup system with Go script to remove test artifacts - Add test:all task with comprehensive testing and automatic cleanup - Fix cleanup to target files vs directories correctly (preserves source directories) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix remaining Windows CI failures by updating all plural API usage to singular Fixed the last remaining instances of old plural Manager API usage: - tests/window-visibility-test/main.go: Updated all app.Windows -> app.Window and app.Menus -> app.Menu - internal/templates/_common/main.go.tmpl: Updated app.Windows -> app.Window and app.Events -> app.Event - pkg/services/badge/badge_windows.go: Updated app.Windows -> app.Window (Windows-specific fix) These fixes address the Windows CI failures where platform-specific files still used the old API. The tests didn't catch this locally because Windows-specific files only compile on Windows. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
66ad93d9d5 |
feat: Complete App API restructuring with organized manager pattern (#4359)
* Initial refactor * More refactoring of API * Update gitignore * Potential fix for code scanning alert no. 134: Incorrect conversion between integer types Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Update v3/internal/generator/testcases/variable_single_from_function/main.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update v3/pkg/application/context_menu_manager.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update v3/pkg/application/event_manager.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update v3/pkg/application/context_menu_manager.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Fix build issues * Fix build issues * Address CodeRabbitAI review feedback: fix goroutines, error handling, and resource management - Fix infinite goroutines with proper context cancellation and ticker cleanup - Add error handling to window creation calls - Prevent unbounded slice growth in gin-service and screen examples - Use graceful shutdown patterns with app.Context().Done() 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix manager API refactor issues and complete all v3 example builds - Fixed slices import missing in event_manager.go - Changed contextMenusLock from sync.Mutex to sync.RWMutex for RLock/RUnlock compatibility - Updated all globalApplication calls to use new manager pattern (Windows.Current, Events.OnApplicationEvent, etc.) - Fixed Events.Emit vs Events.EmitEvent method signature mismatch - Corrected NewWithOptions calls (returns 1 value, not 2) in examples - Added comprehensive .gitignore patterns for all v3 example binaries - All 34 v3 examples now build successfully 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix Linux platform manager API calls - Updated events_common_linux.go: OnApplicationEvent → Events.OnApplicationEvent - Updated application_linux.go: OnApplicationEvent → Events.OnApplicationEvent - Ensures Linux builds work with new manager pattern 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix remaining NewWithOptions assignment errors in examples - Fixed badge/main.go: removed assignment mismatch and unused variable - Fixed badge-custom/main.go: removed assignment mismatch and variable reuse - Fixed file-association/main.go: removed assignment mismatch and unused variable - All examples now use correct single-value assignment for NewWithOptions() 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Implement multi-architecture Docker compilation system for Linux builds ### New Features - **Multi-Architecture Support**: Native ARM64 and x86_64 Docker compilation - **Auto-Detection**: Automatic architecture detection in Taskfile tasks - **Complete Cross-Platform Testing**: 129 builds (43 examples × 3 platforms) ### Docker Infrastructure - `Dockerfile.linux-arm64`: Ubuntu 24.04 ARM64 native compilation - `Dockerfile.linux-x86_64`: Ubuntu 24.04 x86_64 native compilation - Architecture-specific build scripts with colored output and error handling - Native compilation eliminates CGO cross-compilation issues ### Task System Updates - **New Tasks**: `test:examples:all` for complete cross-platform testing - **Architecture-Specific**: `test:examples:linux:docker:arm64/x86_64` - **Auto-Detection**: `test:example:linux:docker` detects host architecture - **Clear Parameter Usage**: Documented when DIR parameter is/isn't needed ### Build Artifacts - Architecture-specific naming: `testbuild-{example}-linux-{arch}` - ARM64: `testbuild-badge-linux-arm64` - x86_64: `testbuild-badge-linux-x86_64` ### Documentation - Complete TESTING.md overhaul with multi-architecture support - Clear command reference distinguishing single vs all example builds - Updated build performance estimates (10-15 minutes for 129 builds) - Comprehensive troubleshooting and usage examples ### Infrastructure Cleanup - Removed deprecated `Dockerfile.linux-proper` - Updated .gitignore for new build artifact patterns - Streamlined Taskfile with architecture-aware Linux tasks **Status**: Production-ready multi-architecture Docker compilation system 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix CLI appimage testfiles API migration and add to testing system ### API Migration Fixes - **Event Registration**: Updated `app.OnApplicationEvent()` → `app.Events.OnApplicationEvent()` - **Window Manager**: Updated `app.CurrentWindow()` → `app.Windows.Current()` - **Window Creation**: Updated `app.NewWebviewWindowWithOptions()` → `app.Windows.NewWithOptions()` - **Menu Manager**: Updated `app.SetMenu()` → `app.Menus.SetApplicationMenu()` - **Screen API**: Updated `app.GetPrimaryScreen()/GetScreens()` → `app.Screens.GetPrimary()/GetAll()` ### Testing System Enhancement - **New Task**: `task test:cli` for CLI-related code compilation testing - **Integration**: Added CLI testing to `task test:examples` and `task test:examples:all` - **Documentation**: Updated TESTING.md to include CLI code testing ### Files Fixed - `internal/commands/appimage_testfiles/main.go`: Complete API migration - `Taskfile.yaml`: Added CLI testing tasks and integration - `TESTING.md`: Updated documentation to reflect CLI testing This ensures CLI code API migrations are caught by our testing system and prevents future build breakages in CLI components. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Enhance testing infrastructure and fix API migration issues across v3 codebase This commit introduces comprehensive testing infrastructure to catch API migration issues and fixes all remaining compatibility problems: ## Enhanced Testing Infrastructure - Added `test:cli:all` task to validate CLI components compilation - Added `test:generator` task to test code generator test cases - Added `test:infrastructure` task for comprehensive infrastructure testing - Updated `test:examples` to include CLI testing automatically ## API Migration Fixes - Fixed manager-based API calls in window visibility test (app.Windows.NewWithOptions) - Fixed manager-based API calls in screen manager tests (sm.GetAll, sm.GetPrimary) - Fixed event registration API in 6 service test files (app.Events.OnApplicationEvent) - Updated menu API calls (app.Menus.SetApplicationMenu) ## Cross-Platform Validation - All 43 examples compile successfully on Darwin - CLI components compile without errors - Generator test cases validate correctly - Application package tests pass compilation The enhanced testing system integrates with existing GitHub Actions CI/CD and will automatically catch future API migration issues, ensuring ecosystem stability as the v3 API evolves. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix template API migration issues and add comprehensive template testing This commit resolves the GitHub Actions template generation failures by fixing API migration issues in the template source files and adding comprehensive template testing to the infrastructure. ## Template API Fixes - Fixed `app.NewWebviewWindowWithOptions()` → `app.Windows.NewWithOptions()` in main.go.tmpl - Fixed `app.EmitEvent()` → `app.Events.Emit()` in main.go.tmpl - Updated the _common template used by all framework templates (lit, react, vue, etc.) ## Enhanced Testing Infrastructure - Added `test:templates` task to validate template generation and compilation - Tests lit and react template generation with API migration validation - Integrated template testing into `test:infrastructure` task - Templates now tested alongside CLI components, generator, and application tests ## GitHub Actions Compatibility - Resolves template generation failures in CI/CD pipeline - Ensures all generated projects use correct manager-based API calls - Maintains template consistency across all supported frameworks The template testing validates that generated projects compile successfully with the new manager-based API pattern, preventing future template generation failures in GitHub Actions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Reorganize Docker testing files into test directory - Move Dockerfiles from root to test/docker/ - Update all Taskfile.yaml Docker build paths - Update TESTING.md documentation - Maintain full backward compatibility 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Address CodeRabbit review: improve resource management and API patterns - Store event handler cleanup functions for proper resource management - Fix goroutine management with context-aware cancellation patterns - Add documentation for error handling best practices - Improve API consistency across examples Examples updated: - plain: Fixed event handlers and goroutine lifecycle - badge: Added cleanup function storage - gin-example: Proper event handler management - gin-service: Service lifecycle cleanup 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Address CodeRabbit nitpicks: optimize Docker images and docs Docker Optimizations: - Add --no-install-recommends and apt-get clean for smaller images - Add SHA256 checksum verification for Go downloads - Remove unnecessary GO111MODULE env (default in Go 1.16+) - Add hadolint ignore for here-doc blocks Build Enhancements: - Add --pull flag to Docker builds for fresh base images - Improve build reliability and consistency Documentation Fixes: - Add proper language tags to code blocks (bash, text) - Fix heading formatting and remove trailing punctuation - Improve syntax highlighting and readability Files updated: - test/docker/Dockerfile.linux-arm64 - test/docker/Dockerfile.linux-x86_64 - Taskfile.yaml - TESTING.md 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Update changelog: document Manager API refactoring and improvements Breaking Changes: - Manager API Refactoring: Complete reorganization from flat structure to organized managers (Windows, Events, Dialogs, etc.) - Comprehensive API migration guide with all method mappings - References PR #4359 for full context Added: - Organized testing infrastructure in test/docker/ directory - Improved resource management patterns in examples - Enhanced Docker images with optimizations and security This documents the major architectural changes and improvements made to the Wails v3 API and development infrastructure. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Support cross-platform testing --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
fa5b486966 |
Dependency updates | ||
|
|
da99ea47b0 |
Update docs + examples.
Serve runtime from assetserver if requested. Add gin guide, fix asset server merge, add gin example adding http.CloseNotifier and http.Flusher interface to assetserver.contentTypeSniffer, for Gin (and other framework) compatibility. |