Skip to content

docs: correct stale claims on the Node.js compatibility page - #41352

Merged
alii merged 2 commits into
mainfrom
robobun/2ed71dd2/docs-node-compat-recheck
Sep 6, 2026
Merged

alii merged 2 commits into
mainfrom
robobun/2ed71dd2/docs-node-compat-recheck

Conversation

@robobun

@robobun robobun commented Sep 4, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

  • docs/runtime/nodejs-compat.mdx had six claims that are wrong on main. For example, it says that crypto.argon2() throws. argon2() and argon2Sync() work since node:crypto: implement argon2 and argon2Sync #37015.
  • The page also did not list eight globals that Node.js has, for example WebSocket and URLPattern.

Fix

  • Correct the six claims: node:crypto, node:https (client sockets are tls.TLSSockets), node:http2 (maxOriginSetSize is not a Node.js option), node:worker_threads (execArgv), node:inspector (Debugger commands), and the process.binding list.
  • Move node:util, node:sys and node:vm to 🟢. Their remaining gaps are experimental APIs or edge cases.
  • Add CloseEvent, ErrorEvent, File, navigator, QuotaExceededError, Storage, URLPattern and WebSocket.
  • Verified: each claim on the page has a probe that ran under bun 1.4.1-canary.1 (23 commits behind this base) and Node.js v26.3.0, or a source read for macOS, Windows and arm64 claims.

Background

Notes
  • Every other "missing", "no-op" and "ignored" claim still holds. Examples that are still missing on main: util.diff, module.findPackageJSON, module.registerHooks, v8.Serializer, worker_threads.locks, dns.resolveTlsa, Request.keepalive, crypto.encapsulate.
  • The "N% of Node.js's test suite passes" figures were not measured again.
  • Two differences are new on the page: File objects report Blob as their constructor and Symbol.toStringTag, and the WebSocket binaryType default is "nodebuffer".
  • process.binding('http_parser') and process.binding('crypto/x509') return objects in Bun. Node.js v26 throws "No such module" for both.
  • Real bugs that the probes found (for example url.format() with an array in query, and new DOMException().stack) are not documented here. They go to separate fixes.

no test proof · iteration 0 · docs-only change; test-proof not applicable

Every claim on the page was checked against bun 1.4.1-canary.1 and
Node.js v26.3.0. Most claims hold. These did not:

- node:crypto: argon2() and argon2Sync() work. ml-kem-512 is missing.
- node:https: client sockets are tls.TLSSocket. Only the server's
  req.socket is not.
- node:http2: maxOriginSetSize is not a Node.js option.
- node:worker_threads: execArgv applies --no-addons and --no-ffi-cc.
- node:inspector: Session forwards Debugger configuration commands
  after open().
- process.binding: crypto/x509 and http_parser are available.

node:util, node:sys and node:vm move to green. Their remaining gaps
are experimental APIs or edge cases.

Add the globals that Node.js has and the page did not list:
CloseEvent, ErrorEvent, File, navigator, QuotaExceededError, Storage,
URLPattern and WebSocket.
@coderabbitai

coderabbitai Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Essentials

Run ID: 4abf0690-0ab5-41b2-b65c-bafe283afe3b

📥 Commits

Reviewing files that changed from the base of the PR and between 385a51c and 42ecb87.

📒 Files selected for processing (1)
  • docs/runtime/nodejs-compat.mdx

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.


Walkthrough

Updated Node.js compatibility documentation for crypto, HTTP/2, runtime modules, inspector behavior, process bindings, and web platform globals.

Changes

Node.js compatibility documentation

Layer / File(s) Summary
Runtime and module compatibility
docs/runtime/nodejs-compat.mdx
Updated HTTPS socket, crypto, HTTP/2, node:util, node:vm, worker execArgv, and inspector compatibility details.
Web platform globals
docs/runtime/nodejs-compat.mdx
Added or updated compatibility entries for CloseEvent, ErrorEvent, File, navigator, URLPattern, and WebSocket.
Bindings and storage globals
docs/runtime/nodejs-compat.mdx
Documented process.binding("crypto/x509") and added entries for QuotaExceededError and Storage.

Suggested reviewers: cirospaciari

Merge Risk: ⚪ Minimal · up to 42ecb

This updates Node.js compatibility documentation and adds global compatibility entries. No current merge-readiness risk was identified.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: correcting stale claims in the Node.js compatibility documentation.
Description check ✅ Passed The description explains the problem, lists the documentation fixes, identifies added globals, and describes verification against Bun and Node.js. It does not use the template headings exactly, but it…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

@robobun

robobun commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author

Status: the page now matches main at 4661e49. A probe under bun and under Node.js v26.3.0 checked each claim.

Most gaps that the page lists have an open pull request that is not merged. When one of them merges, its line on this page needs an update. The open pull requests, by section:

A title search of the open pull requests produced this list. I did not review each pull request. No open pull request matched these gaps: Stats Temporal.Instant getters, node:sea, Storage, stream transfer with postMessage(), and path.matchesGlob().

Comment thread docs/runtime/nodejs-compat.mdx Outdated
@robobun

robobun commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author
Updated 2:07 AM PT - Sep 4th, 2026

✅ @robobun, your commit 42ecb879b48855306b3468c825289eb2771eb0fe passed in Build #110103! 🎉


🧪   To try this PR locally:

bunx bun-pr 41352

That installs a local version of the PR into your bun-41352 executable, so you can run:

bun-41352 --bun

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM — the execArgv wording is fixed and the rest of the compatibility updates read accurately.

What was reviewed: the reworded node:worker_threads entry — --stack-trace-limit and --tls-min-* do run through per-worker init, and --conditions/--no-deprecation are CLI-parsed only, so the new examples hold. Spot-checked the node:util/node:vm 🟢 promotions and the new globals entries (File's Blob toStringTag, WebSocket binaryType default, navigator missing languages/locks) against source — no overstated claims found.

Extended reasoning...

Overview

This PR updates docs/runtime/nodejs-compat.mdx only — no runtime code, tests, or types. It corrects stale compatibility claims for several node:* modules (crypto, https, http2, worker_threads, inspector, process.binding), promotes node:util/node:sys/node:vm from 🟡 to 🟢, and adds eight globals (CloseEvent, ErrorEvent, File, navigator, QuotaExceededError, Storage, URLPattern, WebSocket) to the globals table. The prior review flagged that the execArgv sentence incorrectly said "only --no-addons and --no-ffi-cc take effect"; commit 42ecb87 replaced that with "Some execArgv flags take effect… for example --no-addons, --stack-trace-limit and --tls-min-v1.3. Others, for example --conditions and --no-deprecation, only set process.execArgv", which matches what pre_execution.ts and the node:tls/node:net loaders actually read.

Security risks

None. This is a documentation-only change to an .mdx reference page; it does not touch executable code, build configuration, or dependencies.

Level of scrutiny

Low-to-moderate. The only real risk with compat-docs edits is factual overstatement (CLAUDE.md rule 11). The 🟡→🟢 promotions keep their caveat lists intact and match the page's stated convention that 🟢 means "only edge cases missing" — node:util still names diff/transferableAbort*/debuglog gaps, and node:vm still names the importModuleDynamically namespace quirk and measureMemory limitation, so nothing is being hidden. The new globals entries are conservative (two are 🔴, navigator is 🟡) and the File/WebSocket caveats accurately describe known Bun-vs-Node differences rather than papering over them.

Other factors

The one open inline thread from the previous run was directly addressed by the follow-up commit, and the new counter-examples (--conditions, --no-deprecation) check out — those are parsed by the CLI into transpiler/resolver options rather than re-read from process.execArgv inside a worker. No other reviewer has requested changes. Docs changes require no build or test proof per CLAUDE.md.

@alii
alii enabled auto-merge (squash) September 6, 2026 07:30
@alii
alii merged commit ee8f984 into main Sep 6, 2026
5 checks passed
@alii
alii deleted the robobun/2ed71dd2/docs-node-compat-recheck branch September 6, 2026 07:30
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.

3 participants