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: skeleton RN & Harmony #2309

Merged
merged 11 commits into from
Jun 17, 2024
Merged

Conversation

xiaoyatong
Copy link
Collaborator

@xiaoyatong xiaoyatong commented May 31, 2024

🤔 这个变动的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

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

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

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

Summary by CodeRabbit

  • 新功能

    • 在应用中增加了对 Skeleton 组件的条件渲染逻辑。
  • 样式

    • 调整了 SkeletonDemo 组件中的样式属性以优化布局。
    • 更新了 Skeleton 组件及其子组件的样式,改进了显示和动画效果。
  • 修复

    • 修改 Switch 组件和 Avatar 组件的样式问题,确保更好的用户体验。
  • 重构

    • 重新组织了 skeleton.scss 文件中的 CSS 规则,引入了更具体的命名约定。
    • Skeleton 组件中的多个 <div> 标签替换为 <View> 标签,提高与 Taro 组件的兼容性。

@oasis-cloud
Copy link
Collaborator

image
样式有些差异

@xiaoyatong
Copy link
Collaborator Author

image 样式有些差异

avatar 适配后校验~

Copy link

coderabbitai bot commented Jun 17, 2024

Warning

Rate limit exceeded

@xiaoyatong has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 38 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between 2009689 and d4d30cc.

Walkthrough

这些更改涉及在多个文件和组件中引入新元素和样式。具体包括在 adapted.js 中添加导出项目,在 SkeletonDemo 组件中引入条件渲染逻辑和样式调整,更新不同组件的样式属性,以及对 CSS 类进行大规模重构。

Changes

文件路径 更改摘要
packages/nutui-taro-demo-rn/scripts/taro/adapted.js 增加 skeleton 导出项
src/packages/skeleton/demo.taro.tsx 引入条件渲染逻辑
src/packages/skeleton/demo.tsx 修改 Cell 组件的样式属性
src/packages/skeleton/demos/h5/demo5.tsx 调整 Switch 组件样式及 Skeleton 内容结构
src/packages/skeleton/demos/taro/demo5.tsx 引入 pxTransform 并调整 Switch 样式
src/packages/skeleton/skeleton.harmony.css 修改多个 CSS 类的样式,影响 avatar 和 skeleton 的展示
src/packages/skeleton/skeleton.scss 重构 CSS 类名,增加嵌套元素及调整样式属性
src/packages/skeleton/skeleton.taro.tsx 引入 View 并替换 <div> 元素,调整类名和样式
src/packages/skeleton/skeleton.tsx 更新 Skeleton 组件的类名和内容结构

Sequence Diagram(s)

忽略生成,因为更改比较简单且多样。

Poem

在编码的世界里,一切都在变化,
新的skeleton加入列队,伴随着渲染的火花。
样式调整、内容切换,如同乐章的变化,
小兔子开心地跳跃,
赞美着每一个新的变化,
代码的旋律,美妙无暇。 🐇✨


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:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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.

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

Outside diff range and nitpick comments (2)
packages/nutui-taro-demo-rn/scripts/taro/adapted.js (2)

Line range hint 20-29: 注意,'skeleton' 被重复添加到导出列表中。这可能是一个错误,应该删除重复的项。

  'skeleton',
  'notify',
  'pagination',
  'swiper',
  'textarea',
  'indicator',
  'hoverbutton',
  'safearea',
  'hoverbuttonitem',
- 'skeleton',

[!TIP]
Codebase Verification

在文件 packages/nutui-taro-demo-rn/scripts/taro/adapted.js 中确实存在全局变量 exportsmodule.exports 的重新赋值。这种重新赋值可能会覆盖重要功能,建议进一步检查此处的实现是否有必要修改。

  • 位置:
    • packages/nutui-taro-demo-rn/scripts/taro/adapted.js 第 17-23 行
Analysis chain

Line range hint 1-1: 根据静态分析工具的提示,全局变量不应该被重新赋值。这可能会覆盖重要功能。请检查此处的实现是否有必要修改。

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Check for global variable reassignment in 'adapted.js'.

# Test: Search for global assignments in 'adapted.js'. Expect: No global assignments.
rg --type javascript 'exports = module.exports' packages/nutui-taro-demo-rn/scripts/taro/adapted.js

Length of output: 136



Script:

#!/bin/bash
# Description: Check for global variable reassignment in 'adapted.js'.

# Test: Search for global assignments in 'adapted.js'. Expect: No global assignments.
rg 'exports = module.exports' packages/nutui-taro-demo-rn/scripts/taro/adapted.js

Length of output: 112

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

@@ -17,6 +17,7 @@ exports = module.exports = [
'divider',
'image',
'resultpage',
'skeleton',
Copy link

Choose a reason for hiding this comment

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

新增了 skeleton 实体,以支持 React Native 和 Harmony。请确认这里的全局变量重新赋值是否有必要,因为这可能会覆盖重要功能。

- exports = module.exports = [
+ module.exports = [
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
'skeleton',
'skeleton',

@xiaoyatong
Copy link
Collaborator Author

image 样式有些差异

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants