Skip to content

perf: VSIX size optimization 8.92MB → 7.54MB (-15.5%) - #18

Merged
BryceQin merged 1 commit into
mainfrom
perf/vsix-size
Oct 20, 2026
Merged

BryceQin merged 1 commit into
mainfrom
perf/vsix-size

Conversation

@BryceQin

Copy link
Copy Markdown
Owner

Summary

  • VSIX 8.92 MB → 7.54 MB (-15.5%),文件数 5196 → 4085,node_modules 解包 19.77 MB → 13.98 MB (-29.3%)
  • 扩大 .vscodeignore:剔除 out/ 散装死代码、安装期专用依赖子树(prebuild-install/tar/node-fetch 链)、@azure/@typespec 多格式 dist 变体、不可达包
  • 收敛 dependencies:node-sql-parser 移至 devDependencies 并收编进 esbuild bundle(懒加载语义保留)
  • 全部剔除规则基于运行时 require 探针与依赖闭包分析实证(PRD: docs/prd/024-vsix-size-optimization.md)

Fixed regressions(分析中发现的已上线 bug)

  • v2.26.1 起:node_modules/**/src/** 规则误伤 debug/js-md4/sprintf-js/ecdsa-sig-formatter 主入口(均在 mssql→tedious→@Azure 链上)——打包版 SQL Server 连接崩溃
  • v2.32.1 起:@js-joda/core 被整体误剔(tedious DATETIME2 解析顶层依赖)——同样导致 SQL Server 连接崩溃

Test plan

  • 解包 VSIX 全驱动探针(9 个 external 全加载、better-sqlite3 真实查询、js-joda 解析 DATETIME2、203 包入口审计零缺失)
  • bundle 激活冒烟(vscode stub):65 命令注册、linter 经 bundle 内 parser 产出诊断、格式化/转换命令执行
  • 源码级测试子集:languages 195/195、parseError 6/6、comprehensive 187/189(2 个失败为 main 预存,stash 对照验证)
  • CI 全量套件

🤖 Generated with Claude Code

Verified strip rules against runtime require probes and dependency-closure
analysis (docs/prd/024-vsix-size-optimization.md):

- .vscodeignore: drop out/** tsc dead code (only out/extension.js ships),
  install-time-only subtrees (prebuild-install/tar/node-fetch chains),
  @azure/@typespec esm/browser/react-native dist variants, js-joda non-CJS
  variants, unreachable packages (aws-ssl-profiles, undici-types, etc.)
- esbuild: bundle node-sql-parser into out/extension.js (moved to
  devDependencies); lazy-load semantics preserved via __commonJS wrap
- fix (regression since v2.26.1): node_modules/**/src/** stripped the main
  entries of debug/js-md4/sprintf-js/ecdsa-sig-formatter (all on the
  mssql->tedious->@Azure chain) — packaged SQL Server connections crashed
- fix (regression since v2.32.1): @js-joda/core was stripped wholesale but
  tedious requires it for DATETIME2 parsing — restored CJS entry only

Verification: extracted-VSIX driver probes (all 9 externals load,
better-sqlite3 executes a real query, js-joda parses DATETIME2), bundle
activation smoke via vscode stub (65 commands, linter diagnostics through
the bundled parser, format + converter commands), 388 source-level tests.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@BryceQin
BryceQin merged commit e0b48b2 into main Oct 20, 2026
1 check passed
@BryceQin
BryceQin deleted the perf/vsix-size branch October 20, 2026 05:45
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.

1 participant