Skip to content

chore: update maintenance dependencies#92

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

chore: update maintenance dependencies#92
afc163 wants to merge 18 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

  • Documentation

    • 更新了 README 顶部徽标链接,点击可跳转到 Ant Design 官网。
    • 补充了中文文档中的相同入口体验。
  • Bug Fixes

    • 改进了 SSR 示例的挂载与卸载方式,提升与 React 18+ 的兼容性。
    • 增强了测试环境对旧接口的兼容处理,减少升级后的运行异常。
  • Chores

    • 优化了依赖与 TypeScript/ESLint 配置,提升整体开发与检查体验。

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

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

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

@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: 59 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: 98c83ff6-06b8-44ee-88c3-fd3e852ac40e

📥 Commits

Reviewing files that changed from the base of the PR and between 23a2cad and 0ecfb4b.

⛔ Files ignored due to path filters (1)
  • tests/__snapshots__/CSSMotion.spec.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (8)
  • .eslintrc.js
  • eslint.config.mjs
  • global.d.ts
  • package.json
  • src/CSSMotion.tsx
  • src/hooks/useDomMotionEvents.ts
  • tests/CSSMotion.spec.tsx
  • tsconfig.json

Walkthrough

本 PR 将 React 升级至 19、TypeScript 升级至 6,新增 ESLint flat config (eslint.config.mjs),补充兼容性类型声明文件(react-compat.d.tsglobal.d.ts),将 SSR 示例中的 hydrate 迁移至 hydrateRoot,并修复因 React 19 移除 findDOMNode 导致的测试兼容问题。

Changes

React 19 / TypeScript 6 兼容性升级

Layer / File(s) Summary
依赖升级与 TypeScript 配置更新
package.json, tsconfig.json
react/react-dom 升级至 ^19.2.7typescript 升级至 ^6.0.3,补充 ESLint 相关依赖;tsconfig.json 切换 moduleResolutionbundlermoduleESNext,放宽 strict* 选项,新增 react-compat.d.ts/global.d.tsinclude
兼容性类型声明文件
react-compat.d.ts, global.d.ts
新增 react-compat.d.tsreact/react-dom 补充 ReactTexthydrate 等缺失签名;新增 global.d.ts 补充 JSX 命名空间、jest.Matchers 扩展、vi 全局常量及 CSS/Less/jsonp 模块声明。
ESLint Flat Config 迁移
eslint.config.mjs
新增 ESLint flat config,通过 FlatCompat 加载旧 .eslintrc.js,实现 normalizeConfig 过滤 TypeScript 插件与规则,并对 ban-types/consistent-type-exports 使用 noopRule 覆盖。
SSR hydration 迁移与测试兼容修复
docs/examples/ssr.tsx, tests/CSSMotion.spec.tsx
将 SSR 示例的 hydrate 替换为 hydrateRoot,cleanup 改为 root.unmount();测试 beforeEach 中动态注入 findDOMNode mock,以兼容 React 19 移除该方法。
CI/文档细节更新
.github/dependabot.yml, README.md, README.zh-CN.md
dependabot 为 npm 与 github-actions 生态新增分组配置;README 徽标新增指向 https://ant.design 的外链包裹。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • react-component/motion#59:同样修改了 tests/CSSMotion.spec.tsx 中与 ReactDOM.findDOMNode 相关的行为——本 PR 在 React 19 移除该方法后动态注入兼容 shim,彼 PR 则直接移除/规避了 findDOMNode 的使用。

Suggested reviewers

  • zombieJ

🐇 从旧版跃向新天地,
React 十九已就位,
hydrate 换作 hydrateRoot,
类型声明把漏洞补,
小兔欢呼新版齐! 🎉

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

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

Code Review

This pull request upgrades the project's dependencies to React 19, TypeScript 6, and ESLint 9, introducing a flat ESLint configuration and adding several type definition files. Feedback on these changes highlights critical type-safety and configuration issues: disabling strict type-checking flags in tsconfig.json reduces safety; the ESLint configuration normalization may silently discard custom TypeScript rules; declaring Jest globals as any in global.d.ts conflicts with @types/jest; and redeclaring React functions in react-compat.d.ts can cause compiler conflicts.

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 global.d.ts Outdated
Comment thread react-compat.d.ts Outdated
@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

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 0ecfb4b.

@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 98.09%. Comparing base (4c0ecd9) to head (0ecfb4b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #92   +/-   ##
=======================================
  Coverage   98.09%   98.09%           
=======================================
  Files          11       11           
  Lines         421      421           
  Branches      119      121    +2     
=======================================
  Hits          413      413           
  Misses          7        7           
  Partials        1        1           

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

@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

@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/react-component?upgradeToPro=build-rate-limit

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

❌ Deploy failed

PR preview ❌ Failed ❌ Failed
🔗 Preview https://react-component-motion-preview-pr-92.surge.sh (may be unavailable)
📝 Commit0ecfb4b
🪵 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-motion-preview-pr-92.surge.sh
           size: 50 files, 1.7 MB

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

🤖 Powered by surge-preview

@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: 3

🤖 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 `@eslint.config.mjs`:
- Around line 26-45: The normalizeConfig function is filtering out too many
`@typescript-eslint/`* rules, which drops legacy rules like
`@typescript-eslint/no-explicit-any` from the merged config. Update
normalizeConfig so it only removes the intended rules and explicitly preserves
any legacy TS rules that should still apply, using the existing
recommendedTsRules check and the `@typescript-eslint/ban-types` exception as the
place to add the needed allowlist logic.

In `@tests/CSSMotion.spec.tsx`:
- Around line 859-864: The ReactDOM.findDOMNode stub in CSSMotion.spec.tsx is
missing writable: true, which can make later jest.spyOn(ReactDOM, 'findDOMNode')
calls fail on a read-only property. Update the Object.defineProperty setup in
the findDOMNode fallback so the defined property is writable as well as
configurable, keeping the existing jest.fn() stub and the surrounding ReactDOM
feature check unchanged.

In `@tsconfig.json`:
- Around line 15-21: The tsconfig changes are disabling global strict type
checking, which weakens coverage across the whole repository. Revert the blanket
switches in tsconfig.json for strict, noImplicitAny, strictNullChecks,
strictFunctionTypes, and related flags, then address any remaining TypeScript
incompatibilities locally in the affected modules using targeted fixes or
isolated suppressions instead of lowering the project-wide bar.
🪄 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: 852cffc1-cd8f-404e-9623-9617e04043dc

📥 Commits

Reviewing files that changed from the base of the PR and between 4c0ecd9 and 23a2cad.

📒 Files selected for processing (10)
  • .github/dependabot.yml
  • README.md
  • README.zh-CN.md
  • docs/examples/ssr.tsx
  • eslint.config.mjs
  • global.d.ts
  • package.json
  • react-compat.d.ts
  • tests/CSSMotion.spec.tsx
  • tsconfig.json

Comment thread eslint.config.mjs Outdated
Comment thread tests/CSSMotion.spec.tsx
Comment thread tsconfig.json Outdated
@afc163

afc163 commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

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

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 repo’s maintenance/tooling stack (React/TypeScript/ESLint/Testing Library), migrates ESLint to flat config for ESLint 9 + TypeScript ESLint 8, and applies a few small documentation and example updates to better align with newer React runtimes.

Changes:

  • Updates core dev dependencies (React/ReactDOM, TypeScript, ESLint and related plugins, Testing Library, typings) and adds grouped Dependabot updates.
  • Migrates from .eslintrc.js to eslint.config.mjs (flat config) for ESLint 9 compatibility.
  • Adjusts SSR example to use hydrateRoot and updates README logo links.

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tsconfig.json Updates TS module resolution and compiler options; adjusts include/exclude.
package.json Bumps a broad set of dev dependencies and adds new lint-related deps.
eslint.config.mjs Introduces ESLint flat config with TS/React/Jest integrations.
.eslintrc.js Removes legacy ESLint config in favor of flat config.
global.d.ts Adds global type references and ambient module declarations for tooling/tests.
src/hooks/useDomMotionEvents.ts Tweaks useRef initialization for updated TS behavior.
src/CSSMotion.tsx Initializes a ref with null to match updated React/TS expectations.
tests/CSSMotion.spec.tsx Adds compatibility handling for ReactDOM.findDOMNode in newer React versions.
tests/snapshots/CSSMotion.spec.tsx.snap Updates snapshot header comment.
docs/examples/ssr.tsx Switches SSR hydration to hydrateRoot and unmounts properly.
README.md Wraps Ant Design ecosystem logo with a link to ant.design.
README.zh-CN.md Same logo link change for Chinese README.
.github/dependabot.yml Enables grouped 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
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
Comment on lines 7 to 11
export default (
onInternalMotionEnd: (event: MotionEvent) => void,
): [(element: HTMLElement) => void, (element: HTMLElement) => void] => {
const cacheElementRef = useRef<HTMLElement>();
const cacheElementRef = useRef<HTMLElement | undefined>(undefined);

Comment thread tests/CSSMotion.spec.tsx
Comment on lines 858 to +862
beforeEach(() => {
if (!('findDOMNode' in ReactDOM)) {
Object.defineProperty(ReactDOM, 'findDOMNode', {
value: jest.fn(),
writable: true,
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