Skip to content

perf(app): deduplicate and budget browser bundles - #59

Merged
melonamin merged 2 commits into
masterfrom
bb/deduplicate-and-budget-browser-bundles-thr_6upmk6z2kk
Aug 12, 2026
Merged

perf(app): deduplicate and budget browser bundles#59
melonamin merged 2 commits into
masterfrom
bb/deduplicate-and-budget-browser-bundles-thr_6upmk6z2kk

Conversation

@melonamin

Copy link
Copy Markdown
Member

Summary

  • make packages/core/wasm the canonical browser WASM source and remove the legacy app/public/wasm mirror
  • lazy-load optional views, ELK layout, Librarian, sharing, image export, PDF parsing, and embeddings
  • add manifest-based startup, async chunk, WASM, total JavaScript, and distribution budgets with focused tests
  • enforce the budgets from the existing demo app build CI step and document every supported loading path

Why

Vite already emitted the package-owned WASM imported through @pondpilot/flowscope-core, while the Rust build also copied the same binary into app/public. Production and embedded CLI builds therefore shipped two roughly 8.9 MB WASM files. Optional heavyweight browser features were also reachable from the startup graph, producing a roughly 6.7 MB entry chunk, and the build only warned instead of enforcing a regression limit.

Impact

  • WASM delivery: 17,816,184 B across two files → 8,908,092 B in one file (-50.0%)
  • entry JavaScript: 6,697,818 B → 2,643,009 B (-60.5%)
  • total JavaScript: 10,441,936 B → 8,001,861 B (-23.4%)
  • total app distribution: 28,390,923 B → 17,039,481 B (-40.0%)

Direct dev/build commands clean stale legacy mirrors before Vite starts. CLI serve embeds the same budget-checked app output, npm/browser package loading still resolves the package-owned module, and the VS Code extension keeps its separate Node-target WASM path.

Validation

  • just build-wasm
  • yarn workspace @pondpilot/flowscope-app test (349 tests)
  • yarn workspace @pondpilot/flowscope-app build
  • yarn workspace @pondpilot/flowscope-app check:bundle
  • just build-cli-serve
  • yarn workspaces run typecheck
  • yarn workspaces run lint
  • VS Code webview production build
  • git diff --check
  • iterative codex review --uncommitted; fixed all valid findings, final pass found no actionable defects

@melonamin
melonamin marked this pull request as ready for review August 12, 2026 12:53
@melonamin
melonamin merged commit e35f3a3 into master Aug 12, 2026
7 checks passed
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