Add application startup lifecycle events for responsive splash screens
Problem
Service startup may take long enough that an application needs to display a responsive splash screen. Today services start before the native event loop, so a Wails window cannot render or remain interactive during that work.
Proposed lifecycle
- Enter the native platform event loop.
- Emit
events.Common.ApplicationStartingonce native window operations are available. - Run the existing
ServiceStartupmethods sequentially on a background startup goroutine. - Emit
events.Common.ApplicationInitializedonly after every service starts successfully. - Release pending application windows.
This does not change the service API and does not introduce a special splash-window concept. Applications create hidden windows and decide which window to show from lifecycle listeners.
Acceptance criteria
- The native UI event loop remains responsive during a blocking
ServiceStartup. ApplicationStartinglisteners run before service startup begins.ApplicationInitializedis emitted only after successful service startup.- Startup errors cancel and shut down already-started services without deadlock.
- Hidden pre-created windows can be shown from
ApplicationStarting. - Include a runnable
v3/examples/splashscreenexample. - Preserve sequential service startup and reverse-order shutdown.
Scope
This is a general v3 feature and is not proposed as a v3 beta blocker.
wailsapp/wails#3920 - [V3] Rework service.OnStartup to close application on error [merged]
wailsapp/wails#4435 - fix: prevent crash when closing window with pending async calls [merged]
wailsapp/wails#5192 - fix(linux): fix race conditions and deadlocks in event handling [merged]
wailsapp/wails#5757 - fix(v3): guarantee event dispatch order under rapid Emit() bursts [open]
wailsapp/wails#5828 - fix: dev frontend readiness [open]๐ Related PRs
๐ Issue Planner
Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.
- [ ] Create Plan
๐งช Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your .coderabbit.yaml:
issue_enrichment:
auto_enrich:
enabled: false
๐ฌ Have feedback or questions? Drop into our discord!
Hi there! Thanks for the suggestion. I'll leave this open for us to consider when planning future work.