Skip to content

Merging all features from dev/uno to main#5

Merged
Nadhila-dot merged 11 commits intomainfrom
dev/uno
Mar 28, 2026
Merged

Merging all features from dev/uno to main#5
Nadhila-dot merged 11 commits intomainfrom
dev/uno

Conversation

@Nadhila-dot
Copy link
Copy Markdown
Collaborator

@Nadhila-dot Nadhila-dot commented Mar 28, 2026

What we get,

Higher opt and dynamic performance
Better developer DX

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for benchmarking http-native with Bun and Node runtimes separately.
    • Added contributing guidelines document with commit message conventions.
  • Refactor

    • Optimized response handling and request envelope processing.
    • Implemented header lookup caching for improved performance.
  • Chores

    • Updated benchmark CI/CD workflow for separate runtime testing.
    • Standardized comment formatting in example files.

@Nadhila-dot Nadhila-dot merged commit 23cbf0e into main Mar 28, 2026
2 of 3 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 28, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 60181d92-c3cc-40cf-812d-b8cbbdbac4b5

📥 Commits

Reviewing files that changed from the base of the PR and between c459b98 and 935e264.

📒 Files selected for processing (27)
  • .github/workflows/main.yml
  • CONTRIBUTING.md
  • bench/ci.js
  • bench/run.js
  • bench/target.js
  • examples/cors/server.js
  • examples/error-handling/server.js
  • examples/middleware/server.js
  • examples/rest-api/server.js
  • examples/validation/server.js
  • noslop/AGENTS.md
  • noslop/CLAUDE.md
  • opt/runtime.js
  • package.json
  • readme.md
  • rust-native/build.rs
  • rust-native/src/analyzer.rs
  • rust-native/src/lib.rs
  • rust-native/src/manifest.rs
  • rust-native/src/router.rs
  • scripts/build-native.mjs
  • src/bridge.js
  • src/index.d.ts
  • src/index.js
  • src/native.js
  • test/app.js
  • test/test.js

📝 Walkthrough

Walkthrough

This PR introduces runtime selection flexibility for http-native benchmarking (bun vs. node), adds dynamic fast-path response rendering in the Rust analyzer, refactors the JavaScript bridge with header caching and zero-copy operations, implements response object pooling and route-level response caching with promotion, and extends tests with new route handlers and optimization assertions.

Changes

Cohort / File(s) Summary
CI/Workflow Infrastructure
.github/workflows/main.yml, package.json
Updated workflow dispatch to split benchmark runs by http-native runtime (bun/node), added Node.js 20 setup, reorganized artifact uploads by runtime. Added new npm scripts for runtime-specific benchmark variants.
Contribution Guidelines
CONTRIBUTING.md
New file establishing commit message conventions (prefix-based: opt:, chore:, rm:, etc.), formatting examples, and behavioral rules for contributors.
Benchmark Tooling
bench/ci.js, bench/run.js, bench/target.js
Removed fiber from default engines, added --http-native-runtime flag validation (bun/node), updated server spawning logic to select runtime dynamically. Added HTTP_NATIVE_NATIVE_PATH fallback and enabled caching for optimized mode.
Rust Analyzer & Router
rust-native/src/analyzer.rs, rust-native/src/router.rs, rust-native/src/manifest.rs
Introduced comprehensive dynamic fast-path analysis with new public data structures (DynamicFastPathSpec, JsonTemplate, TextTemplate, DynamicValueSource) to model response generation patterns. Extended MatchedRoute and DynamicRouteSpec with metadata fields (needs_path, needs_url, needs_query, fast_path) and stack-allocated path segment buffering.
Rust Native Library
rust-native/src/lib.rs
Refactored request dispatch with zero-copy decision-building, dynamic fast-path response rendering (JSON/text templates with param/query/header value resolution), conditional URL/path/query envelope inclusion, and direct HTTP response framing from dispatch envelope.
JavaScript Bridge
src/bridge.js
Added header name normalization caching, per-request cached header lookup, replaced DataView with direct Uint8Array operations, avoided allocations for zero-count headers via shared empty array, and refactored header materialization to use lookup-based filtering.
Main Application
src/index.js
Implemented response object pooling with shared prototype, replaced async middleware fast-paths with sync functions, added route-level response caching with FNV-1a promotion after stable hits, integrated request-access analysis for cache eligibility (GET-only, no params/middleware/dynamic patterns).
Examples & Documentation
examples/*/server.js, readme.md, src/index.d.ts, rust-native/build.rs, scripts/build-native.mjs
Comment formatting and section header adjustments; no functional changes.
Tests
test/app.js, test/test.js
Added new test app setup file with error handler logging. Extended test with /native/:id route accepting path params, query arrays, and headers; updated optimization snapshot assertions to validate new route and cache recommendation fields.
Optimization Runtime
opt/runtime.js
Added settled flag to route entries to prevent further recording after finalization, refactored cold→hot transition to use Date.now() timestamps, marked non-cache candidates settled immediately, and updated stable-response threshold to mark cache candidates settled.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~90 minutes

Possibly related PRs

Poem

🐰 Fast paths and pools, oh what delight!
Dynamic responses rendered right,
Headers cached, no copies wasting,
Route promotions—performance's feasting!
Rust meets JS in harmony's flight. 🚀

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev/uno

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

This was referenced Mar 28, 2026
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