webui-dev / webui

Use any web browser or WebView as GUI, with your preferred language in the backend and HTML5 in the frontend, all in a lightweight portable lib.
https://webui.me
MIT License
2.36k stars 144 forks source link

[Update]: update to zig nightly 0.13 support #349

Closed jinzhongjia closed 2 months ago

jinzhongjia commented 2 months ago

No changes for code logic, just adapt to zig nightly

Now, zig 0.12 has been released, zig nightly is 0.13

And I need some test for this PR!

jinzhongjia commented 2 months ago

OK, I have test, I think all things are ok! Can you approve this PR? @neroist

ttytm commented 2 months ago

Wheres the issue with using one build file? To me it looks similar to the zig-webui workfows lots of redundancies. Imho it could be simpler to read and maintain when putting some effort into more intelligent code design and structure

jinzhongjia commented 2 months ago

Wheres the issue with using one build file? To me it looks similar to the zig-webui workfows lots of redundancies. Imho it could be simpler to read and maintain when putting some effort into more intelligent code design and structure

I separated the build files to ensure compatibility and maintainability, because zig's build system api has changed a bit in the last two versions, making it easy to break the availability of the other versions when updating the logic if we put all the code in one file once nightly changes

As for the zig-webui workflows, I copied the webui exactly

jinzhongjia commented 2 months ago

Of course, my current design does have redundancy, so maybe I should just say that they are divided into two files

jinzhongjia commented 2 months ago

The benefit of the current scheme is that I only need to update 0.13. Now 0.13 is same as 0.12, but I'm not sure whether zig's build system api will change After all, it hasn't released 1.0 yet

jinzhongjia commented 2 months ago

Wheres the issue with using one build file? To me it looks similar to the zig-webui workfows lots of redundancies. Imho it could be simpler to read and maintain when putting some effort into more intelligent code design and structure

Very good, I have now found a way to solve the above problem. We only need to keep a build.zig later to ensure 0.11 compatibility. zig adds the ability to use C packages non-invasively in 0.12