-
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
feat: v15 适配demo页面 #2896
feat: v15 适配demo页面 #2896
Conversation
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
packages/nutui-taro-demo/src/pages/index/index.tsxOops! Something went wrong! :( ESLint: 8.57.0 ESLint couldn't find the config "taro/react" to extend from. Please check that the name of the config is correct. The config "taro/react" was referenced from the config file in "/packages/nutui-taro-demo/.eslintrc". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. 变更概览详细说明代码变更总览代码仓库变更
变更列表
可能相关的 PR
建议标签
建议审阅者
庆祝诗歌
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
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 #2896 +/- ##
==========================================
Coverage 85.97% 85.97%
==========================================
Files 277 277
Lines 18692 18692
Branches 2769 2769
==========================================
Hits 16070 16070
Misses 2617 2617
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: 0
🧹 Nitpick comments (1)
packages/nutui-taro-demo/src/pages/index/index.tsx (1)
72-72
: 在内联样式中使用统一的圆角配置,增强可维护性。
此处直接写死borderRadius: '8px'
可以满足需求,但如果需要在项目多个地方保持相同圆角,不妨考虑统一抽离到全局样式或主题变量,以便后续维护。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
packages/nutui-taro-demo/src/pages/index/index.scss
(2 hunks)packages/nutui-taro-demo/src/pages/index/index.tsx
(1 hunks)scripts/rn/copy-file.js
(1 hunks)scripts/rn/update-taro-entry.js
(1 hunks)scripts/sync-to-taro-playground.js
(1 hunks)scripts/taro/generate-taro-pages.js
(1 hunks)src/config.json
(22 hunks)src/sites/mobile/Links.scss
(2 hunks)
🔇 Additional comments (10)
src/sites/mobile/Links.scss (2)
37-37
: 缩小圆角半径后需注意整体视觉统一。
将 30px
改为 12px
后,与本次改动的其他组件圆角更一致;请确保完整场景下的视觉风格和设计规范相匹配。
55-55
: 统一使用更小的 8px 圆角,提高界面规整度。
border-radius: 8px
与同一页面或组件中的其他圆角值保持一致,风格更加协调。
packages/nutui-taro-demo/src/pages/index/index.scss (2)
99-99
: 将大圆角调整为 12px 有助于保持整体风格一致。
本行改动与其他文件中 12px
的圆角设定相呼应,已实现统一的视觉语言。
119-119
: 将子项圆角统一为 8px,增强布局一致性。
与对应列表元素及样式文件相呼应,确保视图整齐美观,便于后续维护。
scripts/rn/copy-file.js (1)
14-15
: **建议在注释中明确 v15
的含义 **
这段逻辑依赖 v15
字段来判定组件是否已适配,但从读者角度并不清楚 v15
代表什么。建议在注释或文档中说明此标志位,有助于后续维护和协作。
scripts/taro/generate-taro-pages.js (1)
10-11
: 保持与其他脚本的逻辑一致
这里同样使用 !v15
来过滤未适配组件,确保与其他脚本的逻辑保持同步,利于代码一致性和后续维护。
scripts/rn/update-taro-entry.js (1)
20-21
: **确认特殊组件过滤时的优先级 **
当 !v15
被过滤后,specialComponent
函数的逻辑仍保留。需要确认这种先返回是否会影响后续流程(例如:本该特殊处理却被提前过滤)。若符合预期则可保持不变,否则需调整过滤先后顺序。
scripts/sync-to-taro-playground.js (1)
71-71
: **与 version
的逻辑切换是否影响上线验证? **
原逻辑可能是通过校验版本号判断“3.0.0”组件,这里改为 if (package.v15 && package.show)
。请确保对应的构建或上线流程已同步更新,避免将不符合版本要求的包一同发布。
src/config.json (2)
Line range hint 82-899
: 建议完善版本兼容性标记的文档说明
多个组件新增了 "v15": true
标记,这表明这些组件已经适配了 v15 版本。建议:
- 在文档中说明 v15 兼容性的具体含义和升级要求
- 确认是否所有支持 v15 的组件都已正确标记
782-790
: 请验证主版本更新的兼容性影响
Drag
和 Popover
组件的版本从 2.0.0 更新到 3.0.0,这是一个主版本更新。
Also applies to: 866-874
✅ Verification successful
版本更新的变更已确认
根据代码分析,发现以下重要变更:
-
Drag 组件:
onDragStart
属性改名为onStart
onDragEnd
属性改名为onEnd
-
Popover 组件:
onChoose
属性改名为onSelect
这些变更已经在代码迁移工具 nutui-codemod
中有相应的迁移规则支持,可以帮助用户自动更新代码。版本号的更新(2.0.0 -> 3.0.0)符合语义化版本规范,因为包含了不向下兼容的 API 变更。
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# 描述:检查版本更新的变更日志和迁移指南
# 检查 CHANGELOG
rg -A 5 "## \[3\.0\.0\]" CHANGELOG.md
# 检查迁移指南
fd -t f "migrate.*\.md" docs/ -x cat {} \; | rg -A 10 "(Drag|Popover)"
Length of output: 208
Script:
#!/bin/bash
# 检查仓库中的文档和源码,以验证版本更新的影响
# 搜索与 Drag 和 Popover 相关的变更记录
rg -i "changelog|breaking.?changes?" -g "!node_modules"
# 查找 Drag 和 Popover 组件的源码文件
fd -t f "drag|popover" src/
# 检查组件源码中的重大变更
rg -i "version|breaking|deprecated" -g "*drag*" -g "*popover*"
# 查找可能的文档目录
fd -t d "docs?"
# 查找可能包含迁移指南的文件
fd -t f "migration|upgrade|guide"
Length of output: 2742
Script:
#!/bin/bash
# 检查组件的具体实现变化
# 检查 Drag 组件的变更
rg -B 2 -A 2 "export (default |type )?(\w+)?" src/packages/drag/drag.tsx
# 检查 Popover 组件的变更
rg -B 2 -A 2 "export (default |type )?(\w+)?" src/packages/popover/popover.tsx
# 检查组件的测试文件,寻找重要变更
rg -A 5 "describe|test|it\(" src/packages/drag/__test__/drag.spec.tsx src/packages/popover/__tests__/popover.spec.tsx
# 检查代码迁移工具中的相关规则
rg -A 5 "(Drag|Popover)" packages/nutui-codemod/transforms/
Length of output: 9924
🤔 这个变动的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit
样式调整
配置更新
脚本优化