Skip to content

Remove two large commented-out blocks from CommonJS.ts and child_process.ts - #39916

Merged
dylan-conway merged 1 commit into
mainfrom
claude/builtins-remove-dead-commented-code
Aug 21, 2026
Merged

dylan-conway merged 1 commit into
mainfrom
claude/builtins-remove-dead-commented-code

Conversation

@dylan-conway

Copy link
Copy Markdown
Member

What does this PR do?

Deletes two large commented-out blocks from the builtin JS sources:

  • src/js/builtins/CommonJS.ts: a ~130-line legacy loadEsmIntoCjs implementation kept inside a block comment since the module-loader rewrite (it referenced Loader.registry, $setStateToMax, etc., which no longer exist).
  • src/js/node/child_process.ts: a ~130-line commented-out copy of Node's internal/errors registration helpers.

Comment-only; the builtin bundler already stripped both, so there is no change to the emitted modules.

How did you verify your code works?

Comment-only deletion; diff context checked to confirm no live line was touched.

…ess.ts

Both were dead: a ~130-line legacy loadEsmIntoCjs implementation kept inside a
block comment after the module-loader rewrite, and a ~130-line commented-out
copy of Node's internal/errors registration helpers in child_process.ts. They
are stripped by the builtin bundler anyway; this just removes them from the
source.

No-Verification-Needed: comment-only deletion
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your current included review allowance is based on your included PR review attempts over the past 7 days.

Next review available in: 46 minutes

Limit details: You’ve used the included review currently available. Your 62 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

You’re in a promotional period — use the checkbox below to run this review for free:

  • Run review for free

On-demand reviews are free for the next 30 days. After that, they cost $0.25 per reviewed file.

How can I continue?

Run this review now using the option above, or comment @coderabbitai review --use-credits.

You can also wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6fb3a046-a493-4a65-b05c-c997a6efa7e6

📥 Commits

Reviewing files that changed from the base of the PR and between 4448a2e and 68069bf.

📒 Files selected for processing (2)
  • src/js/builtins/CommonJS.ts
  • src/js/node/child_process.ts

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

@robobun

robobun commented Aug 21, 2026 •

Copy link
Copy Markdown
Collaborator
Updated 2:50 AM PT - Aug 21st, 2026

✅ @dylan-conway, your commit 68069bf81d8d5604b603aae82649fcfa984692fa passed in Build #102528! 🎉


🧪   To try this PR locally:

bunx bun-pr 39916

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

bun-39916 --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 — pure comment deletion, no live code touched.

What was reviewed:

  • Confirmed every removed line in CommonJS.ts is inside the /* ... */ block comment and every removed line in child_process.ts is a // line comment.
  • Verified the surrounding live lines ($esmLoadSync return / $visibility = "Private" and genericNodeError / ERR_UNKNOWN_SIGNAL) are unchanged in the diff context.
  • Neither file is under CODEOWNERS.
Extended reasoning...

Overview

This PR deletes two large commented-out blocks from builtin JS sources: a ~130-line /* ... */ block in src/js/builtins/CommonJS.ts (a legacy loadEsmIntoCjs implementation that referenced the old JS-side JSModuleLoader machinery — Loader.registry, $setStateToMax, etc. — which no longer exists) and a ~130-line run of // comments in src/js/node/child_process.ts (a dead copy of Node's internal/errors E() / makeNodeErrorWithCode registration helpers). No executable line is added, removed, or modified.

Security risks

None. Comment-only removal; the builtin bundler already stripped these comments, so the emitted module bytes are unchanged.

Level of scrutiny

Minimal. I walked the diff line-by-line to confirm every - line is either inside the block comment (CommonJS.ts) or begins with // (child_process.ts), and that the diff context lines on both sides of each removed hunk are intact — the live loadEsmIntoCjs wrapper and the $visibility = "Private" directive above requireESM in CommonJS.ts, and genericNodeError / ERR_UNKNOWN_SIGNAL in child_process.ts. There is no risk of an accidentally-uncommented line or a deleted live statement.

Other factors

Neither file is CODEOWNERS-gated. This is exactly the "delete dead code in the same PR that makes it dead" cleanup the repo review guidelines encourage; the removed CommonJS block explicitly documented itself as a dead legacy implementation. No tests are needed because there is no behavioral change to test.

@robobun

robobun commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Adopted in #39926. The commit is unchanged, rebased onto current main. I checked that the generated output (WebCoreJSBuiltins.h, InternalModuleRegistryConstants.bin) is identical with and without the change, in both debug and release codegen modes.

@dylan-conway
dylan-conway merged commit 218ef44 into main Aug 21, 2026
6 of 7 checks passed
@dylan-conway
dylan-conway deleted the claude/builtins-remove-dead-commented-code branch August 21, 2026 19:17
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.

2 participants