Skip to content

perf(core): replace jest-diff and pretty-format with @vitest/utils#1087

Merged
fi3ework merged 1 commit intomainfrom
tree/dev4
Mar 24, 2026
Merged

perf(core): replace jest-diff and pretty-format with @vitest/utils#1087
fi3ework merged 1 commit intomainfrom
tree/dev4

Conversation

@fi3ework
Copy link
Copy Markdown
Member

Summary

Background

The current implementation imports jest-diff and pretty-format (Jest versions) to format assertion errors. These packages, along with their dependencies (react-is, ansi-styles), create duplicated bundles (~220KB) since @vitest/pretty-format is already bundled in vendor-assertion.js.

Implementation

  1. Replace jest-diff with @vitest/utils/diff for diff generation
  2. Replace pretty-format (Jest) with @vitest/pretty-format for value formatting
  3. Remove jest-diff and pretty-format from dependencies
  4. Pre-compute Object.values(plugins) to avoid repeated calls

User Impact

None — internal bundle optimization that reduces package size by ~220KB.

Related Links

Closes #1085 (related PR that splits worker bundles)

@fi3ework
Copy link
Copy Markdown
Member Author

wait for #1086 to see the diff.

@fi3ework fi3ework marked this pull request as draft March 23, 2026 12:54
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f102117960

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions
Copy link
Copy Markdown

Rsdoctor Bundle Diff Analysis

Found 12 projects in monorepo, 2 projects with changes.

📊 Quick Summary
Project Total Size Change
adapter-rsbuild 2.1 KB 0
adapter-rslib 23.1 KB 0
adapter-rspack 5.9 KB 0
browser 2.0 MB 0
browser-react 3.7 KB 0
browser-ui 804.2 KB 0
coverage-istanbul 9.1 KB 0
core/rsdoctor-browser 971.3 KB 📉 -218.0 KB (-18.3%)
core/rsdoctor-loaders 869.0 B 0
core/rsdoctor-main 1.5 MB 📉 -238.2 KB (-13.2%)
vscode/rsdoctor-extension 59.5 MB 0
vscode/rsdoctor-worker 14.4 KB 0
📋 Detailed Reports (Click to expand)

📁 core/rsdoctor-browser

Path: packages/core/dist/rsdoctor-browser/rsdoctor-data.json

📌 Baseline Commit: 83800a5fb2 | PR: #1094

Metric Current Baseline Change
📊 Total Size 971.3 KB 1.2 MB -218.0 KB (-18.3%)
📄 JavaScript 963.2 KB 1.2 MB -217.1 KB (-18.4%)
🎨 CSS 0 B 0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 8.1 KB 9.0 KB -913.0 B (-9.9%)

📦 Download Diff Report: core/rsdoctor-browser Bundle Diff

📁 core/rsdoctor-main

Path: packages/core/dist/rsdoctor-main/rsdoctor-data.json

📌 Baseline Commit: 83800a5fb2 | PR: #1094

Metric Current Baseline Change
📊 Total Size 1.5 MB 1.8 MB -238.2 KB (-13.2%)
📄 JavaScript 1.5 MB 1.7 MB -224.0 KB (-13.1%)
🎨 CSS 0 B 0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 75.4 KB 89.7 KB -14.2 KB (-15.9%)

📦 Download Diff Report: core/rsdoctor-main Bundle Diff

Generated by Rsdoctor GitHub Action

@fi3ework fi3ework enabled auto-merge (squash) March 24, 2026 11:07
@fi3ework fi3ework merged commit c93c1fe into main Mar 24, 2026
17 checks passed
@fi3ework fi3ework deleted the tree/dev4 branch March 24, 2026 11:15
@9aoy 9aoy mentioned this pull request Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant