Skip to content

Ship @vscode/diff in the web and server node_modules - #347381

Merged
Henning Dieterichs (hediet) merged 1 commit into
mainfrom
hediet/diff-package-on-web
Nov 10, 2026
Merged

Henning Dieterichs (hediet) merged 1 commit into
mainfrom
hediet/diff-package-on-web

Conversation

@hediet

Copy link
Copy Markdown
Member

The diff editor loads @vscode/diff at runtime from node_modules (externalLinesDiffComputer.ts, via resolveAmdNodeModulePath), like @vscode/tree-sitter-wasm and vscode-oniguruma, so the bundler leaves it alone and the package can load its .wasm next to itself. Desktop ships the root node_modules, but web and server builds only ship the dependencies of remote/web/package.json and remote/package.json, and @vscode/diff was only in the root package.json.

So with diffEditor.diffAlgorithm set to advanced-external or advanced-wasm, the package fails to load on vscode.dev, Codespaces and the server, and the built-in algorithm is used instead (reported as fallback: error in diffEditor.computeDiff, added in #346266).

This adds @vscode/diff at the root's version to both manifests and the remote lockfile. The hygiene check (checkPackageJSON in build/gulpfile.hygiene.ts) keeps the versions equal to the root's.

Validation:

  • pnpm install --lockfile-only --frozen-lockfile in remote: passed (lockfile up to date, supply-chain policies pass). The lockfile entry has the same integrity as the root lockfile's.
  • Not run locally: a web or server build. To test, set diffEditor.diffAlgorithm to advanced-wasm in a vscode.dev or server build of this PR and open a diff; it should no longer log a fallback.

The diff editor loads @vscode/diff at runtime from node_modules (externalLinesDiffComputer.ts), like tree-sitter-wasm. Web and server builds only ship the dependencies of remote/web/package.json and remote/package.json, so on vscode.dev, Codespaces and the server the package failed to load and the built-in algorithm was used instead.

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 16:21

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.

🟢 Approval recommended

No active review issues remain for the runtime dependency update, though web and server builds were not validated locally.

No open issues 🎉

1 file not reviewed
  • remote/pnpm-lock.yaml: Generated file
What changed in this PR

Adds @vscode/diff to the web and server runtime dependencies so the external diff backends can load instead of falling back to the built-in algorithm because the package is missing.

Changes:

  • Adds version 0.0.2-128 to both dependency manifests, matching the root manifest.
  • Updates the remote lockfile with both importer entries and the package resolution.

No actionable findings remain. Web and server build validation was not run locally, as noted in the PR description.

File Description
remote/​web/​package.json Includes @vscode/diff in web runtime dependencies.
remote/​pnpm-lock.yaml Locks the package for both remote and web dependencies.
remote/​package.json Includes @vscode/diff in server runtime dependencies.

Review effort: Balanced

@hediet
Henning Dieterichs (hediet) merged commit 39cc2e3 into main Nov 10, 2026
95 of 97 checks passed
@hediet
Henning Dieterichs (hediet) deleted the hediet/diff-package-on-web branch November 10, 2026 18:08
@vs-code-engineering vs-code-engineering Bot added this to the 1.147.0 milestone Nov 10, 2026
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.

3 participants