Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,22 @@
"tsc": "tsc --noEmit"
},
"dependencies": {
"@rc-component/util": "^1.3.0"
"@rc-component/util": "^1.11.0"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

Does @rc-component/util version 1.11.0 export supportRef, isEqual, useEvent, and useLayoutEffect from the package root?

💡 Result:

No, @rc-component/util does not export supportRef, isEqual, useEvent, or useLayoutEffect directly from the package root [1][2]. These utilities are located within subdirectories of the package and must be imported via specific paths [1][2][3]. Based on the package structure, they are typically found under the lib/hooks/ or lib/Dom/ directories [1][2]. For example: - useEvent and useLayoutEffect are located in lib/hooks/ [1][2]. - Other utilities like supportRef or isEqual are similarly nested within the package's internal structure rather than being exposed at the top level [1][2]. To use these utilities, you should use path-based imports, such as: import { useEvent } from '@rc-component/util/lib/hooks/useEvent'; import { useLayoutEffect } from '@rc-component/util/lib/hooks/useLayoutEffect'; Note that as of May 15, 2026, the latest stable version of @rc-component/util is 1.10.0 [4][5]. Version 1.11.0 has not been released [1][4].

Citations:


@rc-component/util 版本 1.11.0 不存在,且导出结构不支持从根路径导入。

@rc-component/util 的最新稳定版本为 1.10.0(截至 2026 年 5 月),版本 1.11.0 尚未发布。此外,supportRefisEqualuseEventuseLayoutEffect 不是从包根路径导出的,而是位于嵌套目录中,需要通过特定的路径导入,例如:@rc-component/util/lib/hooks/useEvent@rc-component/util/lib/hooks/useLayoutEffect。请更正依赖版本并根据实际包结构调整导入路径。

🤖 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 `@package.json` at line 38, Update package.json to use the actual published
version of `@rc-component/util` (change the dependency from "^1.11.0" to
"^1.10.0"), and update all imports that assume root exports: replace root
imports of supportRef, isEqual, useEvent and useLayoutEffect with the package's
nested paths (e.g. import useEvent from "@rc-component/util/lib/hooks/useEvent",
import useLayoutEffect from "@rc-component/util/lib/hooks/useLayoutEffect", and
import isEqual/supportRef from their correct lib locations) so the code
references the real exported modules and the dependency version matches the
published release.

},
"devDependencies": {
"@rc-component/father-plugin": "^2.0.2",
"@rc-component/father-plugin": "^2.2.0",
"@rc-component/np": "^1.0.4",
"@types/jest": "^29.5.0",
"@types/node": "^24.5.2",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@types/warning": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
Comment on lines +48 to +49
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# 验证 ESLint 配置是否能正常加载和解析

# 测试 ESLint 能否成功解析配置文件
npx eslint --print-config .eslintrc.js > /dev/null 2>&1
if [ $? -eq 0 ]; then
  echo "✓ ESLint 配置加载成功"
else
  echo "✗ ESLint 配置加载失败"
  npx eslint --print-config .eslintrc.js
fi

Repository: react-component/context

Length of output: 456


🏁 Script executed:

cat -n package.json | sed -n '40,60p'

Repository: react-component/context

Length of output: 859


🏁 Script executed:

cat -n .eslintrc.js

Repository: react-component/context

Length of output: 1023


🏁 Script executed:

rg "prettier|eslint-config" package.json

Repository: react-component/context

Length of output: 49


🏁 Script executed:

rg "eslint-config-prettier|prettier" . -t js -t json --max-count=5

Repository: react-component/context

Length of output: 49


🏁 Script executed:

# 检查 `@umijs/fabric` 的实际依赖
npm info `@umijs/fabric`@4.0.0 peerDependencies 2>/dev/null || echo "检查package-lock或yarn.lock"

Repository: react-component/context

Length of output: 92


🏁 Script executed:

# 检查是否存在 package-lock.json 或 yarn.lock
ls -la package-lock.json yarn.lock 2>/dev/null || echo "No lock files found"

Repository: react-component/context

Length of output: 87


ESLint 配置加载失败,原因为缺少 eslint-config-prettier 依赖。

ESLint 配置无法加载,错误信息指出缺少 "prettier" 配置。.eslintrc.js 扩展自 @umijs/fabric/dist/eslint,而 @umijs/fabric 依赖 eslint-config-prettier。需要将 eslint-config-prettier 添加到 devDependencies,而非仅依赖版本调整来解决。建议与 @umijs/fabric ^4.0.0 的兼容性要求一并检查。

🤖 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 `@package.json` around lines 48 - 49, The project ESLint config fails because
eslint-config-prettier is missing; add "eslint-config-prettier" to package.json
devDependencies (paired with the existing "@umijs/fabric" dependency) and choose
a version compatible with `@umijs/fabric` (check `@umijs/fabric` ^4.0.0
requirements), then reinstall dev deps; update the devDependencies entry for
eslint-config-prettier in package.json and run your package manager to install
so .eslintrc.js can extend `@umijs/fabric` without the "prettier" config error.

"@umijs/fabric": "^4.0.0",
"dumi": "^2.0.15",
"eslint": "^8.54.0",
"eslint-plugin-jest": "^28.2.0",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-unicorn": "^52.0.0",
"father": "^4.0.0",
"rc-test": "^7.0.14",
Expand All @@ -57,7 +59,7 @@
"typescript": "^5.0.2"
},
"peerDependencies": {
"react": ">=16.9.0",
"react-dom": ">=16.9.0"
"react": ">=18.0.0",
"react-dom": ">=18.0.0"
Comment on lines +62 to +63
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

reactreact-dompeerDependencies 提升至 >=18.0.0 是一个破坏性变更(Breaking Change)。虽然这是为了与 @rc-component/util 的要求保持一致,但这会影响到仍在使用 React 16 或 17 的用户。建议确认这是否符合当前大版本的发布计划,或者是否应该通过发布新的大版本(Major Version)来引入此变更。

}
}
2 changes: 1 addition & 1 deletion src/Immutable.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { supportRef } from '@rc-component/util/lib/ref';
import { supportRef } from '@rc-component/util';
import * as React from 'react';

export type CompareProps<T extends React.ComponentType<any>> = (
Expand Down
4 changes: 1 addition & 3 deletions src/context.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import useEvent from '@rc-component/util/lib/hooks/useEvent';
import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect';
import isEqual from '@rc-component/util/lib/isEqual';
import { isEqual, useEvent, useLayoutEffect } from '@rc-component/util';
import * as React from 'react';
import { unstable_batchedUpdates } from 'react-dom';

Expand Down
Loading