Skip to content

Conversation

ZakaryCode
Copy link
Contributor

@ZakaryCode ZakaryCode commented May 16, 2025

特性

鸿蒙

  • C++ 插件:
    • 更新折叠屏适配判断条件,增强对折叠屏设备的支持。
    • 添加页面配置功能,支持本地包加载功能,提升开发效率。
  • DOM 相关:
    • 支持获取用户唯一标识符(UID)。
    • 增加 setWindowStage 方法的异常捕获机制,提升稳定性。
    • 修复 selector fields 查询功能,提升 DOM 查询的准确性。
  • 滚动视图: 优化嵌套模式,提升滚动体验。
  • 样式属性:
    • 添加 gap 属性支持,增强布局灵活性。
    • 支持 background 渐变设置角度方向,并优化性能。
  • 实现单线程音视频策略调整,优化音视频处理性能。

工程化

  • 支持 pnpm@10 版本
  • 调整测试快照 chunk 和模块命名方式。

问题修复

鸿蒙

  • 文本组件: 修复更新和刷新问题,确保文本内容正常显示。
  • 轮播组件: 修复高度和内容溢出问题,提升组件稳定性。
  • 音频会话: 修复音频会话的触发机制,保证音频功能的正常运行。
  • 文件操作: 调整 compressImage 后生成文件的后缀名,确保文件兼容性。
  • 折叠屏支持:
    • 修复折叠屏头部在部分场景下更新失败的问题。
    • 修复初始化样式的折叠基准问题,确保样式渲染正确。

Summary by CodeRabbit

  • Chores
    • 所有相关包的版本号从预发布版本“4.1.0-alpha.3”升级为正式版“4.1.0”。未涉及其他功能、依赖或配置变更。
    • 构建配置中替换了 TypeScript 插件,优化了构建流程。

参考文档 https://nervjs.github.io/taro-docs/docs/harmony/c-api

Copy link

coderabbitai bot commented May 16, 2025

"""

Walkthrough

本次变更统一将所有相关 package.json 文件中的版本号从预发布版本 "4.1.0-alpha.3" 更新为正式版本 "4.1.0"。此外,packages/taro-runtime/package.json 中新增了 rollup-plugin-ts 依赖并调整了 @rollup/plugin-typescript 的顺序,packages/taro-runtime/rollup.config.ts 中将 Rollup 的 TypeScript 插件由 @rollup/plugin-typescript 替换为 rollup-plugin-ts,并简化了插件配置。其余未涉及任何依赖、脚本或配置的修改,也未更改任何导出或公共实体的声明。

Changes

文件/路径分组 变更摘要
根目录、crates、npm、packages 下绝大多数包的 package.json 文件 将版本号从 "4.1.0-alpha.3" 更新为 "4.1.0",未作其他更改。
packages/taro-runtime/package.json 版本号更新为 "4.1.0",新增 rollup-plugin-ts 依赖,调整 @rollup/plugin-typescript 顺序。
packages/taro-runtime/rollup.config.ts 将 Rollup TypeScript 插件由 @rollup/plugin-typescript 替换为 rollup-plugin-ts,并移除插件配置中的 exclude 选项。

Suggested reviewers

  • luckyadam
  • tutuxxx

Poem

小兔挥笔版本升,
预览归正入正名。
代码无改风依旧,
只把数字换新声。
跳跃一行皆喜气,
4.1.0 啦,春意浓!
🐇✨
"""

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 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 2986a52 and ed00372.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • packages/taro-runtime/package.json (2 hunks)
  • packages/taro-runtime/rollup.config.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/taro-runtime/package.json
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: Testing on Node.js (windows-latest)
  • GitHub Check: Testing on Node.js (macos-13)
  • GitHub Check: Testing on Node.js 18.x (ubuntu-latest)
  • GitHub Check: Testing on Node.js 20.x (ubuntu-latest)
  • GitHub Check: Testing on Node.js (windows-latest)
  • GitHub Check: Testing on Node.js (macos-13)
  • GitHub Check: Testing on Node.js 20.x (ubuntu-latest)
  • GitHub Check: Testing on Node.js 18.x (ubuntu-latest)
🔇 Additional comments (1)
packages/taro-runtime/rollup.config.ts (1)

4-4:

❓ Verification inconclusive

插件切换是一个好的改进!

将 Rollup 的 TypeScript 插件从 @rollup/plugin-typescript 切换到 rollup-plugin-ts 是一个不错的改进。rollup-plugin-ts 通常提供更多功能和更好的性能,同时简化了配置方式。

请确认在移除了之前可能存在的特定配置选项(如 exclude 等)后,构建输出仍然符合预期。

Also applies to: 16-16


🏁 Script executed:

#!/bin/bash
# 检查构建是否成功并验证输出文件是否正确生成

echo "开始验证 rollup-plugin-ts 的构建效果..."
cd packages/taro-runtime
npm run build

# 检查构建后的文件是否存在
if [ -f "dist/index.cjs.js" ] && [ -f "dist/runtime.esm.js" ]; then
  echo "✅ 构建成功,关键输出文件已生成"
else
  echo "❌ 构建失败或关键文件未生成"
  exit 1
fi

# 检查生成的文件大小是否正常
echo "检查文件大小..."
ls -lh dist/

Length of output: 473


请在本地/CI 环境中验证构建输出

将 Rollup 的 TypeScript 插件从 @rollup/plugin-typescript 切换到 rollup-plugin-ts 是一次很好的改进!由于 sandbox 环境缺少依赖,本次执行未能成功构建。请在包含完整依赖的本地或 CI 环境中运行以下步骤,并确认移除或替换旧插件配置后,输出文件符合预期:

  • 进入运行时包目录
    cd packages/taro-runtime
  • 安装依赖
    npm install
  • 执行构建
    npm run build
  • 检查输出文件
    ls -lh dist/
    应包含 dist/index.cjs.jsdist/runtime.esm.js 等关键文件,且大小与预期一致。

确认以上步骤通过后,即可安心合并此改动。

✨ Finishing Touches
  • 📝 Generate Docstrings

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.
    • @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 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in 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.

@coderabbitai coderabbitai bot requested review from luckyadam and tutuxxx May 16, 2025 03:06
Copy link

codecov bot commented May 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.37%. Comparing base (edb74da) to head (ed00372).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##             main   #17714    +/-   ##
========================================
  Coverage   59.37%   59.37%            
========================================
  Files         387      387            
  Lines       23417    23417            
  Branches     5152     5148     -4     
========================================
  Hits        13903    13903            
- Misses       8012     8145   +133     
+ Partials     1502     1369   -133     
Flag Coverage Δ
taro-cli 72.37% <ø> (ø)
taro-runtime 59.87% <ø> (ø)
taro-web 53.19% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 42 files with indirect coverage changes

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

@ZakaryCode ZakaryCode marked this pull request as draft May 16, 2025 03:22
@ZakaryCode ZakaryCode marked this pull request as ready for review May 16, 2025 03:59
@yoyo837
Copy link
Contributor

yoyo837 commented May 16, 2025

53d8ba9 @ianzone 看看?

@tutuxxx tutuxxx merged commit e5d3e02 into main May 16, 2025
39 checks passed
@tutuxxx tutuxxx deleted the chore/release-4.1.0 branch May 16, 2025 04:28
Copy link
Contributor

@ianzone
Copy link
Contributor

ianzone commented May 17, 2025

53d8ba9 @ianzone 看看?

image

@ZakaryCode @yoyo837 上图是@tarojs/runtime当前main的构建,想请教几个问题

  1. dts chunk.d.ts 文件有何不同?
  2. rollup 生成了 cjs 但 package.json 中没有导出,是否说明 cjs 不必要?
  3. src/index.ts 中导入了 dom-external,是否说明 sideEffects 字段不必要?
  4. main:h5 字段的作用是什么?是否可用 mainmodule 字段代替?
  5. dist/index.jsdist/runtime.esm.js 均为 ESM,只不过 dist/index.js 未打包,它的作用是什么?是否可以只保留 dist/runtime.esm.js

感谢

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

Successfully merging this pull request may close these issues.

4 participants