8000 update destroyTooltipOnHide to destroyOnHidden by li-jia-nan · Pull Request #495 · react-component/tooltip · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

update destroyTooltipOnHide to destroyOnHidden #495

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

Merged
merged 5 commits into from
May 19, 2025
Merged

update destroyTooltipOnHide to destroyOnHidden #495

merged 5 commits into from
May 19, 2025

Conversation

li-jia-nan
Copy link
Member
@li-jia-nan li-jia-nan commented May 18, 2025

Summary by CodeRabbit

  • 新功能

    • 新增 Vercel 部署配置文件,指定使用 umijs 框架。
    • 构建输出目录现可自定义。
  • 文档

    • README 中 Tooltip 组件属性表优化格式,属性名与代码保持一致,相关描述更新。
    • 示例文档代码增加类型标注,提升可读性和类型安全性。
  • 重构

    • Tooltip 组件属性 destroyTooltipOnHide 重命名为 destroyOnHidden,相关文档、示例和测试同步更新。
    • Tooltip 组件和 Popup 组件的声明方式优化,提升类型安全和可维护性。
  • 依赖升级

    • React 及相关依赖升级至 19.x,类型定义同步更新,提升兼容性。
  • 杂项

    • .gitignore 文件优化,新增 pnpm-lock.yaml 忽略规则。
    • 删除旧的 now.json 部署配置文件。
    • 新增 GitHub Actions 工作流,实现文档自动构建和部署至 GitHub Pages。

Copy link
vercel bot commented May 18, 2025

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 May 19, 2025 5:03am

Copy link
coderabbitai bot commented May 18, 2025

"""

Walkthrough

本次变更主要包括对 Tooltip 组件及其相关示例的类型注解优化、属性命名统一(destroyTooltipOnHide 重命名为 destroyOnHidden)、依赖升级(React 及类型相关包)、构建与部署配置调整(新增 Vercel 配置、删除 now.json、更新 .dumirc.ts 输出路径)、文档和测试同步更新。

Changes

文件/路径分组 变更摘要
.dumirc.ts 配置新增 outputPath: '.doc',指定自定义输出目录。
.gitignore 新增忽略 pnpm-lock.yaml,移除 .env.local 行尾空格,文件末尾添加换行。
README.md Tooltip 属性表格式优化,属性名 destroyTooltipOnHide 改为 destroyOnHidden,部分描述格式微调。
docs/examples/arrowContent.tsx
docs/examples/placement.tsx
docs/examples/showArrow.tsx
docs/examples/point.tsx
显式添加 TypeScript 类型注解,组件声明统一为 React.FC,样式对象类型明确为 React.CSSProperties
docs/examples/formError.tsx handleChange 方法参数类型明确为 React.ChangeEvent<HTMLInputElement>,方法体简化为单行。
docs/examples/onVisibleChange.tsx preventDefaultonVisibleChange 方法参数类型明确,setState 调用简化。
docs/examples/simple.tsx 组件及状态属性、事件处理、渲染、传递属性等,destroyTooltipOnHide 全部重命名为 destroyOnHidden
now.json 删除部署配置文件 now.json。
package.json 升级 React 及相关类型依赖,新增 @types/nodedocs:deploy 脚本先构建后部署,peerDependencies 升级 React 版本要求。
src/Popup.tsx Popup 组件由默认导出函数重构为命名常量 React.FC<ContentProps>,导出方式调整,props 解构格式优化。
src/Tooltip.tsx 组件重构为内联 React.forwardRef,属性 destroyTooltipOnHide 统一重命名为 destroyOnHidden,事件处理属性命名同步调整。
tests/index.test.tsx 测试用例中 destroyTooltipOnHide 全部更名为 destroyOnHidden,console.error mock 格式微调。
vercel.json 新增 Vercel 部署配置文件,指定框架为 "umijs"。
.github/workflows/site-deploy.yml 新增 GitHub Actions 工作流,用于在标签推送时构建并部署网站到 GitHub Pages。

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Tooltip
    participant Trigger
    participant Popup

    User->>Tooltip: 传递 destroyOnHidden 属性
    Tooltip->>Trigger: 传递 autoDestroy={destroyOnHidden}
    Trigger->>Popup: 控制弹层显示/销毁
    User->>Tooltip: 触发 onOpenChange/afterOpenChange 事件
    Tooltip->>Trigger: 事件重命名同步传递
Loading

Suggested reviewers

  • zombieJ

Poem

代码如风轻轻吹,
Tooltip 属性换新衣。
类型注解更严谨,
部署脚本焕活力。
兔子挥爪庆更新,
🌱新版本,跃然生!
"""

✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Commit Unit Tests in branch update-api
  • Post Copyable Unit Tests in Comment

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
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 ver 8000 y 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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this 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
socket-security bot commented May 18, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​types/​react-dom@​18.3.7 ⏵ 19.1.510010072 -195100
Updated@​types/​react@​18.3.21 ⏵ 19.1.4100 +110078 +195100
Updated@​testing-library/​react@​14.3.1 ⏵ 16.3.09910010089100

View full report

Copy link
codecov bot commented May 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #495   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines           33        33           
  Branches        12        12           
=========================================
  Hits            33        33           

☔ View full report in Codecov by Sentry.
📢 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.

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.

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

🧹 Nitpick comments (3)
.github/workflows/site-deploy.yml (3)

3-7: 建议限定标签触发模式
当前 on.push.tags: ['*'] 会对所有标签进行部署,可能引发误触。建议使用严格的语义版本格式(例如 v*.*.*),以只对发布版本的标签触发构建。


23-25: 确认生成 package-lock.json 步骤的必要性
如果仓库已包含 package-lock.jsonnpm i --package-lock-only --ignore-scripts 这一步只是重新生成锁文件,可考虑移除以加快 CI;如因特殊需求保留,请在注释中说明原因。


32-33: 升级 peaceiris/actions-gh-pages Action 版本(可选)
建议将 peaceiris/actions-gh-pages@v3 升级到最新的 @v4 版本,以获取新功能和安全修复:

-        uses: peaceiris/actions-gh-pages@v3
+        uses: peaceiris/actions-gh-pages@v4
🧰 Tools
🪛 actionlint (1.7.7)

33-33: the runner of "peaceiris/actions-gh-pages@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e8f563c and ed1dafa.

📒 Files selected for processing (1)
  • .github/workflows/site-deploy.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/site-deploy.yml

16-16: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


19-19: the runner of "actions/setup-node@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


33-33: the runner of "peaceiris/actions-gh-pages@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

@zombieJ zombieJ merged commit 5f7f8b1 into master May 19, 2025
10 checks passed
@li-jia-nan li-jia-nan deleted the update-api branch May 19, 2025 07:13
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
0