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

chore(sidenavbar): deprecated component suggestions #2897

Merged
merged 2 commits into from
Dec 27, 2024

Conversation

Alex-huxiyang
Copy link
Collaborator

@Alex-huxiyang Alex-huxiyang commented Dec 27, 2024

🤔 这个变动的性质是?

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

💡 需求背景和解决方案

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • fork仓库代码是否为最新避免文件冲突
  • Files changed 没有 package.json lock 等无关文件

Summary by CodeRabbit

  • 文档更新

    • SideNavBar 组件的文档已添加废弃通知,建议用户使用 SideBar 组件。
    • 废弃通知在各语言版本的文档开头显著显示。
  • 功能改进

    • SideNavBar 组件中添加了控制台警告,提醒用户该组件已废弃并建议使用 SideBar

Copy link

coderabbitai bot commented Dec 27, 2024

Caution

Review failed

The pull request is closed.

概述

演练

此拉取请求针对 SideNavBar 组件进行了文档和代码更新,标记该组件为已弃用。在多个语言版本的文档中,添加了明确的弃用通知,建议用户改用 SideBar 组件。同时,在 sidenavbar.tsxsidenavbar.taro.tsx 文件中,通过 useEffect 钩子添加了控制台警告,提醒开发者该组件即将被移除。

变更

文件 变更摘要
src/packages/sidenavbar/doc.* 在多语言文档中添加弃用通知
src/packages/sidenavbar/sidenavbar.tsx 添加 useEffect 钩子,记录弃用警告;更新 SideNavBarProps 接口注释
src/packages/sidenavbar/sidenavbar.taro.tsx sidenavbar.tsx 类似的变更

可能相关的 PR

建议标签

size/XS, 2.x

建议评审人

  • oasis-cloud

诗歌

🐰 侧边栏,旧时光
告别的钟声轻轻响
新组件已悄然登场
代码进化,无需彷徨
前行吧,开发者勇敢向前方!


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 286a2e8 and 207b8de.

📒 Files selected for processing (1)
  • src/packages/sidenavbar/doc.en-US.md (1 hunks)

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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

@github-actions github-actions bot added the 3.x label Dec 27, 2024
@Alex-huxiyang Alex-huxiyang changed the title chore: deprecated component help chore(sidenavbar): deprecated component suggestions Dec 27, 2024
Copy link

codecov bot commented Dec 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.88%. Comparing base (436eff4) to head (207b8de).
Report is 1 commits behind head on feat_v3.x.

Additional details and impacted files
@@            Coverage Diff             @@
##           feat_v3.x    #2897   +/-   ##
==========================================
  Coverage      85.88%   85.88%           
==========================================
  Files            271      271           
  Lines          18429    18434    +5     
  Branches        2726     2727    +1     
==========================================
+ Hits           15827    15832    +5     
  Misses          2597     2597           
  Partials           5        5           

☔ 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: 2

🧹 Nitpick comments (3)
src/packages/sidenavbar/sidenavbar.taro.tsx (2)

7-9: 【Deprecated 注释】注明弃用原因有助用户理解。

已使用 JSDoc 注释声明该组件过时,建议补充:从哪一版本开始废弃、后续删除或切换时限等信息,可增强维护者的预期管理和迁移参考。


29-33: 【useEffect 提示】在组件首屏挂载时打印警告。

  • 若仅需在项目开发环境输出警告,可考虑在生产环境下屏蔽日志,以免干扰用户。
  • 若需要更灵活的引导,可以在文档和控制台日志里都提供完整的迁移方案链接或文档地址。
src/packages/sidenavbar/sidenavbar.tsx (1)

30-34: 建议改进弃用警告消息

当前的警告消息可以更加具体和有帮助。

建议按照以下方式修改:

  useEffect(() => {
    console.warn(
-      'Warning: SideNavBar is deprecated and will be removed in future versions. Please use NewComponent SideBar instead.'
+      'Warning: SideNavBar 组件已弃用,将在下一个主版本中移除。请使用 SideBar 组件代替。迁移指南请参考:[迁移文档URL]'
    )
  }, [])
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 436eff4 and 286a2e8.

📒 Files selected for processing (6)
  • src/packages/sidenavbar/doc.en-US.md (1 hunks)
  • src/packages/sidenavbar/doc.md (1 hunks)
  • src/packages/sidenavbar/doc.taro.md (1 hunks)
  • src/packages/sidenavbar/doc.zh-TW.md (1 hunks)
  • src/packages/sidenavbar/sidenavbar.taro.tsx (2 hunks)
  • src/packages/sidenavbar/sidenavbar.tsx (2 hunks)
🧰 Additional context used
🪛 Markdownlint (0.37.0)
src/packages/sidenavbar/doc.en-US.md

3-3: null
Link fragments should be valid

(MD051, link-fragments)

src/packages/sidenavbar/doc.taro.md

3-3: null
Link fragments should be valid

(MD051, link-fragments)

src/packages/sidenavbar/doc.md

3-3: null
Link fragments should be valid

(MD051, link-fragments)

src/packages/sidenavbar/doc.zh-TW.md

3-3: null
Link fragments should be valid

(MD051, link-fragments)

🔇 Additional comments (4)
src/packages/sidenavbar/sidenavbar.taro.tsx (1)

1-1: 【建议】统一导入风格,保证可维护性。

此处增加了 useEffect 的导入,和其他地方的 React Hook 导入保持一致即可,无需额外改动。若组件后续扩展 Hook,建议集中管理相关导入。

src/packages/sidenavbar/doc.md (1)

3-3: 【链接有效性】确认文档引用的链接可用。

当前超链接 [SideBar](#/zh-CN/component/sidebar) 需要在相应页面里有对应锚点或路由,否则可能导致跳转失败。请确认链接的有效性,或在文档里补充对应的标题标记。

如下脚本可检查是否存在对应页面及锚点标题,如无匹配需进行修正:

🧰 Tools
🪛 Markdownlint (0.37.0)

3-3: null
Link fragments should be valid

(MD051, link-fragments)

src/packages/sidenavbar/doc.taro.md (1)

3-4: 【废弃说明】请确认全局文档一致性。

建议在其他相关文档(如英文版或多语言版本)也统一补充相同警示,保持废弃策略可追踪,便于开发者一致地获取迁移信息。

🧰 Tools
🪛 Markdownlint (0.37.0)

3-3: null
Link fragments should be valid

(MD051, link-fragments)

src/packages/sidenavbar/sidenavbar.tsx (1)

1-1: 导入和接口文档更改正确!

新增的 useEffect 导入和接口的弃用文档注释都符合最佳实践。

Also applies to: 7-9

src/packages/sidenavbar/doc.zh-TW.md Show resolved Hide resolved
Comment on lines 3 to 4
> **⚠️ Note:** This component is deprecated and will be removed in the future. Please use [SideBar](#/en-UScomponent/sidebar) instead.

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

修复文档中的组件链接

文档中的 SideBar 组件链接 #/en-UScomponent/sidebar 格式不正确。

建议修改为:

-> **⚠️ Note:** This component is deprecated and will be removed in the future. Please use [SideBar](#/en-UScomponent/sidebar) instead.
+> **⚠️ Note:** This component is deprecated and will be removed in the future. Please use [SideBar](#/en-US/component/sidebar) instead.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
> **⚠️ Note:** This component is deprecated and will be removed in the future. Please use [SideBar](#/en-UScomponent/sidebar) instead.
> **⚠️ Note:** This component is deprecated and will be removed in the future. Please use [SideBar](#/en-US/component/sidebar) instead.
🧰 Tools
🪛 Markdownlint (0.37.0)

3-3: null
Link fragments should be valid

(MD051, link-fragments)

@xiaoyatong xiaoyatong merged commit 58f1107 into jdf2e:feat_v3.x Dec 27, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants