Skip to content

WebFront 1.3.0

Latest

Choose a tag to compare

@ambroise-leclerc ambroise-leclerc released this 29 Nov 03:52
0fab9f8

WebFront 1.3 ships with developer environment 1.3.0. The developer environment gains inspectors of the running application
(registered functions, browsers and tasks, watches declared with app.watch, locked packages, the bridge), which an agent can
also read through MCP; one process can serve several independent users with application spaces, under a sub-path of a site;
a plain interface directory can be embedded from CMake; and the BDD framework splits into lighter headers. It has breaking
changes: Ctrl+C in the terminal, custom frontends that prove their view, the reserved webfront.inspector. names and external
tools that write the project; each entry below gives its migration.

Breaking

  • In the developer environment's terminal, Ctrl+C no longer interrupts a command nor clears the line: press Escape (with no text selected) or the terminal's Stop button; the interruption is unchanged (exit code 130, webfront.commands.cancel, the grace period of scripts, status interrupted), its messages say interrupted (#721, docs/DEVELOPER_ENVIRONMENT.md).
  • A custom frontend whose open() takes const ViewLaunch& declares static bool providesViewProof(), true when it gives the proof to its view and false otherwise, or the developer environment no longer compiles with it: undeclared, its proven view would leave project writes and C++ commands unguarded (#680, ADR-027, docs/FRONTENDS.md).
  • cppFunction (and Space::cppFunction) refuses the names starting with webfront.inspector., reserved to the inspectors, with std::invalid_argument: rename such a function, and its webFront.cppFunction(...) calls in the page, to a name of your own (#680, ADR-027).
  • An external tool that writes the project (webfront.developer.* writes) or starts terminal commands (webfront.commands.start, cancel) through the bridge is refused with webfront.inspector.denied when the frontend proves its view: run it in that view, use MCP automation, or set trustLoopbackClients knowingly (#680, ADR-027, docs/DEVELOPER_ENVIRONMENT.md).

Added

  • Copy, paste, cut and select all in the terminal of the developer environment with the system's shortcuts, Ctrl+C/V/X/A (Cmd on macOS), on CEF, WebView2, WebKitGTK, WKWebView and a system browser: they no longer become control characters, and a paste of several lines still runs them one after the other (#721, docs/DEVELOPER_ENVIRONMENT.md).
  • Open the inspectors from the WebFront tab's menu, floating in the page or detached to a native window: Functions (TypeScript signatures, calls, failures, durations; app.registeredFunctions() in C++), Browsers and tasks, Packages (the lock as a tree with wf why chains) and Bridge (webFront.ready, pending calls, rejected Promises) (#680, #681, #683, #684, ADR-027, docs/DEVELOPER_ENVIRONMENT.md).
  • Declare watches with app.watch(name, source), whose handle removes the watch, and explore them in the Watches panel as a tree refreshed while the interface runs, by pages, with a pause and the changed values highlighted; a distribution build registers nothing (#680, #682, #723, ADR-027, docs/WATCHES.md).
  • Choose how a watch reaches its object (a visitor under your lock, a reference on its executor, a copy, a source owning its state), page a large container with inspect::PagedSource, and edit a writable watch (Visit<T>) in place, applied only if the target still shows what was displayed (#682, ADR-027, docs/WATCHES.md).
  • Let an agent read the running application through MCP with the state grant (webfront.state.*: registered functions, calls to JavaScript, browsers and tasks, watches, read-only) and the locked packages with the packages grant (list, why, info, environment 1.2.1 or later) (#685, ADR-027, docs/DEVELOPING_WITH_AGENTS.md, docs/AUTOMATION.md).
  • Embed a plain interface directory (HTML, JavaScript, CSS, vendored files) from CMake with webfront_embed_directory(app ui CLASS AppUI), without the developer environment: the build regenerates the provider when a file changes, and fs::DocumentRootFirstFSWith<AppUI> lets a development root serve in front of it (#675, docs/EMBEDDED_ASSETS.md).
  • Set from the configuration Referrer-Policy (contentPolicy.referrerPolicy: "no-referrer" forbids explicitly that a capability in your URLs leaves in Referer), X-Content-Type-Options: nosniff (noSniff) and the Cache-Control of HTML pages (htmlCacheControl), on files, route and generated replies unless a reply sets its own (#674, docs/CONTENT_POLICY.md).
  • Keep a capability carried by your URLs out of WebFront's logs with app.addSecretPrefix("/s/"): the segment after the prefix is logged as * (/s/*/index.html) for files, routes, WebSocket upgrades and their failures, whose error messages are not logged (#673, docs/HTTP_ASSETS.md).
  • Serve several independent users from one process with application spaces: app.spaces("/s/", resolver) gives each /s/<id>/ its own cppFunctions, page handlers, broadcasts and routes (WebFront::Space) and tells the application when its last page closes; ui.path() gives the path from which a browser opened its bridge (#671, #672, docs/SPACES.md).
  • Write tests with lighter headers and richer checks: <webfront/testing/bdd/Core.hpp> and only the parts a file uses, checkEqual/requireEqual reporting both operands (webfront::bdd::Printer for your types), approx(v) with .epsilon() and .margin(), and a runEnding listener called before the summary and the JUnit report (#669, docs/BDD.md).
  • The test helpers, webfront_add_jasmine_test included, export the real XDG_DATA_HOME and XDG_CACHE_HOME as WEBFRONT_TEST_REAL_XDG_DATA_HOME and WEBFRONT_TEST_REAL_XDG_CACHE_HOME, so an application under test can keep the throwaway WebKitGTK profile away from the programs it starts (#664, docs/CONSUMER_TESTING.md).

Changed

  • Detach and attach an inspector panel with small icons, a frame with an arrow leaving it or entering it, instead of the Detach and Attach words; their tooltip and accessible name say the action, and a greyed detach icon still says why (#722, docs/DEVELOPER_ENVIRONMENT.md).
  • wf test stopped at its time limit or by an interruption says how far its runner got, in its message and in the report's new stage: the last step reached, the spec in progress, and the runner files that never finished loading (#690, docs/DEVELOPER_ENVIRONMENT.md).
  • Destroying the handle of a watch (inspect::Watch) waits for an operation of the inspectors in progress on another thread: destroy it outside every lock its source takes, or declare the watch with the state it owns (#682, ADR-027, docs/WATCHES.md).
  • cppFunction and Space::cppFunction take a last, defaulted std::source_location, which the inspectors show; existing calls compile unchanged, the explicit cppFunction<R, Args...> form included (#681, ADR-027).
  • Document the security contract of the application's callbacks: one that writes the project or what the server serves, starts a process or exposes a sensitive state takes the calling UI and checks ui.isLocalClient(), since WebFront guards only its own functions (#686, ADR-027, docs/DEVELOPING_WITH_AGENTS.md).
  • WebFront.js opens its WebSocket on the directory of the page (ws://host/dir/ instead of ws://host), which tells the server a page's space (#671) and lets an application be deployed under a sub-path of a site (#672).
  • A file request whose path holds a control character (%00...) is refused with 400, as a .. already was, and a + in its path is a literal +, as for the routes, the spaces and ui.path(): /a+b.html serves a+b.html, which /a%20b.html no longer shares (#672).

Fixed

  • A client connected to the MCP listener when it closes, because the session closed or the application stopped, and completes its request within a second reads its answer (a closed session says so) instead of a connection reset; a request that arrived just before its peer's two-second deadline is served rather than reset (#720, docs/AUTOMATION.md).
  • A closed secondary window disconnects at once, its WKWebView page closed explicitly and never suspended while inactive on macOS 14+, its WebView2 page navigated to about:blank first, and a WebView2 one opened while the first starts waits for its load (#681, #702, #708, #716, docs/WKWEBVIEW.md, docs/WEBVIEW2.md).
  • A WKWebView page whose web content process ends says why: its memory or CPU limit, the application's request, or a crash of the WebKit engine, which DeveloperBrowserIntegration-jasmine met on the macOS runner while esbuild ran in its Worker, instead of only that the process terminated (#706, docs/WKWEBVIEW.md).
  • webfront.session names the native deadline that revoked a session (revocation: operation-deadline or startup-deadline, empty otherwise), and Session::revokedBy() gives it in C++: AutomationMcpWatchdog no longer fails when the window closes after the deadline, since its host recognised only a reason that the deadline never wrote (#709, docs/AUTOMATION.md).
  • An invalid content policy (an origin of bridgeAllowedOrigins or navigationAllowedOrigins, a referrerPolicy, a htmlCacheControl) throws std::invalid_argument before the server binds its port, as documented, instead of an "address already in use" error when that port is taken (#674).
  • Browser tests that a loaded runner failed: CEFLifecycle-navigation-allow-list counts only the cancellation of its own navigation (#731), WebFrontBrowserIntegration on CEF has 120 s and a wf test stopped by the driver's limit names the stage it reached (#730), and DeveloperBrowserIntegration-workspace gives the relaunched page 60 s to start and to draw its collapsed terminal's prompt (#660, #729).
  • Applications started from the terminal of a Snap-packaged editor (VSCodium) now run on WebKitGTK without cleaning the environment by hand; WEBFRONT_KEEP_SNAP_ENVIRONMENT=1 opts out (#662, docs/WEBKITGTK.md).

Security

  • Require an admitted client for developer project writes and native terminal commands when the frontend proves its view (ADR-027, #680).