Skip to content

Add gil-inspired virtual module API pattern recommendations#20

Open
srdjan wants to merge 1 commit intomainfrom
codex/add-high-level-patterns-for-zigttp-virtual-modules
Open

Add gil-inspired virtual module API pattern recommendations#20
srdjan wants to merge 1 commit intomainfrom
codex/add-high-level-patterns-for-zigttp-virtual-modules

Conversation

@srdjan
Copy link
Copy Markdown
Owner

@srdjan srdjan commented Apr 29, 2026

Motivation

  • Provide high-level ergonomics for zigttp:* virtual modules inspired by ivanleomk/gil so handlers stay concise and declarative.
  • Encourage module APIs that hide low-level Zig/runtime details and surface one-liner happy paths with optional options objects.
  • Standardize patterns across modules (fetch, auth, cache, validate/decode) to improve discoverability and consistency for handler authors.

Description

  • Add docs/design/virtual-modules-gil-inspired-patterns.md containing recommended API patterns, examples, error-surface guidance, anti-patterns, and a review checklist.
  • Update docs/README.md to link the new design note under the Design And Roadmap section.
  • The design note documents concrete recommendations such as one-liner helpers, typed convenience methods with escape hatches, response helper objects, literal-friendly configs for analysis, build-time registration vs runtime use, and naming conventions.

Testing

  • This is a docs-only change and does not modify runtime code or tests.
  • Verified repository state with git status --short and created a commit for the two modified files successfully.
  • Inspected the new file and updated README with nl/sed to confirm contents and link insertion, and those checks succeeded.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant