Skip to content

feat(examples): add comprehensive WebUI Zig showcase#106

Merged
jinzhongjia merged 10 commits into
mainfrom
new_example
Jul 21, 2025
Merged

feat(examples): add comprehensive WebUI Zig showcase#106
jinzhongjia merged 10 commits into
mainfrom
new_example

Conversation

@jinzhongjia

Copy link
Copy Markdown
Member
  • introduce a new comprehensive example demonstrating user management, messaging, file upload (with Unicode filename support), settings, performance testing, and more
  • add a rich interactive HTML dashboard with advanced UI and JavaScript for real-time status, notifications, and activity log
  • implement robust Zig backend with state tracking, safe file handling, and multi-client support
  • update .gitignore to exclude generated example files
  • fix setBrowserFolder signature in webui.zig for consistency

- introduce a new comprehensive example demonstrating user management, messaging, file upload (with Unicode filename support), settings, performance testing, and more
- add a rich interactive HTML dashboard with advanced UI and JavaScript for real-time status, notifications, and activity log
- implement robust Zig backend with state tracking, safe file handling, and multi-client support
- update .gitignore to exclude generated example files
- fix setBrowserFolder signature in webui.zig for consistency
- introduce event_handling example with multi-client HTML UI and Zig backend
- demonstrate user session management, click tracking, messaging, and event monitoring
- implement advanced context management and interface event binding in Zig
- fix(c): specify C calling convention for webui_interface_bind callback
- refactor(webui): make interfaceBind return !usize and propagate bind errors
- introduce js_execution example with Zig and JavaScript interop
- implement advanced JS execution, data exchange, DOM manipulation, and raw data transfer
- update C and Zig bindings for send_raw to use *const anyopaque for improved type safety
- introduce a comprehensive window management example with Zig and HTML
- demonstrate window controls, kiosk mode, multi-window handling, and browser info
- implement Zig bindings for window operations and client communication
- add interactive UI with real-time info and user feedback
- fix minor indentation in webui.zig for consistency
- use Zig optional binding to handle null pointers from C functions
- ensure proper error return when encoding or decoding fails
- bump webui hash and URL to fea4ae1e for dependency update
- ensure compatibility with latest webui changes
- replace deprecated .C callconv with .c in all extern function declarations in src/c.zig
- update internal Zig handlers and bindings to use .c callconv in src/webui.zig
- adjust build.zig to maintain compatibility with Zig 0.14 and earlier versions
- replace deprecated allocPrintZ with allocPrintSentinel in multi-client web app example
- ensure proper formatting and memory management for generated JavaScript
- use allocPrintZ for JS string formatting when Zig 0.14 is detected
- maintain compatibility with previous Zig versions using allocPrintSentinel
@AlbertShown

Copy link
Copy Markdown
Member

This is a great update, great job @jinzhongjia 👍
I should copy your examples to the C repo 😃

@jinzhongjia

Copy link
Copy Markdown
Member Author

To be honest, these examples are all about Ai, I just wrote down below

@AlbertShown

Copy link
Copy Markdown
Member

This is clever, and by the way, we will soon train and create a GPT for webui-zig like we did for webui-c GPT.

@jinzhongjia

Copy link
Copy Markdown
Member Author

When I was writing this, I encountered that the C library could not handle too many events, which would cause a crash

I'll try to fix the issue this week

- change webui source URL to latest commit archive
- ensure build uses updated webui version
@jinzhongjia jinzhongjia merged commit 21f14c9 into main Jul 21, 2025
7 checks passed
@AlbertShown

Copy link
Copy Markdown
Member

I encountered that the C library could not handle too many events

call_js_from_c is a stress test example to send event every 10 milliseconds from backend to frontend, it's working fine.
I think we should create a new one from frontend to backend.

Note:
ui_event_blocking is very important, it should be set depending on project's needs.

@jinzhongjia jinzhongjia deleted the new_example branch August 1, 2025 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants