Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type: add deprecated info for overlayClassName #486

Merged
merged 3 commits into from
Dec 4, 2024

Conversation

thinkasany
Copy link
Contributor

@thinkasany thinkasany commented Dec 3, 2024

Summary by CodeRabbit

  • 新功能

    • 引入了 styles 属性,允许在 rc-tooltip 组件中应用语义化的 DOM 样式。
  • 文档

    • 更新了 README.md 中的 API 文档,标记 overlayClassName 属性为弃用,建议使用 classNames={{ root: {} }}
    • 添加了新的 classNames 属性的文档说明。

Copy link

vercel bot commented Dec 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tooltip ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 3, 2024 1:53am

Copy link

coderabbitai bot commented Dec 3, 2024

Walkthrough

本次变更主要涉及README.md文件和src/Tooltip.tsx文件的更新。README.md中对rc-tooltip组件的API文档进行了修订,标记了overlayClassName属性为不推荐使用,并建议用户改用classNames={{ root: {} }}。同时,引入了styles属性,以便应用语义化的DOM样式。src/Tooltip.tsx文件中,TooltipProps接口新增了overlayClassName属性,仍然保持了组件的整体结构和功能不变。

Changes

文件路径 变更摘要
README.md - 属性不推荐使用: overlayClassName → 请使用 classNames={{ root: {} }}
- 新增属性: classNamesstyles
src/Tooltip.tsx - 新增属性: overlayClassName?: string;TooltipProps 接口中

Possibly related PRs

  • feat: supports classnames & styles #484: 此PR向TooltipProps接口引入了新属性classNamesstyles,与主PR中关于rc-tooltip组件API文档更新的变更直接相关。
  • type: add deprecated info #485: 此PR也修改了TooltipProps接口,添加了overlayStyleoverlayInnerStyle的不推荐使用注释,与主PR中对overlayClassName的不推荐使用和styles属性的推广相一致。

Suggested reviewers

  • afc163

在草地上跳跃的兔子,
新属性如花般绽放,
不再用旧的方式,
让我们一起欢畅!
代码更新如春风,
让组件更美丽动人。
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 eslint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/Tooltip.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Cannot read config file: /.eslintrc.js
Error: Cannot find module '@umijs/fabric/dist/eslint'
Require stack:

  • /.eslintrc.js
  • /node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli-engine/cli-engine.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/eslint.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/index.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/bin/eslint.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Module._load (node:internal/modules/cjs/loader:1074:27)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)
    at require (node:internal/modules/helpers:135:16)
    at Object. (/.eslintrc.js:1:14)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
    at Module.load (node:internal/modules/cjs/loader:1317:32)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Dec 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (2679015) to head (ea93db3).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #486   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines           26        26           
  Branches        10        10           
=========================================
  Hits            26        26           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
README.md (1)

86-86: API 文档更新完善

废弃提示信息明确,新的 classNames 属性文档完整,类型定义准确。建议补充一个简单的迁移示例。

建议添加如下迁移示例:

- <Tooltip overlayClassName="custom-tooltip">
+ <Tooltip classNames={{ root: 'custom-tooltip' }}>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 2679015 and ea93db3.

📒 Files selected for processing (2)
  • README.md (1 hunks)
  • src/Tooltip.tsx (1 hunks)
🔇 Additional comments (2)
src/Tooltip.tsx (2)

38-39: 属性废弃标记正确添加

废弃提示信息清晰地指出了替代方案,这与 README.md 中的文档保持一致。


Line range hint 103-103: 类名合并处理得当

在 Trigger 组件中使用 classNames 模块正确地合并了废弃的 overlayClassName 和新的 classNames.root,确保了向后兼容性。

@afc163 afc163 merged commit dcae397 into react-component:master Dec 4, 2024
9 checks passed
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