wails icon indicating copy to clipboard operation
wails copied to clipboard

Migrate the v3 Windows runtime from pkg/edge to the generated pkg/webview2 bindings

Open taliesin-ai opened this issue 4 months ago • 2 comments

Goal

Migrate the Wails v3 Windows runtime from the hand-maintained pkg/edge bindings to the generated pkg/webview2 bindings, then retire pkg/edge.

Background

PR #5768 landed the overhauled binding generator and the generated bindings at v3/internal/webview2/pkg/webview2 (following the module fold #5711). Those bindings are currently dormant — nothing in the runtime imports them; the runtime still drives WebView2 entirely through pkg/edge + webviewloader.

The generated bindings are validated at their own layer (100%-covered generator, 1,020+ hermetic ABI tests, a live smoke test against the real DLL, and three example apps), but they have not been exercised as the production WebView2 driver.

Plan (from v3/internal/webview2/ARCHITECTURE.md)

  1. ~~Land the generator + tested pkg/webview2~~ — done in #5768.
  2. Refactor v3/pkg/application/... (chromium.go and friends) to import pkg/webview2 instead of pkg/edge.
  3. Carry forward the pkg/edge runtime behaviour that the generator does not produce (it emits bindings, not orchestration/policy):
    • transient COM-error recovery (#5658)
    • non-fatal SetSize/PutBounds (#5597)
    • Focus() guard until controller init (#5568)
    • mixed-DPI monitor-scale detection (#5734)
    • non-client-region / custom hit-test support (#5462) and host-owned rasterization scale (#5761)
    • the by-value-double ABI fix (#5741) is already correct-by-construction in the generated bindings.
  4. Once the runtime is on pkg/webview2, move/remove pkg/edge.

Testing considerations

  • Fix the flaky pkg/edge integration test TestCookieManager while migrating (it CoInitializes without runtime.LockOSThread(), so a goroutine thread-migration mid-test yields "CoInitialize has not been called" and hangs to the 10-minute timeout — observed on CI).
  • Add real-DLL coverage across more than the handful of interfaces the live smoke test exercises today.

taliesin-ai avatar Jul 08 '26 22:07 taliesin-ai

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 10 days.

If this issue is still relevant, please add a comment to keep it open. Thank you for your contributions.

github-actions[bot] avatar Aug 23 '26 01:08 github-actions[bot]

This issue has been automatically closed due to lack of activity. Please feel free to reopen it if it's still relevant.

github-actions[bot] avatar Sep 03 '26 01:09 github-actions[bot]