Skip to content

Releases: zigzap/zap

Release v0.1.10-pre

01 Aug 13:19
Compare
Choose a tag to compare
Release v0.1.10-pre Pre-release
Pre-release

ZAP Release v0.1.10-pre

Updates

Zig Catch-Up Release

Zig's std library introduced a few breaking changes regarding std.Build.

With this release, Zap will work with the latest zig again.

Tested with zig 0.11.0-dev.4334+928d43f61.

Using it

To use in your own projects, put this dependency into your build.zig.zon:

        // zap v0.1.10-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.10-pre.tar.gz",
            .hash = "1220a645e8ae84064f3342609f65d1c97e23c292616f5d1040cdf314ca52d7643f8a",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap v0.1.10-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.10-pre.tar.gz",
            .hash = "1220a645e8ae84064f3342609f65d1c97e23c292616f5d1040cdf314ca52d7643f8a",
        }
    }
}

Then, in your build.zig's build function, add the following before exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));

Release v0.1.9-pre

23 Jul 16:24
Compare
Choose a tag to compare
Release v0.1.9-pre Pre-release
Pre-release

ZAP Release v0.1.9-pre

Updates

Static (musl) Build Community Update

Thanks to @mattnite, zap projects can now be built using the
x64_64-linux-musl target, which enables the building static
executables for Linux. (-Dtarget=x86_64-linux-musl).

So, while I was on vacation, Matt just fixed everything with basically a
one-liner, really, really elegantly.

To me, this improvement is HUGE, as it means everybody can build
servers on their laptops, then just copy them onto a server machine or
into a (Docker) container, as a means of deployment, without having to
care about any other build environments.

Damn, I love Zig and working with clever people who dig into stuff like
musl builds. (@ed.yu also contributed a lot!).

Writing servers in Zig has paid off big time to me already, and will do
so even more now, as musl build deployments will def. speed up my
workflows.

So, thanks to y'all, it's been a great vacation, with great progess on
Zap - what more can one ask for 😊?

Using it

To use in your own projects, put this dependency into your build.zig.zon:

        // zap v0.1.9-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.9-pre.tar.gz",
            .hash = "12201e3ee597a7d9f98dc7fd19492403d754a1da101d2e678795e330c0382ff02f6a",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap v0.1.9-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.9-pre.tar.gz",
            .hash = "12201e3ee597a7d9f98dc7fd19492403d754a1da101d2e678795e330c0382ff02f6a",
        }
    }
}

Then, in your build.zig's build function, add the following before exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));

Release v0.1.8-pre

27 Jun 13:45
Compare
Choose a tag to compare
Release v0.1.8-pre Pre-release
Pre-release

ZAP Release v0.1.8-pre

Updates

Zig Compatibility Community Update

@edyu aka @ed.yu aka @loganpug has done it again!

Saved ZAP from zig std library cleanup breakages! 👍 👍 👍

  • @intCast, @alignCast, @alignOf, @prtCast, @as, @intCast, @enumFromInt, @truncate

... all have changed to a probably more consistent, in parts even more convenient, API.

Thanks for the hard work and providing a PR so quickly!

Using it

To use in your own projects, put this dependency into your build.zig.zon:

        // zap v0.1.8-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.8-pre.tar.gz",
            .hash = "1220e30645c293c943dccc9d4394f7088679cf0969c63a7f4b23f72e375744123729",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap v0.1.8-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.8-pre.tar.gz",
            .hash = "1220e30645c293c943dccc9d4394f7088679cf0969c63a7f4b23f72e375744123729",
        }
    }
}

Then, in your build.zig's build function, add the following before exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));

Release v0.1.7-pre

24 Jun 14:01
Compare
Choose a tag to compare
Release v0.1.7-pre Pre-release
Pre-release

ZAP Release v0.1.7-pre

Updates

Zig Compatibility Update

This is a first! It's a contributor-only release!

I haven't had a chance to keep up to date with recent changes in the zig standard library fast enough, because @ed.yu took care of them, almost instantly!

Thanks a lot for your PRs!!!!!!! 👍 👍 👍

The zig standard library has changed a bit recently. Zap and its examples were affected by:

  • "fromToGate" changing all aToB into bFromA function names
  • JSON parser changes
  • some weird comptime null vs. @as(fieldType, null) stuff

Thanks to our man @edyu aka @ed.yu, all of this has been taken care of!

Using it

To use in your own projects, put this dependency into your build.zig.zon:

        // zap v0.1.7-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.7-pre.tar.gz",
            .hash = "1220002d24d73672fe8b1e39717c0671598acc8ec27b8af2e1caf623a4fd0ce0d1bd",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap v0.1.7-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.7-pre.tar.gz",
            .hash = "1220002d24d73672fe8b1e39717c0671598acc8ec27b8af2e1caf623a4fd0ce0d1bd",
        }
    }
}

Then, in your build.zig's build function, add the following before exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));

Release v0.1.6-pre

30 May 08:49
Compare
Choose a tag to compare
Release v0.1.6-pre Pre-release
Pre-release

ZAP Release v0.1.6-pre

Updates

BUGFIX: setCookie() with path and/or domain

A bug in facil.io accidentally overwrote parts of the cookie header with
spaces. If a path but no domain was specified, path would be
overwritten to ath, leading to the impression that the path would be
ignored by zap. If both domain and path were specified, domain would
become main, but the path part would come later and escape the
overwriting.

My latest patch to facil.io corrects this behavior. Hence, the update.

Using it

To use in your own projects, put this dependency into your build.zig.zon:

        // zap v0.1.6-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.6-pre.tar.gz",
            .hash = "1220a3eab193523b30721dae56a763468b7348b3d1f0b3364d68f6d548c753a72c5a",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap v0.1.6-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.6-pre.tar.gz",
            .hash = "1220a3eab193523b30721dae56a763468b7348b3d1f0b3364d68f6d548c753a72c5a",
        }
    }
}

Then, in your build.zig's build function, add the following before exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));

Release v0.1.5-pre

29 May 16:23
Compare
Choose a tag to compare
Release v0.1.5-pre Pre-release
Pre-release

ZAP Release v0.1.5-pre

Updates

Weird setCookie() release build bug

This is a bugfix release. I noticed that setCookie() would always
return an error in release builds.

In trying to debug what is going on, I captured the return value of the
internal http_set_cookie call in a variable, so I could check AND log
it - instead of just checking if(http_set_cookie() == -1). Strangely
enough, the bug disappeared. Without further examination, this seems
like a bug in the current zig compiler.

Using it

To use in your own projects, put this dependency into your build.zig.zon:

        // zap v0.1.5-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.5-pre.tar.gz",
            .hash = "1220229f4418ff5a969428e2f60e138c8316d3ded0f3c0900e1f62bcb20a2f21c3df",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap v0.1.5-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.5-pre.tar.gz",
            .hash = "1220229f4418ff5a969428e2f60e138c8316d3ded0f3c0900e1f62bcb20a2f21c3df",
        }
    }
}

Then, in your build.zig's build function, add the following before exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));

Release v0.1.4-pre

27 May 22:38
Compare
Choose a tag to compare
Release v0.1.4-pre Pre-release
Pre-release

ZAP Release v0.1.4-pre

Updates

Zig Standard Library snek_case rename catch-up

The zig standard library is under snek_case attack! Every now and then
a commit lands that introduces some new renames, with the odd move into
another part of the standard library. Current example: std.debug.TTY
has been renamed to std.io.tty, which affects
zap.SimpleRequest.sendError().

Another change that only affects tooling (pkghash, announceybot) is
lower-casing of enums like std.fs.IterableDir.Entry.Kind and its
children. They have been renamed to kind, .file, .dir, etc.

So, long story short: if you don't use sendError() with latest zig
master, no need to update. Yet 😊...

Using it

To use in your own projects, put this dependency into your build.zig.zon:

        // zap v0.1.4-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.4-pre.tar.gz",
            .hash = "12204613bae513282f2b7e468045401cbae09bb19e42baeca193b9c98ff6f2ceb6ef",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap v0.1.4-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.4-pre.tar.gz",
            .hash = "12204613bae513282f2b7e468045401cbae09bb19e42baeca193b9c98ff6f2ceb6ef",
        }
    }
}

Then, in your build.zig's build function, add the following before exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));

Release v0.1.3-pre

24 May 10:07
Compare
Choose a tag to compare
Release v0.1.3-pre Pre-release
Pre-release

ZAP Release v0.1.3-pre

Updates

UserPassSessionAuth: emphermal session tokens

The UserPassSessionAuth now adds the current timestamp in nanoseconds to the hasher. -> Every successful login will create its own session cookie. A leaked cookie is pretty worthless now (unless an attacker can grab and use it in the same browser session).

Using it

To use in your own projects, put this dependency into your build.zig.zon:

        // zap v0.1.3-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.3-pre.tar.gz",
            .hash = "1220767291ec85dab33cb0f60d51aac140b36beac2a4454fcbc7254e54cc1b387245",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap v0.1.3-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.3-pre.tar.gz",
            .hash = "1220767291ec85dab33cb0f60d51aac140b36beac2a4454fcbc7254e54cc1b387245",
        }
    }
}

Then, in your build.zig's build function, add the following before exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));

Release v0.1.2-pre

23 May 23:44
Compare
Choose a tag to compare
Release v0.1.2-pre Pre-release
Pre-release

ZAP Release v0.1.2-pre

Updates

Stopping ZAP & Memory Fixes

  • UserPassSessionAuth didn't clean up properly. On top of that, the way it was implemented, made it complicated to free tokens that were created at /login time but in the map of allowed tokens already. This is now fixed. The example even shows how to scope your main function and call the gpa.detectLeaks() directly. Which is the way to go if you call zap.stop()

  • zap.stop() introduced. Execution of the main thread continues past the zap.start() call.

In other news, the build.zig script now exposes a single zig build test target that can be used to run all tests in one go. ZAP is a good zig build citizen now 😊.

In ZIG news: the TLS errors are back. I'm in contact with Andrew about that.

Once ziglang/zig#15194 is implemented, I'll see proper backtraces in the CI when building ZAP. The backtraces should help getting the TLS issues fixed.

Using it

To use in your own projects, put this dependency into your build.zig.zon:

        // zap v0.1.2-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.2-pre.tar.gz",
            .hash = "1220fd222f2f0ddcd3dbc50fae56a8be337002c1fd54e73a5ca67c379ab8955a5a02",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap v0.1.2-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.2-pre.tar.gz",
            .hash = "1220fd222f2f0ddcd3dbc50fae56a8be337002c1fd54e73a5ca67c379ab8955a5a02",
        }
    }
}

Then, in your build.zig's build function, add the following before exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));

Release v0.1.1-pre

22 May 19:24
Compare
Choose a tag to compare
Release v0.1.1-pre Pre-release
Pre-release

ZAP Release v0.1.1-pre

Updates

release workflow: add manual trigger, use announceybot.exe

Using it

To use in your own projects, put this dependency into your build.zig.zon:

        // zap v0.1.1-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.1-pre.tar.gz",
            .hash = "12206f567408318b76579ab02648412f0fe5d5aceb959503983b7e09149678cd56a7",
        }

Here is a complete build.zig.zon example:

.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap v0.1.1-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.1-pre.tar.gz",
            .hash = "12206f567408318b76579ab02648412f0fe5d5aceb959503983b7e09149678cd56a7",
        }
    }
}

Then, in your build.zig's build function, add the following before exe.install():

    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));