Skip to content

Remove JSG_CONTEXT_JS_BUNDLE - #8493

Merged
bartlomieju merged 1 commit into
mainfrom
biwanczuk/remove-context-js-bundle
Nov 16, 2026
Merged

bartlomieju merged 1 commit into
mainfrom
biwanczuk/remove-context-js-bundle

Conversation

@bartlomieju

@bartlomieju bartlomieju commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

JSG_CONTEXT_JS_BUNDLE installed a modules.capnp Bundle into a context's module registry when the context was created. Nothing in workerd or internal project uses it; its only use was its own test in resource-test.c++.

Removing it also removes the code that existed only for it:

  • JsSetup, the second registerMembers() pass ResourceWrapper::newContext() ran to install bundles, and ResourceTypeBuilder::registerJsBundle().
  • The RTTI MemberCounter / MembersBuilder bundle handling, which filled Structure.builtinModules. The types generator never read that field. It stays in rtti.capnp as obsolete12 so the ordinal is not reused.
  • resource-test.capnp, rtti-test.capnp and their JS fixtures.

Tested: bazel test //... (2852 pass).

JSG_CONTEXT_JS_BUNDLE installed a modules.capnp Bundle into a context's
module registry when the context was created. Nothing in workerd or
edgeworker uses it; its only use was its own test in resource-test.c++.
Built-in modules are registered through the module registries directly.

Removing it also removes the code that existed only for it:

- JsSetup, the second registerMembers() pass ResourceWrapper::newContext()
  ran to install bundles, and ResourceTypeBuilder::registerJsBundle().
- The RTTI MemberCounter and MembersBuilder bundle handling, which filled
  Structure.builtinModules. The types generator never read that field. It
  stays in rtti.capnp as obsolete12 so the ordinal is not reused.
- resource-test.capnp, rtti-test.capnp and their JS fixtures.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@bartlomieju
bartlomieju requested review from a team as code owners November 16, 2026 13:23

@clanky-the-clanker clanky-the-clanker Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Approved — This pull request removes dead code completely: there are no remaining references, the control-flow change in newContext() is safe, and the capnp ordinal is preserved. No issues found.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

🔒 Security: ✅ LGTM

No security concerns: the change only removes code.


📖 AGENTS.md: ✅ LGTM

No AGENTS.md updates needed.


📋 Code Quality: ✅ LGTM

Nothing references the removed symbols anymore. Dropping the context scope and the second registerMembers() pass in newContext() loses nothing, because those callbacks were empty apart from registerJsBundle. The rtti.capnp ordinal is preserved as obsolete12.


⚡ Performance: ✅ LGTM

No performance concerns. Context creation now skips a no-op registration pass.


📝 Documentation: ✅ LGTM

No documentation issues.


Reviewed commit: 6bc309b7

@bartlomieju
bartlomieju requested a review from jasnell November 16, 2026 14:47
@bartlomieju
bartlomieju merged commit ebf43c5 into main Nov 16, 2026
38 of 39 checks passed
@bartlomieju
bartlomieju deleted the biwanczuk/remove-context-js-bundle branch November 16, 2026 16:14
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