Skip to content

chore: remove deprecated deps#9505

Closed
zzjiaxiang wants to merge 1 commit intoant-design:masterfrom
zzjiaxiang:deprecated-deps
Closed

chore: remove deprecated deps#9505
zzjiaxiang wants to merge 1 commit intoant-design:masterfrom
zzjiaxiang:deprecated-deps

Conversation

@zzjiaxiang
Copy link
Copy Markdown
Contributor

 WARN  deprecated @types/history@5.0.0: This is a stub types definition. history provides its own type definitions, so you do not need this installed
close #7850

同时移除 resolutions

- Removed resolutions for outdated @types packages in package.json and pnpm-lock.yaml.
- Updated @types/react and @types/react-dom to their latest versions.
- Changed type import from 'history' to the native 'Location' in getBreadcrumbProps.tsx for better compatibility.
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Feb 24, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @zzjiaxiang, 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!

此拉取请求旨在通过移除已废弃的依赖项和清理相关的包管理配置来优化项目依赖。主要关注点是移除不再需要的 @types/history 包及其在代码中的引用,并同步更新 package.jsonpnpm-lock.yaml 文件,以确保依赖关系的准确性和精简性,从而提升项目的维护性和构建效率。

Highlights

  • 依赖项清理: 移除了已废弃的 @types/history 类型定义包,以减少不必要的依赖。
  • 配置优化: 清除了 package.json 中不再需要的 resolutions 配置和 pnpm-lock.yaml 中的 overrides 部分,简化了包管理配置。
  • 类型定义更新: 更新了 pnpm-lock.yaml 中多个包的 @types/react@types/react-dom 的 peer dependency 范围,并移除了 src/layout/utils/getBreadcrumbProps.tsx 中对 history 类型的直接引用。

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • package.json
    • 移除了 resolutions 字段,该字段曾用于覆盖特定依赖的版本。
    • 移除了开发依赖 @types/history
  • pnpm-lock.yaml
    • 移除了 overrides 部分。
    • 移除了 @types/history 的锁定文件条目。
    • 更新了 @types/react@types/react-dom 在多个包中的 peer dependency 范围,使其更加灵活。
    • 简化了 @stylelint/postcss-css-in-js@stylelint/postcss-markdown@vitest/coverage-istanbul 的依赖字符串,移除了冗余的上下文信息。
  • src/layout/utils/getBreadcrumbProps.tsx
    • 移除了对 history 库中 H 类型的导入。
    • location 属性的类型从 H.Location 更新为内置的 Location 或包含 pathname 的对象。
Activity
  • 目前没有检测到任何评论、审查或进度更新活动。
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.

@dosubot dosubot Bot added the dependencies Pull requests that update a dependency file label Feb 24, 2026
Copy link
Copy Markdown
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

本次提交移除了已弃用的 @types/history 依赖(history v5+ 已内置类型定义)以及冗余的 resolutions 配置,并同步更新了 pnpm-lock.yaml。这些更改有助于保持依赖的整洁。但在 src/layout/utils/getBreadcrumbProps.tsx 中,将 H.Location 替换为全局的 Location 类型会导致类型安全性下降,因为全局 Location 类型与路由库提供的 Location 接口在属性上存在显著差异。建议显式导入 history 提供的 Location 类型。

BreadcrumbItemType,
ItemType,
} from 'antd/lib/breadcrumb/Breadcrumb';
import type H from 'history';
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.

medium

虽然 @types/history 已弃用,但由于 history 库本身提供了类型定义,建议保留导入并改用命名导入 Location。这样可以避免在下方类型定义中误用全局的 DOM Location 类型。注意:如果 history 尚未在 package.json 中声明,建议将其添加到 devDependencies 中。

Suggested change
import type H from 'history';
import type { Location } from 'history';

home?: string;
location?:
| H.Location
| Location
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.

medium

此处的 Location 现在指向的是全局的 DOM Location 类型。全局 Location 包含许多与路由无关的属性(如 ancestorOrigins),且缺少 history 库中 Location 特有的 statekey 属性。配合上方的导入修改,这里的类型引用将更加准确。

@zzjiaxiang zzjiaxiang closed this Mar 3, 2026
@zzjiaxiang zzjiaxiang deleted the deprecated-deps branch March 3, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛[BUG]: Cannot find module 'history' or its corresponding type declarations.

1 participant