Skip to content

v2#316

Open
yusukebe wants to merge 14 commits intomainfrom
v2
Open

v2#316
yusukebe wants to merge 14 commits intomainfrom
v2

Conversation

@yusukebe
Copy link
Member

No description provided.

mgcrea and others added 6 commits February 10, 2026 22:38
- Read request body directly from IncomingMessage via events, bypassing
  expensive Web API chain (AbortController, Headers, Request, ReadableStream)
- Cache read buffer for potential later Request construction
- Add fast-path for URL construction without new URL() allocation
- Fall back to new URL() only when path normalization needed (.. sequences)
- Validate host header with lightweight character code checks

Improves body parsing benchmark by ~77% and query benchmark by ~15%
Add fast-path when no set-cookie headers exist, skipping per-header
string comparison in the most common case
perf: optimize request body reading, URL construction, and header building
* fix: More strictly, determine when new URL() should be used

* fix: compare host case-insensitively

* test: Add test cases for URL normalization

* refactor: separate URL normalization process code into separate files

* refactor(url): improve error class compatibility

* refactor: improve exception throwing

* fix: add missing src/error.ts

* test: improve test for error throwing
@yusukebe yusukebe added the v2 label Mar 12, 2026
yusukebe and others added 5 commits March 12, 2026 10:29
* perf(request): cache method key

* refactor

Co-authored-by: Taku Amano <taku@taaas.jp>

---------

Co-authored-by: Taku Amano <taku@taaas.jp>
* perf(url): mark host with port `:` safehost

* perf: added fast path handling for port numbers in the range 1000-59999 (#322)

* perf: added fast path handling for port numbers in the range 1000-59999

* test: fix test description

---------

Co-authored-by: Taku Amano <taku@taaas.jp>
* chore(test): migrate Jest to Vitest

* feat(test/utils): add coverage for `readWithoutBlocking` close/error cases

Ensure closed streams resolve with `{ done: true, value: undefined }`
and errored streams properly reject.

* feat(test/utils): use `toEqual()` instead of `toStrictEqual()`

* chore(test): run Vitest via CLI and pass `--expose-gc` through `execArgV`

* fix the test for Vitest

---------

Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
* build: migrate from tsup to tsdown

Replace tsup (^7.2.0) with tsdown (^0.20.3) and update build/watch
scripts accordingly.

* build: align package.json exports with tsdown output extensions

Update exports to use .cjs/.mjs/.d.cts/.d.mts extensions matching
tsdown's actual output, and nest type definitions per format to
resolve publint errors.

* build: configure tsdown output extensions to match package.json exports

* ci: separate build job with Node.js v24 for tsdown compatibility

* ci: simplify ci-build job by removing matrix

---------

Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
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.

6 participants