You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/PURE_ZIG_REFACTOR.md
+88-3Lines changed: 88 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -247,9 +247,9 @@ protocol input never panics.
247
247
248
248
### 5. Delete the old implementation and publish a breaking release
249
249
250
-
-Delete`src/c.zig`, compatibility tuple files, and all C ABI tests.
251
-
- Migrate retained examples and delete duplicate examples that only demonstrate
252
-
the old API.
250
+
-Deleted`src/c.zig`, `src/webui.zig`, `src/tests.zig`, both compatibility
251
+
tuple files, and the legacy examples.
252
+
- Retain the pure Zig minimal example.
253
253
- Document only the new API and lifecycle in the README.
254
254
- Publish a new major or alpha release. Naming can be decided then and does not
255
255
block implementation.
@@ -272,6 +272,91 @@ protocol input never panics.
272
272
|`interface*`| Delete |
273
273
|`newWindowWithId()`| Delete; `App` owns IDs |
274
274
275
+
## Upstream WebUI API Coverage Ledger
276
+
277
+
This ledger tracks upstream WebUI `2.5.0-beta.4` capabilities independently
278
+
of the implementation phases. Upstream C names are identifiers for
279
+
traceability, not a commitment to reproduce the C API shape in Zig.
280
+
Coverage is determined only from `src/root.zig` and its reachable pure Zig
281
+
modules. Deleted legacy wrapper, test, and example files do not count as
282
+
implementations.
283
+
284
+
### Missing or Partial Backend Capabilities
285
+
286
+
| Upstream API | Current gap |
287
+
|---|---|
288
+
|`webui_bind()`|`Window.bind` supports explicit `webui.call()` calls, but the bridge does not automatically dispatch DOM events from an element with the same ID to that binding. |
289
+
|`webui_get_float()`, `webui_get_float_at()`|`Call.float()` is not implemented. |
290
+
|`webui_return_float()`, `webui_return_bool()`|`Call.reply()` can encode these values as text, but typed `replyFloat()` and `replyBool()` helpers are not implemented. |
291
+
|`webui_show()`, `webui_set_root_folder()`, `webui_set_file_handler()`, `webui_set_file_handler_window()`| Content and resource handling can only be selected when creating a window; replacing them at runtime is not implemented. |
292
+
|`webui_show_client()`|`Client` cannot replace the content of only one connected browser. |
293
+
|`webui_is_shown()`| There is no window-level connected/shown query. |
294
+
|`webui_set_config(asynchronous_response)`| A `Call` response must be completed during the binding handler lifetime. |
295
+
|`webui_set_config(show_wait_connection)`, `webui_set_timeout()`|`Window.open()` does not optionally wait for a browser connection. |
296
+
|`webui_set_config(ui_event_blocking)`, `webui_set_event_blocking()`| Per-window event scheduling control is not exposed. |
297
+
|`webui_set_config(folder_monitor)`| Directory change monitoring and automatic browser reload are not implemented. |
298
+
|`webui_set_config(use_cookies)`| Client authorization uses capability URLs; optional cookie-based authorization is not implemented. |
299
+
|`webui_set_default_root_folder()`| There is no application-wide default directory content setting. |
300
+
|`webui_set_logger()`| There is no caller-provided logging callback. |
301
+
|`webui_set_icon()`, `webui_set_icon_file()`| Window icon configuration is not implemented. |
302
+
|`webui_open_url()`| The internal OS URL opener is not exposed as a general public API. |
303
+
|`webui_get_best_browser()`, `webui_browser_exist()`, `webui_show_browser()`, `webui_set_browser_folder()`| Browser discovery, selection, and custom executable locations are not implemented. |
304
+
|`webui_set_custom_parameters()`| Custom browser command-line arguments are not implemented. |
305
+
|`webui_set_kiosk()`, `webui_focus()`, `webui_minimize()`, `webui_maximize()`, `webui_set_hide()`| Browser window mode and lifecycle controls are not implemented. |
306
+
|`webui_set_resizable()`, `webui_set_size()`, `webui_set_minimum_size()`, `webui_set_position()`, `webui_set_center()`| Browser window geometry controls are not implemented. |
307
+
|`webui_set_frameless()`, `webui_set_transparent()`| Frameless and transparent browser window modes are not implemented. |
308
+
|`webui_set_high_contrast()`, `webui_is_high_contrast()`| High-contrast mode control and detection are not implemented. |
309
+
|`webui_set_profile()`, `webui_delete_profile()`, `webui_delete_all_profiles()`| Managed browser profiles are not implemented. |
310
+
|`webui_set_proxy()`| Browser proxy configuration is not implemented. |
311
+
|`webui_get_parent_process_id()`, `webui_get_child_process_id()`| Browser process tracking is not implemented. |
312
+
|`webui_set_public()`| A guarded public-listening option with Origin validation and explicit limits is not implemented. |
313
+
|`webui_set_tls_certificate()`| Caller-provided TLS certificate and private-key configuration is not implemented. |
314
+
|`webui_set_runtime()`| Deno, Node.js, and Bun execution for served files is not implemented. |
315
+
|`webui_show_wv()`, `webui_set_close_handler_wv()`, `webui_get_hwnd()`, `webui_win32_get_hwnd()`| Native WebView hosting and native window handles are outside the pure Zig browser core. |
316
+
317
+
### Missing Browser Bridge APIs
318
+
319
+
The current browser object implements `webui.call()` and
320
+
`webui.isConnected()`. These upstream bridge APIs are not implemented:
321
+
322
+
| Upstream bridge API | Current gap |
323
+
|---|---|
324
+
|`webui.setLogging()`| Runtime bridge logging control is not exposed. |
325
+
|`webui.setEventCallback()` and `webui.event`| Browser-side connected and disconnected callbacks are not exposed. |
326
+
|`webui.isHighContrast()`| Browser-side high-contrast detection is not exposed. |
327
+
|`webui.allowNavigation()`| Navigation interception cannot be changed by browser JavaScript at runtime. |
328
+
329
+
`webui.encode()` and `webui.decode()` are intentionally replaced by the
330
+
browser's `btoa()` and `atob()` functions. The upstream bridge's
331
+
`callCore()` method remains an internal implementation detail.
332
+
333
+
### Intentional Zig Replacements
334
+
335
+
The following upstream methods are covered by the current Zig design and are
336
+
not implementation gaps:
337
+
338
+
| Upstream API | Zig replacement |
339
+
|---|---|
340
+
|`webui_new_window()`, `webui_new_window_id()`, `webui_get_new_window_id()`|`App.createWindow()` and application-owned IDs. |
|`webui_set_port()`, `webui_get_port()`, `webui_get_free_port()`|`App.Options.port`, including `0` for automatic selection, and the running window URL. |
354
+
|`webui_set_root_folder()`, `webui_set_file_handler()`, `webui_set_file_handler_window()`, `webui_return_http()`| Initial `.directory` or `.custom` content and `Response`. Runtime replacement remains listed above. |
355
+
|`webui_get_mime_type()`| Linsang resource handling. |
356
+
|`webui_encode()`, `webui_decode()`, `webui_malloc()`, `webui_free()`, `webui_memcpy()`| Zig standard library and allocators. |
0 commit comments