gui: native WebView host as nested module yetano.dev/yetano/core/gui
Extracted from prototypes/yetano-webview (AP1): packages assets, document, bridge and window (macOS Cocoa/WKWebView via cgo, Windows Win32/WebView2 pure Go). No local HTTP listener or port: assets go through the WebView's resource handler, app routes through the native message binding. Own go.mod and gui/vX.Y.Z tags keep cgo and the WebView dependencies out of the main core module. Adds backend-free tests for the window's dispatch/destroy guards and a yet-gui migration guide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
90132e2d76
commit
8c63d42a27
27 files changed
+4849
-3
No files matched your search
+23
@@ -0,0 +1,23 @@
|
||||
// Package gui is the native WebView host shared by Yetano desktop
|
||||
// programs: a native window with a WebView that shows embedded HTML/CSS/JS
|
||||
// and routes the page's fetch/XHR to Go handlers -- without any local web
|
||||
// server, port or localhost listener.
|
||||
//
|
||||
// The host lives in four subpackages:
|
||||
//
|
||||
// - [yetano.dev/yetano/core/gui/assets]: asset resolver over embed.FS,
|
||||
// a directory (os.Root), a ZIP file or ZIP bytes; path rules, MIME.
|
||||
// - [yetano.dev/yetano/core/gui/document]: prepares the entry HTML and
|
||||
// CSS (link mode: /assets/ URLs, validated; inline mode: data: URLs).
|
||||
// - [yetano.dev/yetano/core/gui/bridge]: the page script (fetch/XHR
|
||||
// replacement), protocol v1 with chunked streams, Session, Router and
|
||||
// ServeNative for the native resource handler.
|
||||
// - [yetano.dev/yetano/core/gui/window]: the native window: macOS
|
||||
// (Cocoa + WKWebView, cgo, scheme yetano://app) and Windows (Win32 +
|
||||
// WebView2, pure Go, https://yetano.invalid). Other platforms return
|
||||
// window.ErrUnsupported.
|
||||
//
|
||||
// This is a separate Go module (yetano.dev/yetano/core/gui, tags gui/vX.Y.Z)
|
||||
// so the main core module stays free of cgo and WebView dependencies. See
|
||||
// README.md for wiring, invariants and the platform pitfalls.
|
||||
package gui
|
||||
Reference in new issue
Block a user