build: omit web extension metadata from desktop bundles - #334780
Merged
Dmitriy Vasyura (dmitrivMS) merged 1 commit intoSep 6, 2026
Conversation
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 started reviewing on behalf of
Dmitriy Vasyura (dmitrivMS)
September 6, 2026 08:42
View session
Dmitriy Vasyura (dmitrivMS)
enabled auto-merge (squash)
September 6, 2026 08:42
Contributor
There was a problem hiding this comment.
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 thewebandserver-webbuild 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.
Benjamin Christopher Simmonds (benibenj)
approved these changes
Sep 6, 2026
Dmitriy Vasyura (dmitrivMS)
deleted the
agents/agents-window-startup-profiling
branch
September 6, 2026 09:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
webandserver-webbundlesBuiltinExtensionsScannerServicenever consumes itWhy
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
isWebbranch, while Electron setsisWebto false.An exact latest-
mainbefore/after build using the same packaged built-in extension set measured:sessions.desktop.main.jsworkbench.desktop.main.jsThe Agents bundle's
extensionPathtokens 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.tsnode build/next/index.ts bundle --minify --nls --target desktop --out <output>node build/next/index.ts bundle --minify --nls --target server-web --out <output>git diff --check