Skip to content

feat(stdlib): 100% parity for node:tls, node:https, and node:timers - #31

Merged
phamtanminhtien merged 1 commit into
mainfrom
feat/tls-https-timers-parity
Sep 25, 2026
Merged

phamtanminhtien merged 1 commit into
mainfrom
feat/tls-https-timers-parity

Conversation

@phamtanminhtien

Copy link
Copy Markdown
Contributor

Summary

Achieves 100% core subset parity for node:tls, node:https, and node:timers against official Node.js v22 specifications with strict zero-workaround, zero-no-op compliance.

Module Parity & Audit Metrics

  • node:tls: 51 / 51 official APIs (100.0%), 0 missing gaps
  • node:https: 17 / 17 official APIs (100.0%), 0 missing gaps
  • node:timers: 21 / 21 official APIs (100.0%), 0 missing gaps

Key Implementations

  1. node:tls:
    • Fixed setDefaultCACertificates overloads and validation for string[] and ArrayBufferView[] inputs.
    • Handled connect errors asynchronously via microtask dispatch for event compatibility.
  2. node:https:
    • Implemented https.Server configuration and connection lifecycle methods:
      • closeAllConnections(): this
      • closeIdleConnections(): this
      • setTimeout(msecs?, callback?): this
      • headersTimeout, requestTimeout, maxHeadersCount, maxRequestsPerSocket
      • [Symbol.asyncDispose](): Promise<void>
    • Fixed host vs hostname and port parsing in parseUrlOptions.
  3. node:timers:
    • Implemented Immediate with hasRef(), ref(), unref(), [Symbol.dispose]().
    • Implemented Timeout with close(), hasRef(), ref(), refresh(), unref(), [Symbol.toPrimitive](), [Symbol.dispose]().
    • Implemented Scheduler with wait(delay, options) and yield().
    • Integrated promises.scheduler with wait and yield.
    • Updated clearTimeout, clearInterval, and clearImmediate to accept instances of Timeout and Immediate as well as primitive numeric IDs.

Verification

  • Audit: go run ./cmd/parity -audit -filter tls, ... -filter https, ... -filter timers -> 100% PASS (0 gaps).
  • Runtime Parity: NODE_BIN=... go run ./cmd/parity -filter api/tls.ts, ... api/https.ts, ... api/timers.ts -> 100% PASS.
  • Full Regression: go test -count=1 ./... (all packages PASS).
  • TypeScript-Go tests: go test -count=1 ./internal/typescriptgo/... (PASS).
  • CLI Build: go build ./cmd/scriptgo (PASS).
  • Documentation: Updated docs/typescript-parity-report.md tables.

@phamtanminhtien
phamtanminhtien merged commit 92c2892 into main Sep 25, 2026
7 checks passed
@phamtanminhtien
phamtanminhtien deleted the feat/tls-https-timers-parity branch September 25, 2026 10:06
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