Skip to content

feat: extract turboapi-core shared Zig library#108

Merged
justrach merged 5 commits intomainfrom
feature/core-extraction
Mar 27, 2026
Merged

feat: extract turboapi-core shared Zig library#108
justrach merged 5 commits intomainfrom
feature/core-extraction

Conversation

@justrach
Copy link
Copy Markdown
Owner

Summary

  • Extract the radix trie router, HTTP utilities, and bounded response cache from zig/src/ into a standalone turboapi-core/ Zig library with zero dependencies
  • Wire turboAPI to import router from turboapi-core (delete zig/src/router.zig, update server.zig, main.zig, db.zig)
  • Wire merjs to import turboapi-core as a build dependency (separate repo, changes local)
  • Update README architecture section and project structure
  • Add tweet9.md for the announcement

Test plan

  • turboapi-core/: 23 tests pass including fuzz seeds (router, percent-decode, query parser, cache)
  • zig build test: all Zig unit tests pass with turboapi-core imports
  • Python test suite: 248/249 pass (1 flaky pre-existing, unrelated)
  • Performance regression benchmark: 134k req/s, 0.16ms avg — no regression
  • Example app smoke test: static, parameterized, and query string routes all work
  • merjs: zig build test passes, server boots and serves all routes

🤖 Generated with Claude Code

justrach and others added 5 commits March 27, 2026 10:56
Extract the radix trie router and HTTP utility functions from zig/src/
into a standalone turboapi-core/ library so both turboAPI (Python) and
merjs (Zig full-stack) can share the same routing and HTTP primitives.

- turboapi-core/: new zero-dep Zig library with router, http utils,
  bounded cache, and shared types (23 tests, fuzz-tested)
- zig/src/router.zig removed — now imported from turboapi-core
- zig/src/server.zig, main.zig, db.zig updated to use turboapi-core
- All 248 Python tests pass, 134k req/s benchmark unchanged

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add "Shared core" section to Architecture explaining the extraction
- Update Project Structure to show turboapi-core/ directory
- Add tweet9.md covering the shared library announcement

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@justrach justrach merged commit a1e647d into main Mar 27, 2026
6 checks passed
@justrach justrach deleted the feature/core-extraction branch April 14, 2026 01:42
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.

1 participant