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

feat: v15 适配demo页面 #2896

Merged
merged 5 commits into from
Dec 30, 2024
Merged

Conversation

xiaoyatong
Copy link
Collaborator

@xiaoyatong xiaoyatong commented Dec 27, 2024

🤔 这个变动的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

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

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

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

Summary by CodeRabbit

  • 样式调整

    • 更新了多个组件的边框圆角样式,使其更加现代化和统一
    • 搜索栏样式调整,增加了 8px 的圆角
  • 配置更新

    • 为多个组件添加了 v15 兼容性标记
    • 更新了部分组件的版本号(如 Drag 和 Popover)
  • 脚本优化

    • 优化了组件导出和页面生成脚本的逻辑
    • 改进了组件配置的筛选条件

Copy link

coderabbitai bot commented Dec 27, 2024

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.

packages/nutui-taro-demo/src/pages/index/index.tsx

Oops! 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.

变更概览

详细说明

代码变更总览

代码仓库变更
  1. 样式文件调整

    • packages/nutui-taro-demo/src/pages/index/index.scsssrc/sites/mobile/Links.scss 中,调整了组件的圆角样式
    • .index-components 的圆角从 30px 30px 0 0 修改为 12px 12px 0 0
    • .index-components-sublist-item 的圆角从 22px 调整为 8px
  2. 代码逻辑变更

    • scripts/rn/update-taro-entry.js 更新了组件导出条件,增加了对 v15 属性的检查
    • scripts/taro/generate-taro-pages.js 修改了包处理逻辑,移除了未使用的 name 属性
  3. 配置文件更新

    • src/config.json 为大量组件添加了 "v15": true 属性
    • 更新了 DragPopover 组件的版本到 3.0.0

变更列表

文件路径 变更说明
packages/nutui-taro-demo/src/pages/index/index.scss 调整组件圆角样式
packages/nutui-taro-demo/src/pages/index/index.tsx 为 SearchBar 添加 8px 圆角
scripts/rn/update-taro-entry.js 优化组件导出条件
scripts/taro/generate-taro-pages.js 精简包处理逻辑
src/config.json 添加 v15 兼容性标记
src/sites/mobile/Links.scss 调整组件圆角样式

可能相关的 PR

建议标签

size/L

建议审阅者

  • oasis-cloud
  • Alex-huxiyang

庆祝诗歌

🐰 圆角轻舞,版本飞扬
代码如诗,优雅张扬
八像素的梦,悄然绽放
技术之美,在此绽光
兔子微笑,变革当行!


📜 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 8f83bd7 and 3f3e3f8.

📒 Files selected for processing (4)
  • packages/nutui-taro-demo/src/pages/index/index.tsx (1 hunks)
  • scripts/rn/update-taro-entry.js (1 hunks)
  • scripts/taro/generate-taro-pages.js (1 hunks)
  • src/config.json (17 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/nutui-taro-demo/src/pages/index/index.tsx
  • scripts/rn/update-taro-entry.js
  • scripts/taro/generate-taro-pages.js
  • src/config.json

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
Copy link

codecov bot commented Dec 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.97%. Comparing base (7b33cda) to head (d0e335d).
Report is 2 commits behind head on feat_v3.x.

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.
📢 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

🧹 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

📥 Commits

Reviewing files that changed from the base of the PR and between a91e0e2 and 5c6068e.

📒 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 版本。建议:

  1. 在文档中说明 v15 兼容性的具体含义和升级要求
  2. 确认是否所有支持 v15 的组件都已正确标记

782-790: 请验证主版本更新的兼容性影响

DragPopover 组件的版本从 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

@oasis-cloud oasis-cloud merged commit 665d55a into jdf2e:feat_v3.x Dec 30, 2024
7 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