-
Notifications
You must be signed in to change notification settings - Fork 266
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
Conversation
Caution Review failedThe pull request is closed. 概述演练此拉取请求针对 变更
可能相关的 PR
建议标签
建议评审人
诗歌
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
There was a problem hiding this 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
📒 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.en-US.md
Outdated
> **⚠️ Note:** This component is deprecated and will be removed in the future. Please use [SideBar](#/en-UScomponent/sidebar) instead. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修复文档中的组件链接
文档中的 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.
> **⚠️ 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)
🤔 这个变动的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit
文档更新
SideNavBar
组件的文档已添加废弃通知,建议用户使用SideBar
组件。功能改进
SideNavBar
组件中添加了控制台警告,提醒用户该组件已废弃并建议使用SideBar
。