Skip to content

Commit 6dc6bdc

Browse files
committed
Upgrade to Zig 0.15.1
1 parent e0e7271 commit 6dc6bdc

34 files changed

+2504
-175
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Install Zig
2121
uses: goto-bus-stop/setup-zig@v2
2222
with:
23-
version: '0.14.1'
23+
version: '0.15.1'
2424

2525
- name: Install System Dependencies
2626
run: |

.github/workflows/lints.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Install Zig
2828
uses: goto-bus-stop/setup-zig@v2
2929
with:
30-
version: '0.14.1'
30+
version: '0.15.1'
3131

3232
- name: Install Dependencies
3333
run: |

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Install Zig
2828
uses: goto-bus-stop/setup-zig@v2
2929
with:
30-
version: '0.14.1'
30+
version: '0.15.1'
3131

3232
- name: Install Dependencies
3333
run: |

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,4 @@ uv.lock
9797
*_output.txt
9898
public/
9999
site/
100+
*.a

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ################################################################################
22
# # Configuration and Variables
33
# ################################################################################
4-
ZIG ?= $(shell which zig || echo ~/.local/share/zig/0.14.1/zig)
4+
ZIG ?= $(shell which zig || echo ~/.local/share/zig/0.15.1/zig)
55
BUILD_TYPE ?= Debug
66
BUILD_OPTS = -Doptimize=$(BUILD_TYPE)
77
JOBS ?= $(shell nproc || echo 2)

README.md

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,72 @@
88

99
[![Tests](https://img.shields.io/github/actions/workflow/status/CogitatorTech/helium/tests.yml?label=tests&style=flat&labelColor=282c34&logo=github)](https://github.com/CogitatorTech/helium/actions/workflows/tests.yml)
1010
[![CodeFactor](https://img.shields.io/codefactor/grade/github/CogitatorTech/helium?label=code%20quality&style=flat&labelColor=282c34&logo=codefactor)](https://www.codefactor.io/repository/github/CogitatorTech/helium)
11-
[![Zig Version](https://img.shields.io/badge/Zig-0.14.1-orange?logo=zig&labelColor=282c34)](https://ziglang.org/download/)
11+
[![Zig Version](https://img.shields.io/badge/Zig-0.15.1-orange?logo=zig&labelColor=282c34)](https://ziglang.org/download/)
1212
[![Docs](https://img.shields.io/github/v/tag/CogitatorTech/helium?label=docs&color=blue&style=flat&labelColor=282c34&logo=read-the-docs)](https://habedi.github.io/helium/)
1313
[![Examples](https://img.shields.io/github/v/tag/CogitatorTech/helium?label=examples&color=green&style=flat&labelColor=282c34&logo=zig)](https://github.com/CogitatorTech/helium/tree/main/examples)
1414
[![Release](https://img.shields.io/github/release/CogitatorTech/helium.svg?label=release&style=flat&labelColor=282c34&logo=github)](https://github.com/CogitatorTech/helium/releases/latest)
1515
[![License](https://img.shields.io/badge/license-MIT-007ec6?label=license&style=flat&labelColor=282c34&logo=open-source-initiative)](https://github.com/CogitatorTech/helium/blob/main/LICENSE)
1616

17-
A lightweight web framework for Zig
17+
A lightweight, fast web framework for Zig
1818

1919
</div>
2020

2121
---
2222

23-
Helium is a small, asynchronous web framework for Zig programming language.
24-
Its goal is to make it easy to build fast and efficient web applications and services in Zig.
23+
Helium is a small, configurable web framework for Zig programming language.
24+
It provides the basic building blocks for creating fast and efficient web applications and services in Zig by composing
25+
a set of reusable components.
26+
Helium follows a micro-framework design philosophy, with a small core feature set that could be extended via optional
27+
middleware and utilities.
2528

26-
### Features
29+
- **Nothing Hardcoded**: All features are opt-in and configurable
30+
- **Composable**: Build your application from small, reusable components
31+
- **Flexible**: Use what you need, ignore what you don't
32+
- **Minimal Core**: A small, focused API that doesn't get in your way
33+
- **Zero Magic**: Explicit and predictable behavior
2734

28-
- Full asynchronous operations support
29-
- Cross-platform compatibility
30-
- JSON and CBOR support
31-
- Cookie management and optional session-based authentication mechanism
32-
- Flexible middleware support (route-specific and global)
33-
- Express.js-like routing mechanism
35+
### Core Features
36+
37+
**Routing & Request Handling**
38+
39+
- Express.js-like routing with HTTP method support (GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS)
40+
- Dynamic route parameters (e.g., `/users/:id`)
41+
- Query parameter parsing
42+
- Route grouping with shared prefixes
43+
- Request body parsing
44+
45+
**Middleware System**
46+
47+
- Global middleware applied to all routes
48+
- Group-scoped middleware for route collections
49+
- Route-specific middleware chains
50+
- Custom middleware support with simple function signatures
51+
52+
**Server Modes**
53+
54+
- Thread pool mode for high concurrency
55+
- Minimal thread pool with event-driven I/O
56+
- Configurable worker thread counts
57+
58+
**Built-in Utilities** (all optional)
59+
60+
- **CORS middleware**: Cross-origin resource sharing (allow-all)
61+
- **Static file serving**: Secure file server with path traversal protection
62+
- **Logging middleware**: Common log format with timing information
63+
- **JSON responses**: Built-in JSON serialization support
64+
65+
**Flexibility**
66+
67+
- Generic context type for application state
68+
- Custom error handlers per application
69+
- Memory allocator control
70+
- Type-safe handler functions
71+
72+
See the [ROADMAP.md](ROADMAP.md) for the list of implemented and planned features.
73+
74+
> [!IMPORTANT]
75+
> Helium is in early development, so bugs and breaking changes are expected.
76+
> Please use the [issues page](https://github.com/CogitatorTech/Helium/issues) to report bugs or request features.
3477
3578
---
3679

ROADMAP.md

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
## Helium Web Framework Roadmap
2+
3+
This document outlines the development roadmap for Helium, a lightweight, configurable micro web framework for Zig.
4+
5+
> [!IMPORTANT]
6+
> This roadmap is a living document and may change based on community feedback and evolving needs.
7+
8+
### Philosophy & Design Goals
9+
10+
Helium is designed as a **micro-framework** with these core principles:
11+
- **Configurability First**: Nothing is hardcoded; everything is opt-in and customizable
12+
- **Minimal Core**: Keep the core API small and focused
13+
- **Composability**: Features should be independent and composable
14+
- **Zero Magic**: Explicit, predictable behavior without hidden abstractions
15+
- **Performance**: Efficient use of resources with multiple concurrency models
16+
17+
---
18+
19+
### ✅ Implemented Features
20+
21+
#### Core Framework
22+
- [x] Generic `App` type with custom context support
23+
- [x] Type-safe request handlers and middleware
24+
- [x] Configurable memory allocator per application
25+
- [x] Custom error handler support
26+
- [x] Multi-mode server (thread pool and event-driven I/O)
27+
28+
#### Routing System
29+
- [x] Express.js-like routing API
30+
- [x] HTTP method support (GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS)
31+
- [x] Dynamic route parameters (e.g., `/users/:id`)
32+
- [x] Query parameter parsing
33+
- [x] Route grouping with shared path prefixes
34+
- [x] Tree-based router for efficient path matching
35+
36+
#### Middleware System
37+
- [x] Global middleware (applied to all routes)
38+
- [x] Group-scoped middleware (applied to route groups)
39+
- [x] Route-specific middleware chains
40+
- [x] Middleware composition with `next()` pattern
41+
- [x] Type-safe middleware signatures
42+
43+
#### Built-in Utilities
44+
- [x] CORS middleware (allow-all origins)
45+
- [x] Static file server with path traversal protection
46+
- [x] Common log format middleware with timing
47+
- [x] JSON response helpers
48+
49+
#### Request/Response
50+
- [x] Request parameter access (path params, query params)
51+
- [x] Request body string access
52+
- [x] Response status code setting
53+
- [x] Response header management
54+
- [x] JSON response serialization
55+
- [x] Plain text responses
56+
57+
---
58+
59+
### 📋 Planned Features
60+
61+
#### 1. Enhanced Routing
62+
- [ ] Route wildcards (e.g., `/files/*`)
63+
- [ ] Route matching with regular expressions
64+
- [ ] Route priority/ordering control
65+
- [ ] Nested route groups
66+
- [ ] Route metadata and tagging
67+
- [ ] Automatic OPTIONS handling per route
68+
69+
#### 2. Request Handling
70+
- [ ] Multipart form data parsing
71+
- [ ] File upload handling
72+
- [ ] Request body size limits (configurable)
73+
- [ ] Content negotiation helpers
74+
- [ ] Cookie parsing and setting
75+
- [ ] Request validation helpers
76+
- [ ] Custom body parsers (pluggable)
77+
78+
#### 3. Response Enhancements
79+
- [ ] Response streaming API for large payloads
80+
- [ ] Request body streaming for file uploads
81+
- [ ] Template rendering support (pluggable)
82+
- [ ] Response compression (gzip, deflate, brotli)
83+
- [ ] ETag support for caching
84+
- [ ] Conditional requests (If-None-Match, If-Modified-Since)
85+
- [ ] Server-Sent Events (SSE) support
86+
- [ ] Chunked transfer encoding
87+
88+
#### 4. Middleware Ecosystem
89+
- [ ] Configurable CORS middleware (custom origins, methods, headers)
90+
- [ ] Rate limiting middleware
91+
- [ ] Authentication middleware (JWT, Bearer, Basic Auth)
92+
- [ ] Session management middleware
93+
- [ ] Cookie parsing and management
94+
- [ ] Request ID tracking
95+
- [ ] Body parser middleware (JSON, form-urlencoded, multipart)
96+
- [ ] CSRF protection
97+
- [ ] Security headers middleware (helmet-style)
98+
- [ ] Request timeout middleware
99+
- [ ] Circuit breaker pattern
100+
101+
#### 5. Performance & Scaling
102+
- [ ] Connection pooling
103+
- [ ] Request/response pooling
104+
- [ ] Zero-copy optimizations
105+
- [ ] HTTP keep-alive connection management
106+
- [ ] Graceful shutdown support
107+
- [ ] Health check endpoints
108+
- [ ] Metrics and monitoring hooks
109+
110+
#### 6. Error Handling
111+
- [ ] Error recovery middleware
112+
- [ ] Detailed error responses (development mode)
113+
- [ ] Error logging integration points
114+
- [ ] Panic recovery
115+
- [ ] Structured error types
116+
117+
#### 7. Testing & Development
118+
- [ ] Test client for integration testing
119+
- [ ] Mock request/response builders
120+
- [ ] Development mode with hot reload (external tool integration)
121+
- [ ] Request/response logging levels
122+
- [ ] Debug middleware
123+
124+
#### 8. Security
125+
- [ ] HTTPS/TLS support
126+
- [ ] Certificate management helpers
127+
- [ ] Input sanitization helpers
128+
- [ ] SQL injection prevention utilities
129+
- [ ] XSS prevention utilities
130+
- [ ] Rate limiting by IP/user
131+
- [ ] Request size limits
132+
133+
#### 9. Documentation & Examples
134+
- [x] Basic examples (simple server, error handling)
135+
- [x] Route grouping example
136+
- [ ] REST API example
137+
- [ ] WebSocket chat example
138+
- [ ] File upload example
139+
- [ ] Authentication example
140+
- [ ] Microservices example
141+
- [ ] Real-time SSE example
142+
- [ ] Comprehensive API documentation
143+
- [ ] Best practices guide
144+
- [ ] Migration guide from other frameworks
145+
146+
#### 10. Ecosystem Integration
147+
- [ ] Database connection pooling patterns
148+
- [ ] ORM integration examples
149+
- [ ] Message queue integration patterns
150+
- [ ] Cache integration (Redis, Memcached)
151+
- [ ] Logging framework integration
152+
- [ ] OpenTelemetry/tracing support
153+
154+
---
155+
156+
### 🎯 Future Considerations
157+
158+
These features are being considered but not yet prioritized:
159+
160+
- WebSocket support
161+
- HTTP/2 support
162+
- HTTP/3 (QUIC) support
163+
- GraphQL support
164+
- gRPC support
165+
- CBOR serialization support
166+
- Built-in API documentation generation
167+
- Load balancing support
168+
- Service mesh integration
169+
- Admin panel/dashboard
170+
- Plugin system architecture
171+
172+
---
173+
174+
### Contributing
175+
176+
Want to help implement a feature? Check our [CONTRIBUTING.md](CONTRIBUTING.md) guide!
177+
178+
### Feedback
179+
180+
Have suggestions for the roadmap? Open an issue or discussion on our [GitHub repository](https://github.com/CogitatorTech/helium).

0 commit comments

Comments
 (0)