Repository navigation
Remove JSG_CONTEXT_JS_BUNDLE - #8493
Conversation
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>
There was a problem hiding this comment.
✅ 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
JSG_CONTEXT_JS_BUNDLEinstalled amodules.capnpBundleinto 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 inresource-test.c++.Removing it also removes the code that existed only for it:
JsSetup, the secondregisterMembers()passResourceWrapper::newContext()ran to install bundles, andResourceTypeBuilder::registerJsBundle().MemberCounter/MembersBuilderbundle handling, which filledStructure.builtinModules. The types generator never read that field. It stays inrtti.capnpasobsolete12so the ordinal is not reused.resource-test.capnp,rtti-test.capnpand their JS fixtures.Tested:
bazel test //...(2852 pass).