Skip to content

build: omit web extension metadata from desktop bundles - #334780

Merged
Dmitriy Vasyura (dmitrivMS) merged 1 commit into
mainfrom
agents/agents-window-startup-profiling
Sep 6, 2026
Merged

build: omit web extension metadata from desktop bundles#334780
Dmitriy Vasyura (dmitrivMS) merged 1 commit into
mainfrom
agents/agents-window-startup-profiling

Conversation

@dmitrivMS

Copy link
Copy Markdown
Collaborator

Summary

  • inject built-in extension manifests only into web and server-web bundles
  • leave the replacement empty for native targets, where BuiltinExtensionsScannerService never consumes it
  • restore parity with the legacy desktop bundler

Why

The build-next desktop target embedded the complete web built-in extension manifest in both desktop renderer bundles. The scanner reads this payload only inside its isWeb branch, while Electron sets isWeb to false.

An exact latest-main before/after build using the same packaged built-in extension set measured:

Bundle Before After Saved
sessions.desktop.main.js 19,904,951 B 19,527,498 B 377,453 B / 368.6 KB / 1.90%
workbench.desktop.main.js 19,569,931 B 19,192,478 B 377,453 B / 368.6 KB / 1.93%
Total desktop JavaScript 754,906 B / 737.2 KB

The Agents bundle's extensionPath tokens fell from 83 to 1. Server-web retained all 83 injected entries.

This is independent of the runtime startup improvements in #334751, #331911, and #334769.

Validation

  • npm run eslint -- build/next/index.ts
  • node build/next/index.ts bundle --minify --nls --target desktop --out <output>
  • exact latest-main desktop before/after bundle comparison
  • node build/next/index.ts bundle --minify --nls --target server-web --out <output>
  • verified server-web still contains the injected built-in extension records
  • git diff --check

Only web and server-web consume the injected built-in extension manifest. Leave the native replacement empty to avoid carrying 368 KB of unreachable metadata in each desktop renderer bundle.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI 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.

Copilot review overview

🟢 Approval recommended

The marker is only used inside a web-only (isWeb) code path, and replacing it with an empty string produces valid syntax ([]) while safely removing unused desktop payload.

Review tier: Lite
Findings: None

What changed in this PR

This PR updates the build/next bundling pipeline to stop injecting the built-in web extension manifest into native (desktop/server) bundles, restoring parity with the legacy desktop bundler and reducing bundled JS size.

Changes:

  • Gate /*BUILD->INSERT_BUILTIN_EXTENSIONS*/ injection to only the web and server-web build targets.
  • Replace the marker with an empty string for native targets so the array literal becomes [] without scanning .build/extensions.
File Description
build/​next/​index.ts Restricts built-in extension manifest injection to web/server-web targets and emits an empty replacement for native bundles to avoid embedding unused metadata.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit 7483b09 into main Sep 6, 2026
51 of 52 checks passed
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) deleted the agents/agents-window-startup-profiling branch September 6, 2026 09:04
@vs-code-engineering vs-code-engineering Bot added this to the 1.137.0 milestone Sep 6, 2026
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