Skip to content

docs: describe checker caching and type guard interop accurately - #456

Merged
gjbkz merged 2 commits into
mainfrom
claude/project-thread-g0uou0-451
Oct 11, 2026
Merged

gjbkz merged 2 commits into
mainfrom
claude/project-thread-g0uou0-451

Conversation

@gjbkz

@gjbkz gjbkz commented Oct 10, 2026

Copy link
Copy Markdown
Member

Requested by Kei · project thread

Before: the README advertised "Zero runtime overhead — Results are cached via WeakMap", although only checker construction is cached and every call still validates the input, and its intro implied Zod users must keep schemas and interfaces in sync by hand.

After: the intro drops the Zod comparison and says checkers are ordinary type guards that compose with existing predicates. The features list gains an "Interoperates with existing type guards" item pointing at typeChecker, narrow, union and fromDiagnosis (the Usage section already has examples of each), and "Cached checker construction" says the cache is keyed by the definition object and that validation results are not cached.

Closes #451

🤖 Generated with Claude Code

https://claude.ai/code/session_019BJENnU8SXcDH2Tcx5EWE4


Generated by Claude Code

Replace the "Zero runtime overhead" claim, which described checker
construction caching as if validation itself were free, and drop the Zod
comparison. The README now states what the WeakMap cache covers and
highlights interoperability with existing type guards.

Closes #451

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019BJENnU8SXcDH2Tcx5EWE4
@gjbkz gjbkz self-assigned this Oct 10, 2026
@codecov

codecov Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.46%. Comparing base (25c62a4) to head (3c23185).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #456   +/-   ##
=======================================
  Coverage   98.46%   98.46%           
=======================================
  Files          52       52           
  Lines        3057     3057           
  Branches      327      327           
=======================================
  Hits         3010     3010           
  Misses         46       46           
  Partials        1        1           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gjbkz
gjbkz marked this pull request as ready for review October 10, 2026 20:33

@gjbkz gjbkz left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed commit 195d6de2cda7bb57fa334634a03ec4d7e92d9fbe.

No actionable issues found in this documentation change.

The updated README correctly distinguishes cached checker construction from per-call input validation and describes interoperability with standard TypeGuards without implying that Zod requires separately maintained interfaces. I checked the wording against the checker factory/cache implementation and the existing usage examples.

Validation: the GitHub Actions test workflow for this commit passed. This PR only changes prose; no new local runtime tests were run for this review.

@gjbkz gjbkz mentioned this pull request Oct 11, 2026
@gjbkz
gjbkz enabled auto-merge October 11, 2026 13:29
@gjbkz
gjbkz merged commit 81cadbd into main Oct 11, 2026
6 checks passed
@gjbkz
gjbkz deleted the claude/project-thread-g0uou0-451 branch October 11, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

docs: clarify checker caching costs and TypeGuard interoperability in README

2 participants