Skip to content

chore: update maintenance dependencies#790

Open
afc163 wants to merge 15 commits into
masterfrom
codex/update-maintenance-deps
Open

chore: update maintenance dependencies#790
afc163 wants to merge 15 commits into
masterfrom
codex/update-maintenance-deps

Conversation

@afc163

@afc163 afc163 commented Jun 29, 2026

Copy link
Copy Markdown
Member

Summary

  • Link the Ant Design ecosystem logo in README files to https://ant.design
  • Update React, React DOM, TypeScript, ESLint, Testing Library, @types/, @typescript-eslint/, lint-staged, and related lint dependencies
  • Add ESLint flat config compatibility for ESLint 9 and TypeScript ESLint 8
  • Use grouped Dependabot updates for npm and GitHub Actions

Test Plan

  • npm run lint
  • npm run tsc

Summary by CodeRabbit

  • 新功能

    • 更新了项目的开发与构建配置,增强了对较新 React/TypeScript 生态的支持。
    • README 顶部图标现在可点击跳转到官网。
  • Bug 修复

    • 调整了类型声明与测试预期,改善在新版本 React 下的兼容性。
    • 更新了 lint 配置,减少部分代码检查误报。
  • 文档

    • 中英文 README 的顶部展示体验更统一。

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/react-component?upgradeToPro=build-rate-limit

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@afc163, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 7 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 516cba16-66e6-4382-865d-b595e258ff87

📥 Commits

Reviewing files that changed from the base of the PR and between 45b4e35 and 67bdad9.

📒 Files selected for processing (8)
  • .eslintrc.js
  • README.md
  • README.zh-CN.md
  • eslint.config.mjs
  • global.d.ts
  • package.json
  • src/test/domHook.ts
  • tsconfig.json

Walkthrough

将 React 升级至 19.x、TypeScript 升级至 6.x、ESLint 升级至 9.x,新增 react-compat.d.tsglobal.d.ts 兼容类型声明,迁移至 ESLint Flat Config,更新 tsconfig.json 编译选项,并在相关测试中针对 React 19 行为差异添加条件断言。

Changes

工具链升级与 React 19 兼容

Layer / File(s) Summary
依赖版本升级与 tsconfig 调整
package.json, tsconfig.json
package.json 升级 React/ReactDOM 至 19.x、TypeScript 至 6.x、ESLint 至 9.x 及相关类型包;tsconfig.json 切换 moduleResolutionbundlermoduleESNext,重写 paths 映射,并将新声明文件加入 include
React 19 兼容类型声明与全局类型补充
react-compat.d.ts, global.d.ts
新增 react-compat.d.ts 补充 ReactTextuseRefisValidElementcloneElementhydrate 等在 React 19 下缺失的类型签名;新增 global.d.ts 补充样式模块声明、JSX 命名空间、jest.Matchers 扩展及全局 vi 类型。
ESLint Flat Config 迁移
eslint.config.mjs
新增 eslint.config.mjs,使用 FlatCompat.eslintrc.js 适配为 ESLint 9 Flat Config,实现 normalizeConfig 过滤 @typescript-eslint 插件与规则,并显式关闭若干已废弃规则。
React 19 条件断言更新
tests/hooks-17.test.tsx, tests/ref.test.tsx
新增 isReact19 标识,将 supportRefsupportNodeRefgetNodeRefuseId hydrate 相关的固定断言改为基于 React.version 的条件断言。
Dependabot 分组与 README 图标链接
.github/dependabot.yml, README.md, README.zh-CN.md
dependabot.yml 为 npm 和 github-actions 更新源新增 groups 分组配置;README 中顶部 Ant Design 图标包裹为指向 https://ant.design 的外链形式。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • react-component/util#593: 同样涉及 tests/ref.test.tsx 中针对 React 19 的 supportRef/supportNodeRef/getNodeRef 断言更新。
  • react-component/util#623: 修改 src/ref.tssupportRef 对 React 19.x 的逻辑,与本 PR 的测试条件断言直接对应。
  • react-component/util#602: 涉及 getNodeRef 的 null 处理与返回类型变更,与本 PR 新增的 getNodeRef(null) 断言相关。

Suggested reviewers

  • zombieJ

🐰 代码升级春风来,
React 十九展新颜,
类型声明添兼容,
断言随版本而变,
工具链焕然一新天!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了本次以维护性依赖和相关工具链升级为主的变更。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/update-maintenance-deps

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.

@socket-security

socket-security Bot commented Jun 29, 2026

Copy link
Copy Markdown

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

@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 upgrades the project's development dependencies to support React 19 and TypeScript 6.0, introduces a flat ESLint configuration (eslint.config.mjs), adds global type declarations, and configures Dependabot grouping. Feedback on these changes focuses on maintaining type safety and configuration cleanliness: the reviewer advises against disabling strict type-checking flags in tsconfig.json, suggests avoiding declaring standard testing globals as any in global.d.ts to preserve proper Jest types, and recommends simplifying the ESLint configuration by removing obsolete workarounds for @typescript-eslint/ban-types.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread tsconfig.json Outdated
Comment thread eslint.config.mjs Outdated
Comment thread eslint.config.mjs
Comment thread global.d.ts Outdated
@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
util Ready Ready Preview, Comment Jul 2, 2026 4:18am

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

❌ Deploy failed

PR preview ❌ Failed ❌ Failed
🔗 Preview https://react-component-util-preview-pr-790.surge.sh (may be unavailable)
📝 Commit67bdad9
🪵 LogsView logs
📋 Build log (last lines)
npm warn exec The following package was not found and will be installed: surge@0.27.4

   Running as afc163@gmail.com (Student)

        project: ./docs-dist
         domain: react-component-util-preview-pr-790.surge.sh
           size: 45 files, 1.7 MB

   Aborted - you do not have permission to publish to react-component-util-preview-pr-790.surge.sh

🤖 Powered by surge-preview

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

React Doctor found 1 issue in 1 file · 1 error · score 40 / 100 (Critical) · vs master

Errors

Reviewed by React Doctor for commit 67bdad9. See inline comments for fixes.

@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/afc163s-projects?upgradeToPro=build-rate-limit

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.42%. Comparing base (3de2f3c) to head (67bdad9).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #790   +/-   ##
=======================================
  Coverage   86.42%   86.42%           
=======================================
  Files          39       39           
  Lines        1068     1068           
  Branches      373      380    +7     
=======================================
  Hits          923      923           
  Misses        143      143           
  Partials        2        2           

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
global.d.ts (1)

11-20: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

尽量不要在这里继续声明全局 JSX 命名空间。 仓库里已经没有其他 JSX.* 旧引用,兼容层可以收敛到 React.JSX / declare module 'react'

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@global.d.ts` around lines 11 - 20, Remove the remaining global JSX namespace
declaration in the ambient typings and migrate this compatibility layer to
React.JSX or a declare module 'react' augmentation instead. Update the
JSX-related type aliases/interfaces currently defined in global.d.ts so they no
longer reopen global JSX, and keep the existing React.JSX symbols as the source
of truth for Element, IntrinsicElements, and related types.
tests/ref.test.tsx (1)

14-14: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

把版本判断改成按 major version 解析。 React.version.startsWith('19') 只覆盖 19.x,升级到 React 20 后这些断言会回落到旧分支;这里改成 isReact19OrNewer,与 src/ref.tsReactMajorVersion >= 19 保持一致。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/ref.test.tsx` at line 14, The React version check in the test file is
too narrow because React.version.startsWith('19') only matches 19.x, so update
the test’s version gate to parse the major version and rename it to align with
src/ref.ts’s ReactMajorVersion >= 19 logic. Locate the existing isReact19
constant in tests/ref.test.tsx and replace it with an isReact19OrNewer-style
check based on the parsed major version so the assertions follow the same branch
as the production code for React 20+.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@react-compat.d.ts`:
- Around line 14-16: Remove the legacy react-dom hydrate compatibility
declaration from react-compat.d.ts so TypeScript no longer exposes an API that
is unavailable in React/ReactDOM 19. Update any callers that rely on this
declaration to use hydrateRoot from react-dom/client instead, and verify the
ReactDOM typings align with the new client-based hydration entry point.

---

Nitpick comments:
In `@global.d.ts`:
- Around line 11-20: Remove the remaining global JSX namespace declaration in
the ambient typings and migrate this compatibility layer to React.JSX or a
declare module 'react' augmentation instead. Update the JSX-related type
aliases/interfaces currently defined in global.d.ts so they no longer reopen
global JSX, and keep the existing React.JSX symbols as the source of truth for
Element, IntrinsicElements, and related types.

In `@tests/ref.test.tsx`:
- Line 14: The React version check in the test file is too narrow because
React.version.startsWith('19') only matches 19.x, so update the test’s version
gate to parse the major version and rename it to align with src/ref.ts’s
ReactMajorVersion >= 19 logic. Locate the existing isReact19 constant in
tests/ref.test.tsx and replace it with an isReact19OrNewer-style check based on
the parsed major version so the assertions follow the same branch as the
production code for React 20+.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4031d7ea-5dae-4dee-b58e-e3cc0318287c

📥 Commits

Reviewing files that changed from the base of the PR and between 3de2f3c and 45b4e35.

📒 Files selected for processing (10)
  • .github/dependabot.yml
  • README.md
  • README.zh-CN.md
  • eslint.config.mjs
  • global.d.ts
  • package.json
  • react-compat.d.ts
  • tests/hooks-17.test.tsx
  • tests/ref.test.tsx
  • tsconfig.json

Comment thread react-compat.d.ts Outdated
Comment thread tests/ref.test.tsx
@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

Resource is limited - try again in 1 day (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/react-component?upgradeToPro=build-rate-limit

@afc163

afc163 commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

Related to ant-design/ant-design#58514.

Copilot AI review requested due to automatic review settings July 2, 2026 03:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the project’s maintenance/developer toolchain (React/TS/ESLint/testing libs) and associated configs, and aligns docs/tests for React 19 behavior changes.

Changes:

  • Updates core dev dependencies (React/ReactDOM, TypeScript, ESLint 9 + TypeScript ESLint, Testing Library, etc.).
  • Introduces ESLint flat config (eslint.config.mjs) and removes legacy .eslintrc.js.
  • Tweaks TypeScript config and adjusts tests/READMEs for updated ecosystem behavior (React 19 + docs branding/linking).

Reviewed changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tsconfig.json Updates TS module resolution and paths configuration; adds global.d.ts to compilation scope.
eslint.config.mjs Adds ESLint 9 flat config with TS/React/Jest integration.
.eslintrc.js Removes legacy ESLint config in favor of flat config.
package.json Bumps devDependencies (React/TS/ESLint/testing tooling) and related lint deps.
global.d.ts Adds global type references and ambient module declarations for toolchain compatibility.
tests/ref.test.tsx Updates expectations to account for React 19 ref-related behavior changes; adds a null-case assertion.
tests/hooks-17.test.tsx Updates useId fallback expectations to accommodate React 19 behavior.
src/test/domHook.ts Removes now-unneeded eslint disable directive (typescript-eslint v8/ESLint 9 migration).
README.md / README.zh-CN.md Links Ant Design logo to https://ant.design and minor formatting cleanup.
.github/dependabot.yml Enables grouped Dependabot updates for npm and GitHub Actions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread eslint.config.mjs
Comment on lines +89 to +92
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
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.

2 participants