Skip to content

Conversation

@teimurjan
Copy link
Contributor

中文版模板 / Chinese template

🤔 This is a ...

  • 🆕 New feature
  • 🐞 Bug fix
  • 📝 Site / documentation improvement
  • 📽️ Demo improvement
  • 💄 Component style improvement
  • 🤖 TypeScript definition improvement
  • 📦 Bundle size optimization
  • ⚡️ Performance optimization
  • ⭐️ Feature enhancement
  • 🌐 Internationalization
  • 🛠 Refactoring
  • 🎨 Code style optimization
  • ✅ Test Case
  • 🔀 Branch merge
  • ⏩ Workflow
  • ⌨️ Accessibility improvement
  • ❓ Other (about what?)

🔗 Related Issues

  • Describe the source of related requirements, such as links to relevant issue discussions.
  • For example: close #xxxx, fix #xxxx

💡 Background and Solution

  • The specific problem to be addressed.
  • List the final API implementation and usage if needed.
  • If there are UI/interaction changes, consider providing screenshots or GIFs.

Replace pixelmatch with BlazeDiff. BlazeDiff is 20-25% faster than pixelmatch, using the same API and producing the same results. It weighs twice as much, is actively supported, and is type-safe out of the box.

Screenshot 2025-09-09 at 12 46 27
  • It's already been checked and integrated into vega/vega
  • It's already been approved and scheduled for integration into antvis/G

📝 Change Log

Language Changelog
🇺🇸 English
🇨🇳 Chinese

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 11, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Summary by CodeRabbit

  • 文档
    • 更新英文与中文视觉回归博文,将自托管比对工具改为 BlazeDiff;流程说明保持一致(对比当前与基线、生成差异图、上传与报告不变)。
  • 重构
    • 视觉回归构建逻辑切换至新的图像比对库,维持原有输出与比对行为;对终端用户无感知。
  • 杂项
    • 调整依赖:移除旧的像素比对相关依赖,新增 BlazeDiff 依赖以匹配文档与脚本更新。

Walkthrough

将视觉回归对比库由 pixelmatch 更换为 BlazeDiff(@blazediff/core)。更新了自托管流程的两篇文档说明、替换脚本中的库调用,并在 package.json 中增删相关依赖。整体对比流程与输出产物保持不变。

Changes

Cohort / File(s) Change Summary
文档更新:自托管视觉回归说明
docs/blog/visual-regression.en-US.md, docs/blog/visual-regression.zh-CN.md
将对比工具从 pixelmatch 改为 blazediff;流程描述保持为“当前截图 vs 基线”,差异图与报告生成、OSS 上传不变。
依赖调整
package.json
新增 devDependency:@blazediff/core@^0.7.1;移除 devDependency:@types/pixelmatch@^5.2.6;移除 dependency:pixelmatch@^7.1.0
构建脚本替换对比库
scripts/visual-regression/build.ts
@blazediff/core 替换 pixelmatch 的导入与调用;保留比较逻辑、返回比率与生成 diff 图的流程。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

lgtm

Suggested reviewers

  • zombieJ
  • afc163
  • li-jia-nan

Poem

小兔挥笔比图影,📸
像素火焰换新晴。🔥
基线对照毫厘验,
差异轻描落分明。
报告跳上云端去,☁️
耳动尾摆说:搞定!

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dbbdaf3 and a5f95d2.

📒 Files selected for processing (4)
  • docs/blog/visual-regression.en-US.md (1 hunks)
  • docs/blog/visual-regression.zh-CN.md (1 hunks)
  • package.json (1 hunks)
  • scripts/visual-regression/build.ts (2 hunks)
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 11, 2025

👁 Visual Regression Report for PR #54941 Failed ❌

🎯 Target branch: master (dbbdaf3)
📖 View Full Report ↗︎
📖 Alternative Report ↗︎
📊 Summary: 🔄 4 changed

Expected (Branch master) Actual (Current PR) Diff
list-vertical.dark.png list-vertical.dark.png list-vertical.dark.png list-vertical.dark.png
list-vertical.dark.png list-vertical.dark.png list-vertical.dark.css-var.png list-vertical.dark.css-var.png
table-sticky.dark.png table-sticky.dark.png table-sticky.dark.png table-sticky.dark.png
table-sticky.default.png table-sticky.default.png table-sticky.default.png table-sticky.default.png

Important

There are 4 diffs found in this PR: 🔄 4 changed.
Please check all items:

  • Visual diff is acceptable

@github-actions
Copy link
Contributor

github-actions bot commented Sep 11, 2025

Preview is ready

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

Hi @teimurjan. Thanks for your contribution. The path .github/ or scripts/ and CHANGELOG is only maintained by team members. This current PR will be closed and team members will help on this.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @teimurjan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on optimizing the performance of the visual regression testing system. It achieves this by replacing the existing image comparison library, pixelmatch, with the more efficient blazediff. This change is a direct performance enhancement, aiming to speed up the visual difference detection process without altering the accuracy or functionality of the tests.

Highlights

  • Performance Improvement: Replaced the pixelmatch library with blazediff for visual regression testing, leading to a 20-25% speed increase in image comparison operations.
  • Library Features: The new blazediff library offers the same API and produces identical results as pixelmatch, while also being actively supported and providing out-of-the-box type safety.
  • External Adoption: blazediff has already been successfully integrated into vega/vega and is approved for integration into antvis/G, demonstrating its reliability and performance in other projects.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request replaces pixelmatch with blazediff for visual regression testing to improve performance. The changes are straightforward and correctly implemented across the board. The package.json file has been correctly updated to reflect the dependency change. The visual regression script now correctly imports and uses blazediff, which serves as a drop-in replacement for pixelmatch due to its compatible API. The documentation has also been updated to mention the new tool. Overall, this is a solid and well-executed performance optimization.

@coderabbitai coderabbitai bot added the lgtm This PR has been approved by a maintainer label Sep 11, 2025
@afc163 afc163 reopened this Sep 11, 2025
@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​blazediff/​core@​0.7.1581004192100
Addedreact-infinite-scroll-component@​6.1.010010010079100

View full report

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 11, 2025

@codecov
Copy link

codecov bot commented Sep 11, 2025

Bundle Report

Changes will increase total bundle size by 190 bytes (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
antd.min-array-push 3.38MB 190 bytes (0.01%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: antd.min-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
antd-with-locales.min.js 95 bytes 1.84MB 0.01%
antd.min.js 95 bytes 1.53MB 0.01%

@codecov
Copy link

codecov bot commented Sep 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (dbbdaf3) to head (a5f95d2).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #54941   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          775       775           
  Lines        14089     14089           
  Branches      3745      3745           
=========================================
  Hits         14089     14089           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@teimurjan
Copy link
Contributor Author

Hey @afc163!

FYI: I've checked the failed test cases with Pixelmatch, and the results are the same. It's not because of this PR's changes.

@afc163 afc163 merged commit 1a2574a into ant-design:master Sep 12, 2025
46 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer skip-verify-files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants