zap icon indicating copy to clipboard operation
zap copied to clipboard

Broken instalation?

Open BezBartek opened this issue 8 months ago • 4 comments

Running: zig fetch --save "git+https://github.com/zigzap/zap#v0.10.1"

gives me:

.dependencies = .{
        .zap = .{
            .url = "git+https://github.com/zigzap/zap?ref=v0.10.1#8d187310c7ee4f86faa7ef0ecdac0bf747216dea",
            .hash = "zap-0.9.1-GoeB84M8JACjZKDNq2LA5hB24Z-ZrZ_HUKRXd8qxL2JW",
        },
    },

And I can see, that files that are added from ZAP to my project, do not match 0.10.1 (for example App.zig is totally different, 438 lines vs 487 lines

It seems that it install 0.9.1 instead of 0.10.1, why?

BezBartek avatar Apr 28 '25 16:04 BezBartek

Yeah, I know. Need to fix it but didn't have time. It isn't really broken. It's just that I forgot to update the build.zig.zon version when creating the git tag. 

When you fetch 10.1 you get 10.1; it just appears as zap-0.9.1- XXXXX... in your build.zig.zon. 

I found a way to use the build.zig.zon version at runtime, for version reporting. Once that's in place, it should be much harder to forget (can even be checked in CI).

renerocksai avatar Apr 28 '25 16:04 renerocksai

@renerocksai but, If I am rly using 0.10.1, I should be able to add "unhandledRequest" on Context. which do not work in my case (i have another issue, that i am unable to add 404 for unhandled requests)

It even do not check signature, I mean there is no compile exception, if I provide wrong method signature. There should be an exception, if it is 0.10.1

BezBartek avatar Apr 28 '25 19:04 BezBartek

unhandledRequest and unhandledError are only checked if they are present in the Context. The signature check is in App.zig, at line 345.

See the examples/app/errors.zig example. There the MyContext defines an empty unhandledRequest method.

AAAAAAAH! I see what's happening!

If you look at the v0.10.1 tag, the error and uncaught handler aren't there, as is the errors example.

That's because that's part of the upcoming 0.10.2 -- work I had to interrupt because of professional workload interfering.

I hope I'll get to cut a release 0.10.2 within the next few days. Need to stash away a lot of work that should eliminate the need to stub-out 'non-implemented' endpoint methods.

renerocksai avatar Apr 29 '25 07:04 renerocksai

master is currently WIP

renerocksai avatar Apr 29 '25 07:04 renerocksai