Skip to content

Conversation

@Miles-hxy
Copy link
Collaborator

@Miles-hxy Miles-hxy commented Aug 6, 2025

🤔 这个变动的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

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

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

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

Summary by CodeRabbit

  • 文档
    • 更新 NutUI-React 文档,明确支持基于 Taro 的多端小程序和 H5 开发。
    • 新增对多平台小程序与 H5 单一代码库开发的支持说明。
    • 服务端渲染支持描述调整为“测试阶段”。
    • 单元测试覆盖率描述由 85%+ 调整为 80%+。
    • 兼容性表格中的包名更新为 @nutui/nutui-react-taro
    • 优化部分措辞和格式。

@github-actions github-actions bot added the action:review This PR needs more reviews (less than 2 approvals) label Aug 6, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 6, 2025

Walkthrough

本次变更更新了 NutUI-React 的文档,明确其基于 Taro 并支持多端小程序与 H5 的开发,调整了包名、测试覆盖率描述和 SSR 支持状态,并对表述和格式进行了细微优化。

Changes

Cohort / File(s) Change Summary
Taro 版文档更新
src/sites/sites-react/doc/docs/taro/intro-react.md
更新文档,突出 Taro 支持、包名变更、多端开发能力、SSR 状态调整、测试覆盖率修正及表述优化。

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 分钟

Possibly related issues

Possibly related PRs

Poem

🐇
文档焕新 Taro 行,
多端小程序齐飞翔。
包名一改更分明,
覆盖率微调更严谨。
兔子挥笔喜盈盈,
共祝 NutUI 新旅程!

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/hxy

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

Support

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

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.

@github-actions github-actions bot added the 3.x Target branch 3.x label Aug 6, 2025
@codecov
Copy link

codecov bot commented Aug 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.14%. Comparing base (c559879) to head (e8e3010).
⚠️ Report is 8 commits behind head on feat_v3.x.

Additional details and impacted files
@@            Coverage Diff             @@
##           feat_v3.x    #3324   +/-   ##
==========================================
  Coverage      88.14%   88.14%           
==========================================
  Files            290      290           
  Lines          19110    19110           
  Branches        2960     2960           
==========================================
  Hits           16844    16844           
  Misses          2261     2261           
  Partials           5        5           

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/sites/sites-react/doc/docs/taro/intro-react.md (1)

16-16: 单元测试覆盖率数据下调需同步其他文档
此处由 “>85%” 改为 “>80%”。请确认:

  1. CI 报告中的最新覆盖率是否匹配;
  2. 其他页面/README 中的覆盖率描述是否也需更新,避免信息不一致。
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b2a4166 and e8e3010.

📒 Files selected for processing (1)
  • src/sites/sites-react/doc/docs/taro/intro-react.md (2 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: oasis-cloud
PR: jdf2e/nutui-react#2700
File: src/packages/animatingnumbers/animatingnumbers.harmony.css:25-32
Timestamp: 2024-11-06T05:56:06.800Z
Learning: 在优化 NutUI React 动画性能时,添加 `will-change` 属性可能会对布局产生影响,需要谨慎使用。
📚 Learning: 在优化 nutui react 动画性能时,添加 `will-change` 属性可能会对布局产生影响,需要谨慎使用。...
Learnt from: oasis-cloud
PR: jdf2e/nutui-react#2700
File: src/packages/animatingnumbers/animatingnumbers.harmony.css:25-32
Timestamp: 2024-11-06T05:56:06.800Z
Learning: 在优化 NutUI React 动画性能时,添加 `will-change` 属性可能会对布局产生影响,需要谨慎使用。

Applied to files:

  • src/sites/sites-react/doc/docs/taro/intro-react.md
📚 Learning: when changes are made to the `filelist` state in the `src/packages/uploader/uploader.taro.tsx` file,...
Learnt from: Alex-huxiyang
PR: jdf2e/nutui-react#2416
File: src/packages/uploader/uploader.taro.tsx:230-230
Timestamp: 2024-07-05T02:58:57.992Z
Learning: When changes are made to the `fileList` state in the `src/packages/uploader/uploader.taro.tsx` file, ensure to generate unit tests to cover these changes.

Applied to files:

  • src/sites/sites-react/doc/docs/taro/intro-react.md
📚 Learning: 在 react/taro 组件中使用 settimeout 或 setinterval 时,应当在组件卸载时通过 useeffect 的清理函数清除定时器,以防止内存泄漏。可以使用 usestate ...
Learnt from: irisSong
PR: jdf2e/nutui-react#3209
File: src/packages/searchbar/searchbar.taro.tsx:111-124
Timestamp: 2025-05-02T01:45:09.576Z
Learning: 在 React/Taro 组件中使用 setTimeout 或 setInterval 时,应当在组件卸载时通过 useEffect 的清理函数清除定时器,以防止内存泄漏。可以使用 useState 存储定时器 ID,并在 useEffect 的返回函数中清除。

Applied to files:

  • src/sites/sites-react/doc/docs/taro/intro-react.md
📚 Learning: 在`trendarrow`组件(`src/packages/trendarrow/trendarrow.taro.tsx`)中,css变量在鸿蒙系统(harmony os)中可能未被完全支持,导致兼容...
Learnt from: oasis-cloud
PR: jdf2e/nutui-react#2540
File: src/packages/trendarrow/trendarrow.taro.tsx:29-30
Timestamp: 2024-11-06T02:16:07.069Z
Learning: 在`TrendArrow`组件(`src/packages/trendarrow/trendarrow.taro.tsx`)中,CSS变量在鸿蒙系统(Harmony OS)中可能未被完全支持,导致兼容性问题。因此,使用硬编码的十六进制颜色值可以确保在鸿蒙系统上的正确显示。

Applied to files:

  • src/sites/sites-react/doc/docs/taro/intro-react.md
🪛 markdownlint-cli2 (0.17.2)
src/sites/sites-react/doc/docs/taro/intro-react.md

27-27: Images should have alternate text (alt text)

(MD045, no-alt-text)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build
  • GitHub Check: test
🔇 Additional comments (1)
src/sites/sites-react/doc/docs/taro/intro-react.md (1)

13-13: “支持服务端渲染(测试阶段)” 需进一步说明
当前表述过于笼统,建议补充:

  • 已验证的 SSR 方案(如 Next.js、Remix 等)
  • 已知限制或待解决问题
    以免读者误解稳定性。

| 版本 | 支持的框架 | 视觉规范 | 兼容 |
| --- | --- | --- | --- |
| @nutui/nutui-react <img src="https://img.shields.io/npm/v/@nutui/nutui-react" /> | React 17\18 | 京东 APP 15.0 规范 | 现代浏览器以 Chrome >= 51、iOS >= 10.0 |
| @nutui/nutui-react-taro <img src="https://img.shields.io/npm/v/@nutui/nutui-react" /> | React 17\18 | 京东 APP 15.0 规范 | 现代浏览器以 Chrome >= 51、iOS >= 10.0 |
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

npm 徽章链接与包名不一致且缺少 alt 文本

  1. 行内徽章仍指向旧包 @nutui/nutui-react,而表格已改为 @nutui/nutui-react-taro,显示的版本号可能误导读者。
  2. <img> 标签未提供 alt 属性,违反无障碍规范(markdownlint MD045 提示)。

可按以下 diff 修正:

-| @nutui/nutui-react-taro <img src="https://img.shields.io/npm/v/@nutui/nutui-react" /> | React 17\18 | 京东 APP 15.0 规范 | 现代浏览器以 Chrome >= 51、iOS >= 10.0 |
+| @nutui/nutui-react-taro <img src="https://img.shields.io/npm/v/@nutui/nutui-react-taro" alt="npm version (@nutui/nutui-react-taro)" /> | React 17\18 | 京东 APP 15.0 规范 | 现代浏览器以 Chrome >= 51、iOS >= 10.0 |
📝 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
| @nutui/nutui-react-taro <img src="https://img.shields.io/npm/v/@nutui/nutui-react" /> | React 17\18 | 京东 APP 15.0 规范 | 现代浏览器以 Chrome >= 51、iOS >= 10.0 |
| @nutui/nutui-react-taro <img src="https://img.shields.io/npm/v/@nutui/nutui-react-taro" alt="npm version (@nutui/nutui-react-taro)" /> | React 17\18 | 京东 APP 15.0 规范 | 现代浏览器以 Chrome >= 51、iOS >= 10.0 |
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

27-27: Images should have alternate text (alt text)

(MD045, no-alt-text)

🤖 Prompt for AI Agents
In src/sites/sites-react/doc/docs/taro/intro-react.md at line 27, the npm badge
link and package name are inconsistent and the img tag lacks an alt attribute.
Update the badge URL to point to the correct package @nutui/nutui-react-taro
instead of @nutui/nutui-react, and add a meaningful alt attribute to the img tag
to comply with accessibility standards.

@Miles-hxy Miles-hxy merged commit 48f4973 into feat_v3.x Aug 6, 2025
8 checks passed
@Miles-hxy Miles-hxy deleted the docs/hxy branch August 6, 2025 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.x Target branch 3.x action:review This PR needs more reviews (less than 2 approvals) size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants