Skip to content

chore: add @babel/runtime into dependencies - #55938

Merged
afc163 merged 4 commits into
ant-design:masterfrom
meet-student:patch-1
Dec 2, 2025
Merged

afc163 merged 4 commits into
ant-design:masterfrom
meet-student:patch-1

Conversation

@meet-student

Copy link
Copy Markdown
Member

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English MISC: Fix that could not build with pnpm hoist: false.
🇨🇳 Chinese 杂项:修复版本无法在 pnpm hoist:false 下通过 vite 编译

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@bolt-new-by-stackblitz

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented Nov 27, 2025 •

Copy link
Copy Markdown
Contributor

👁 Visual Regression Report for PR #55938 Passed ✅

🎯 Target branch: master (7c5d0fd)
📖 View Full Report ↗︎
📖 Alternative Report ↗︎

🎊 Congrats! No visual-regression diff found.

@github-actions

github-actions Bot commented Nov 27, 2025 •

Copy link
Copy Markdown
Contributor

Preview is ready

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @meet-student, 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 addresses a build failure encountered in specific pnpm environments. By ensuring a critical runtime dependency is properly declared, it enhances the project's compatibility and stability across different package management configurations.

Highlights

  • Build Fix: Resolves an issue where the project failed to build when using pnpm with hoist: false by explicitly adding @babel/runtime as a dependency.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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. ↩

@coderabbitai

coderabbitai Bot commented Nov 27, 2025 •

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@meet-student has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 34 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 0f3851a and 840a229.

📒 Files selected for processing (1)
  • package.json (1 hunks)

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Summary by CodeRabbit

发行说明

  • 杂务
    • 更新了项目依赖以优化运行时性能和兼容性。

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

在 package.json 的 dependencies 中新增了 "@babel/runtime": "^7.24.7" 依赖,未包含其他功能或控制流修改。

Changes

Cohort / File(s) 变更摘要
依赖变更
package.json
在 dependencies 中添加了 "@babel/runtime": "^7.24.7"

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 分钟

  • 核实所选版本 ^7.24.7 是否为合适且兼容的最低版本(与使用场景及上游库兼容性)。
  • 验证在 pnpm hoist:false + Vite 的场景中该依赖确实解决了模块解析错误并且不会引入新的打包问题。
  • 检查 lockfile(如 pnpm-lock.yaml)是否需要更新并确认发布流程中的依赖一致性。

兔子的庆祝诗

🐰 新依赖轻声来,Babel 伴我跳跃开,
hoist:false 不再慌,Vite 编译笑颜开,
小小包裹大安心,代码奔跑向未来。 ✨

步骤说明

在 package.json 的 dependencies 中添加了 "@babel/runtime" 依赖,用于解决 pnpm hoist:false 环境下 Vite 编译时的模块解析问题。

变更项

类别 / 文件 变更摘要
依赖配置
package.json
在 dependencies 中添加 "@babel/runtime": "^7.24.7"

代码审查工作量评估

🎯 2 (简单) | ⏱️ ~10 分钟

  • 需要验证 "@babel/runtime" 版本 ^7.24.7 是否为正确的最低兼容版本
  • 建议确认该版本确实解决了在 pnpm hoist:false 模式下的模块解析问题

兔子的庆祝诗

🐰 依赖添入不复杂,Babel 运行来作伴,
hoist:false 风波去,Vite 编译又见欢。

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 标题清晰准确地描述了主要变更:添加@babel/runtime依赖。
Description check ✅ Passed 描述与变更相关,说明了修复pnpm hoist:false下构建失败的问题,引用了相关issue。
Linked Issues check ✅ Passed PR通过在dependencies中添加@babel/runtime依赖来解决issue #55937中的构建问题,符合修复目标。
Out of Scope Changes check ✅ Passed PR仅添加了@babel/runtime依赖到package.json,与解决pnpm hoist:false构建问题的目标相关,无超出范围的变更。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request correctly adds @babel/runtime to the dependencies to fix a build issue when using pnpm with hoist: false. This is the right approach to ensure Babel helper functions are available. However, I've found a critical issue with the specified version of the package which will prevent installation.

Comment thread package.json Resolved
meet-student and others added 2 commits November 27, 2025 10:18
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: 遇见同学 <1875694521@qq.com>
@pkg-pr-new

pkg-pr-new Bot commented Nov 27, 2025 •

Copy link
Copy Markdown

@codecov

codecov Bot commented Nov 27, 2025 •

Copy link
Copy Markdown

Bundle Report

Changes will decrease total bundle size by 8.23MB (-67.91%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
antd.min-array-push 3.89MB -8.23MB (-67.91%) ⬇️

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 (New) 2.14MB 2.14MB 100.0% 🚀
antd.min.js (New) 1.75MB 1.75MB 100.0% 🚀
antd-with-locales.js (Deleted) -6.37MB 0 bytes -100.0% 🗑️
antd.js (Deleted) -5.75MB 0 bytes -100.0% 🗑️

@socket-security

socket-security Bot commented Nov 27, 2025 •

Copy link
Copy Markdown

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

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​babel/​runtime@​7.28.41001007992100

View full report

@codecov

codecov Bot commented Nov 27, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (7c5d0fd) to head (840a229).
⚠️ Report is 40 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #55938   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          803       803           
  Lines        14812     14812           
  Branches      3913      3913           
=========================================
  Hits         14812     14812           

☔ 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.

@yoyo837

yoyo837 commented Nov 27, 2025

Copy link
Copy Markdown
Contributor

要不要用peerDependencies?

@meet-student

meet-student commented Nov 27, 2025 •

Copy link
Copy Markdown
Member Author

要不要用peerDependencies?

也可以, 问问 @zombieJ

@Wxh16144

Copy link
Copy Markdown
Member

要不要用peerDependencies?

也可以, 问问 @zombieJ

我认为不需要,之前也是就只存在 dependencies 里面,而且这部分只有当用户导入了 antd/lib/xxx 的时候才会有 babel runtime 的导入

@afc163
afc163 requested a review from zombieJ November 27, 2025 10:56
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Dec 2, 2025
@afc163
afc163 merged commit 2389620 into ant-design:master Dec 2, 2025
39 checks passed
@yoyo837 yoyo837 mentioned this pull request Dec 2, 2025
1 of 17 tasks
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v6版本无法在 pnpm hoist:false 下通过 vite 编译

5 participants