Skip to content

Conversation

@ianzone
Copy link
Contributor

@ianzone ianzone commented May 6, 2025

这个 PR 做了什么? (简要描述所做更改)

  1. 更新了 package.json 和 workflow 的 node 及 pnpm 版本
  2. 使用 pnpm10 更新了 pnpm-lock

这个 PR 是什么类型? (至少选择一个)

  • 错误修复(Bugfix) issue: fix #
  • 新功能(Feature)
  • 代码重构(Refactor)
  • TypeScript 类型定义修改(Typings)
  • 文档修改(Docs)
  • 代码风格更新(Code style update)
  • 其他,请描述(Other, please describe):弃用 node18 和 pnpm9,启用 node22 和 pnpm10

这个 PR 涉及以下平台:

  • 所有小程序
  • 微信小程序
  • 支付宝小程序
  • 百度小程序
  • 字节跳动小程序
  • QQ 轻应用
  • 京东小程序
  • 快应用平台(QuickApp)
  • Web 平台(H5)
  • 移动端(React-Native)
  • 鸿蒙(harmony)

Summary by CodeRabbit

  • 新特性
    • 明确要求 Node.js 最低版本升级至 20,pnpm 升级至 10,开发环境和依赖项已同步更新。
  • 文档
    • 更新了开发文档,反映最新的 Node.js 和 pnpm 版本要求及相关链接。
  • 杂项
    • 持续集成和发布流程已升级至 Node.js 22 和最新 pnpm,提升兼容性和稳定性。
    • 依赖的 Node.js 类型定义包统一升级至 v20。
    • 修正了依赖忽略版本范围,确保依赖管理更准确。
    • Babel 相关依赖版本进行了升级,优化构建和转换流程。
    • 修正了多个拼写错误,提升代码规范性和类型安全。
    • 升级了部分测试依赖,优化了文件过滤和匹配逻辑,提升测试稳定性。
    • Harmony 平台新增列表组件配置及键盘调整属性细化。

@coderabbitai
Copy link

coderabbitai bot commented May 6, 2025

"""

Walkthrough

本次变更将项目中 Node.js 的最低版本要求从 18 升级到 20,并同步提升了 pnpm 版本和相关依赖(如 @types/node)到 10 和 20。同时,所有涉及 Node.js 运行环境的 package.json、CI/CD 工作流、开发文档等均已相应调整。另对 packages/taro-transformer-wx/src/render.ts 中多个变量和方法名的拼写错误进行了修正。

Changes

文件/路径分组 变更摘要
.github/workflows/build-rust-binding.yml
.github/workflows/nodejs.yml
.github/workflows/publish.yml
.github/workflows/sync-components-types.yml
CI 工作流中 Node.js 版本由 18 升级至 22,pnpm 由 9 升级至 10,pnpm action 由 v3 升级至 v4。
.github/dependabot.yml Dependabot 忽略 @types/node 的版本范围由 13.x 修正为 20.x~23.x。
CONTRIBUTING.md 开发文档中 Node.js 推荐版本由 16 升级至 20,pnpm 由 7 升级至 10,npm 文档链接同步更新。
package.json
examples//package.json
packages/taro-cli/templates/
/package.json.tmpl
packages/taro-platform-harmony-hybrid/package.json
@types/node 依赖由 18 升级至 20,新增 devEngines 字段,规范开发环境所需 Node.js 与 pnpm 版本。
npm//package.json
packages/
/package.json
各包 engines 字段 Node.js 最低版本由 18 升级至 20,无其它依赖变更。
packages/taro-helper/package.json
pnpm-workspace.yaml
taro-helper 中 Babel 相关依赖升级至 7.27.x,pnpm-workspace.yaml 中新增 @babel/types 版本覆盖至 ^7.27.1。
packages/taro-transformer-wx/src/render.ts 修正 RenderParser 类中多个变量和方法名的拼写错误,调整类型注解和增加可选链调用,提升代码规范性和类型安全。
packages/babel-plugin-transform-solid-jsx/test/unique_transform_fixtures/aliasOrSameNameImport/output.js
packages/babel-plugin-transform-solid-jsx/test/unique_transform_fixtures/simpleElements/output.js
测试输出文件中调整了 JSX 元素变量命名,变量名索引更改但逻辑不变。
.eslintignore
tests/tests/bundled/globby/index.js
ESLint 忽略新增路径,升级 fast-glob、fastq、ignore、micromatch 等依赖,优化 EntryFilter 负模式匹配逻辑及相关工具函数。
packages/taro-platform-harmony-hybrid/build/config/harmony-definition.json 新增 list 和 list-item 组件声明,textarea 和 input 组件的 adjust-keyboard-to 属性由布尔值改为含 cursor 和 bottom 的对象。
packages/taro-rn/src/lib/index.ts 调整导出语句顺序,移动 './ENV_TYPE' 的导出位置,无功能变更。

Sequence Diagram(s)

sequenceDiagram
    participant Dev as 开发者
    participant CI as CI/CD
    participant Node as Node.js
    participant Pnpm as pnpm

    Dev->>package.json: 查看 engines 要求
    Dev->>Node: 安装 Node.js v20+
    Dev->>Pnpm: 安装 pnpm v10+
    CI->>Node: 使用 Node.js v22 运行工作流
    CI->>Pnpm: 使用 pnpm v10 执行依赖安装
    CI->>package.json: 检查依赖与类型定义(@types/node@20)
Loading

Possibly related PRs

Suggested reviewers

  • yoyo837

Poem

🐇
升级 Node 二十新,
pnpm 十版齐更新。
工作流里步步稳,
文档同步不留痕。
依赖齐心向前进,
代码世界更清新!

"""

Tip

⚡️ 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 7b95d1c and 30a6172.

📒 Files selected for processing (2)
  • packages/taro-platform-harmony-hybrid/build/config/harmony-definition.json (3 hunks)
  • packages/taro-rn/src/lib/index.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/taro-rn/src/lib/index.ts
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
🔇 Additional comments (3)
packages/taro-platform-harmony-hybrid/build/config/harmony-definition.json (3)

2331-2334: 新增 list 组件属性声明
已为 list 组件添加 upper-threshold-countlower-threshold-count 两个布尔属性,保持与 Web 和小程序平台一致。请确认文档或类型定义已同步更新,以便前端使用时提示完整属性列表。


2345-2345: 新增 list-item 组件声明
引入了空值的 list-item 组件占位声明,建议同时在组件库文档或生成脚本中补充 list-item 的使用说明,确保列表子项能正确被识别并渲染。


2956-2960: 调整 textarea.adjust-keyboard-to 属性结构
adjust-keyboard-to 从布尔值改为包含 cursorbottom 两个字段的对象,支持更细粒度键盘调节。请在渲染或 Transformer 层面验证该字段的解析兼容性,确保旧版的 false 能被正确映射为 { cursor: false, bottom: false },避免引入运行时错误。

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

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 a review from yoyo837 May 6, 2025 20:33
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

♻️ Duplicate comments (12)
packages/taro-components-rn/package.json (1)

31-33: 与其他包保持一致的 Node.js 引擎要求

engines.node 已从 >=18 升级到 >=20,确保仅支持 Node.js 20 及以上版本。

packages/taro-router/package.json (1)

33-35: 与其他包保持一致的 Node.js 引擎要求

engines.node 已从 >=18 升级到 >=20,与仓库中其他模块一致。

packages/css-to-react-native/package.json (1)

54-54: 与其他包保持一致的 Node.js 引擎要求

engines.node 已从 >=18 升级到 >=20,保持所有包的最低版本要求一致。

packages/taro-plugin-react-devtools/package.json (1)

30-30: 与其他包保持一致的 Node.js 引擎要求

engines.node 已从 >=18 升级到 >=20,与整体环境要求同步。

packages/taro-plugin-html/package.json (1)

29-30: 节点引擎版本保持一致
已将 Node.js 版本要求更新至 >=20,与其他包中对引擎版本的更新保持一致。

packages/taro-router-rn/package.json (1)

29-31: 节点引擎版本保持一致
已将 Node.js 版本要求更新至 >=20,与项目中统一的最低版本策略相符。

packages/taroize/package.json (1)

54-56: 节点引擎版本保持一致
已将 Node.js 版本要求更新至 >=20,与仓库中的其他包同步。

packages/taro-cli-convertor/package.json (1)

37-39: 节点引擎版本保持一致
已将 Node.js 版本要求更新至 >=20,与整体升级策略一致。

packages/taro-rn-transformer/package.json (1)

30-32: 同上:更新 Node.js 引擎要求
与其他包保持一致,将 engines.node 统一升级至 >=20

packages/taro-platform-jd/package.json (1)

29-31: 同上:更新 Node.js 引擎要求
engines.node>=18 升级为 >=20,与项目范围内的其它平台包保持一致。

packages/taro-platform-qq/package.json (1)

29-31: 同上:更新 Node.js 引擎要求
与其他平台包同步,已将 engines.node 版本要求升级至 >=20

packages/taro-platform-tt/package.json (1)

29-31: 同上:更新 Node.js 引擎要求
将所有平台包的 engines.node 版本统一提升到 >=20,完成对 Node.js 22 的支持。

🧹 Nitpick comments (4)
.github/workflows/publish.yml (1)

93-96: 更新 Node.js 版本: 将 actions/setup-node 的 node-version 升级到 22,建议确认是否需要使用精确版本号 (如 22.x) 以保持一致性和未来兼容性。

.github/workflows/nodejs.yml (1)

39-41: 调整测试矩阵 Node.js 版本: 将测试矩阵中的 node-version 从 18.x 切换为 [22.x,20.x],确保优先测试最新版本。建议保持版本排序([20.x, 22.x])以提升可读性。

package.json (1)

187-196: 新增 devEngines 字段: 定义了开发环境所需的 Node.js 和 pnpm 版本,增强了文档化和工具校验。建议确认团队常用工具(如 IDE、pnpm)是否已支持 devEngines 字段的自动校验机制;如果未广泛支持,可考虑在 README 或文档中说明。

.github/workflows/build-rust-binding.yml (1)

52-52: 建议将 pnpm 版本字段细化以自动跟踪次要更新
当前指定 version: 10,会锁定到主版本 10,推荐使用 version: "10.x" 或者 ">=10",以便获得次要版本的 bug 修复和性能优化。

-      version: 10
+      version: "10.x"
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between fb517eb and 7be6f30.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (76)
  • .github/dependabot.yml (1 hunks)
  • .github/workflows/build-rust-binding.yml (2 hunks)
  • .github/workflows/nodejs.yml (3 hunks)
  • .github/workflows/publish.yml (1 hunks)
  • .github/workflows/sync-components-types.yml (1 hunks)
  • CONTRIBUTING.md (3 hunks)
  • examples/blended-taro-component-vue3/taro-project/package.json (1 hunks)
  • examples/mini-program-example/package.json (2 hunks)
  • examples/swiper-effect/package.json (1 hunks)
  • examples/taro-list/package.json (1 hunks)
  • npm/darwin-arm64/package.json (1 hunks)
  • npm/darwin-x64/package.json (1 hunks)
  • npm/linux-x64-gnu/package.json (1 hunks)
  • npm/linux-x64-musl/package.json (1 hunks)
  • npm/win32-x64-msvc/package.json (1 hunks)
  • package.json (2 hunks)
  • packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json (1 hunks)
  • packages/babel-plugin-transform-taroapi/package.json (1 hunks)
  • packages/babel-preset-taro/package.json (1 hunks)
  • packages/create-app/package.json (1 hunks)
  • packages/css-to-react-native/package.json (1 hunks)
  • packages/eslint-config-taro/package.json (1 hunks)
  • packages/jest-helper/package.json (1 hunks)
  • packages/postcss-html-transform/package.json (1 hunks)
  • packages/postcss-plugin-constparse/package.json (1 hunks)
  • packages/postcss-pxtransform/package.json (1 hunks)
  • packages/rollup-plugin-copy/package.json (1 hunks)
  • packages/shared/package.json (1 hunks)
  • packages/stylelint-config-taro-rn/package.json (1 hunks)
  • packages/stylelint-taro-rn/package.json (1 hunks)
  • packages/stylelint-taro/package.json (1 hunks)
  • packages/taro-api/package.json (1 hunks)
  • packages/taro-cli-convertor/package.json (1 hunks)
  • packages/taro-cli/package.json (1 hunks)
  • packages/taro-cli/templates/default/package.json.tmpl (1 hunks)
  • packages/taro-cli/templates/plugin-compile/package.json.tmpl (1 hunks)
  • packages/taro-components-library-react/package.json (1 hunks)
  • packages/taro-components-library-vue3/package.json (1 hunks)
  • packages/taro-components-rn/package.json (1 hunks)
  • packages/taro-components/package.json (1 hunks)
  • packages/taro-extend/package.json (1 hunks)
  • packages/taro-framework-react/package.json (1 hunks)
  • packages/taro-framework-vue3/package.json (1 hunks)
  • packages/taro-helper/package.json (1 hunks)
  • packages/taro-loader/package.json (1 hunks)
  • packages/taro-platform-alipay/package.json (1 hunks)
  • packages/taro-platform-harmony-hybrid/package.json (1 hunks)
  • packages/taro-platform-jd/package.json (1 hunks)
  • packages/taro-platform-qq/package.json (1 hunks)
  • packages/taro-platform-swan/package.json (1 hunks)
  • packages/taro-platform-tt/package.json (1 hunks)
  • packages/taro-platform-weapp/package.json (1 hunks)
  • packages/taro-plugin-html/package.json (1 hunks)
  • packages/taro-plugin-http/package.json (1 hunks)
  • packages/taro-plugin-inject/package.json (1 hunks)
  • packages/taro-plugin-mini-ci/package.json (1 hunks)
  • packages/taro-plugin-react-devtools/package.json (1 hunks)
  • packages/taro-plugin-vue-devtools/package.json (1 hunks)
  • packages/taro-react/package.json (1 hunks)
  • packages/taro-rn-runner/package.json (1 hunks)
  • packages/taro-rn-style-transformer/package.json (1 hunks)
  • packages/taro-rn-supporter/package.json (1 hunks)
  • packages/taro-rn-transformer/package.json (1 hunks)
  • packages/taro-rn/package.json (1 hunks)
  • packages/taro-router-rn/package.json (1 hunks)
  • packages/taro-router/package.json (1 hunks)
  • packages/taro-runner-utils/package.json (1 hunks)
  • packages/taro-runtime-rn/package.json (1 hunks)
  • packages/taro-runtime/package.json (1 hunks)
  • packages/taro-service/package.json (1 hunks)
  • packages/taro-transformer-wx/package.json (1 hunks)
  • packages/taro-webpack5-prebundle/package.json (1 hunks)
  • packages/taro-webpack5-runner/package.json (1 hunks)
  • packages/taro-with-weapp/package.json (1 hunks)
  • packages/taro/package.json (1 hunks)
  • packages/taroize/package.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
🔇 Additional comments (67)
packages/taro-rn-style-transformer/package.json (1)

29-31:

✅ Verification successful

确认 Node.js 引擎要求升级一致性

已将 engines.node>=18 提升到 >=20,与仓库中其他包保持一致,并支持 Node.js 20+(包括 22.x)。请确认本地开发文档及 CI/CD 工作流中的 Node.js 版本配置已同步更新,无遗漏。

可以运行以下命令,检查 .github/workflowsnode-version 是否都已更新:


🏁 Script executed:

rg -n "node-version" -C2 .github/workflows

Length of output: 3569


确认 CI/CD 工作流中的 Node.js 版本已更新

CI/CD 工作流检查结果:

  • .github/workflows/sync-components-types.yml:node-version: 22
  • .github/workflows/publish.yml:node-version: 22
  • .github/workflows/nodejs.yml:matrix node-version: [22.x, 20.x]
  • .github/workflows/build-rust-binding.yml:matrix node-version: [22.x]

上述配置均已覆盖 Node.js 20+,与 packages/taro-rn-style-transformer/package.json 中的 "engines": { "node": ">=20" } 保持一致。若本地开发文档中仍有旧版本提示,请一并同步更新。

packages/taro/package.json (1)

22-24: 同步 Node 引擎版本至 >=20
此处已将 Node.js 运行时最低版本从 >=18 提升至 >=20,与项目整体升级策略一致。请确认根目录及 CI/CD 配置中的 Node 版本要求也已同步更新。

packages/taro-helper/package.json (1)

38-40: 统一 Node 引擎版本要求至 >=20
@tarojs/helper 包已将 engines.node>=18 升级到 >=20,符合整体平台升级目标。建议检查其他辅助工具包和示例项目中的版本要求,以确保一致性。

packages/taro-runtime/package.json (1)

32-34: 更新运行时包 Node.js 最低版本至 >=20
@tarojs/runtimeengines.node 已调整为 >=20,保持与核心框架和插件版本同步。请验证 GitHub Actions workflows 中的 Node 测试矩阵是否也涵盖了 22.x。

packages/taro-platform-alipay/package.json (1)

29-31: 提升支付宝平台插件 Node 引擎版本至 >=20
@tarojs/plugin-platform-alipay 现已要求 Node.js >=20,请确认打包与发布脚本以及相关文档已同步更新,避免版本不一致导致的兼容性问题。

packages/postcss-plugin-constparse/package.json (1)

8-10: 升级 Node 引擎要求至 >=20
postcss-plugin-constparse 中的 engines.node 已一致升级为 >=20,请同步检查示例项目中 @types/node 依赖版本,并更新相关文档。

packages/taro-components/package.json (1)

56-57: 节点引擎版本更新至 >=20
此变更符合移除 Node.js 18 并支持 Node.js 22 的要求,确保在 CI 和开发环境中运行时使用 Node.js 20 及以上版本。

packages/taro-framework-react/package.json (1)

33-33: 确认 Node.js 引擎版本已提升至 >=20
此更改与仓库中其它 package.json 的版本要求保持一致,已将最低 Node.js 版本从 18 升级至 20。

packages/taro-runner-utils/package.json (1)

26-26: 同步提升 Node.js 引擎要求至 >=20
此处将 engines.node 从 18 升级至 20,与整体版本升级策略一致。

packages/jest-helper/package.json (1)

21-21: 将 Node.js 最低版本要求更新为 >=20
升级符合全局依赖版本同步策略,确保在 Node.js 20 及以上环境下运行。

examples/taro-list/package.json (1)

85-85: 更新 @types/node 版本至 ^20
此修改与 Node.js 引擎版本提升保持一致,将类型定义依赖从 ^18.x 升级至 ^20.x。

packages/taro-cli/package.json (1)

43-43: 升级 CLI 的 Node.js 引擎要求至 >=20
将 CLI 工具包的最低 Node.js 版本从 18 提升至 20,保持与其他包一致。

packages/taro-extend/package.json (1)

24-24: 确认 Node.js 引擎版本要求更新

engines.node 已从 >=18 更新为 >=20,与 PR 目标保持一致,无需额外调整。

packages/taro-rn/package.json (1)

38-38: 确认 Node.js 引擎版本要求更新

engines.node 已从 >=18 调整为 >=20,与整体升级方案相符,适配后续 Node 22 支持。

packages/taro-service/package.json (1)

32-32: 确认 Node.js 引擎版本要求更新

engines.node 已从 >=18 提升至 >=20,符合项目对最低 Node 版本的统一规划。

examples/blended-taro-component-vue3/taro-project/package.json (1)

51-51: 确认 @types/node 版本同步更新

devDependencies["@types/node"] 已从 ^18.15.11 升级为 ^20,与引擎要求保持一致。

packages/taro-components-library-react/package.json (1)

18-18: 确认 Node.js 引擎版本要求更新

engines.node 已从 >=18 更新为 >=20,与仓库中其他包的升级节奏保持一致。

packages/babel-preset-taro/package.json (1)

27-27: 将 Node.js 最低版本要求更新至 ≥20
已将 engines.node>=18 调整为 >=20,与整体版本升级目标保持一致。请确保在 Node.js 20+ 环境下已完成本地及 CI/CD 测试,并验证无兼容性问题。

examples/swiper-effect/package.json (1)

66-66: 同步升级示例项目的 @types/node 版本至 ^20
示例项目的 devDependencies 中已将 @types/node^18 更新为 ^20,请确认 TypeScript 编译与运行是否正常,并与其他示例保持一致。

packages/taro-runtime-rn/package.json (1)

33-33: 提升 React Native 运行时的 Node.js 引擎要求至 ≥20
engines.node 已从 >=18 升级至 >=20,请在 Node.js 20+ 环境中执行打包、运行及测试,确保无新兼容性问题。

packages/taro-platform-harmony-hybrid/package.json (1)

65-65: 更新 Harmony 平台插件的 @types/node 到 ^20
devDependencies 中已同步将 @types/node 版本升级至 ^20,建议执行完整的 TypeScript 构建与单元测试,确保新版类型定义下运行正常。

packages/taro-plugin-http/package.json (1)

33-33: 将 HTTP 插件的 Node.js 引擎要求调整为 ≥20
已将 engines.node>=18 升级至 >=20,请在 Node.js 20+ 环境下验证打包和测试流程的兼容性,特别关注 HTTP 请求相关功能。

packages/taro-plugin-inject/package.json (1)

28-30:

❓ Verification inconclusive

更新 Node.js 引擎要求至 >=20
将 Node.js 引擎版本要求从 >=18 升级至 >=20,与项目整体保持一致,并支持 Node.js 22。请同时确认 CI/CD 配置中的 Node 版本(22.x)和 pnpm 版本(10)已同步更新。


🏁 Script executed:

#!/bin/bash
# 检查所有 package.json 中是否仍存在旧的 node 引擎要求
rg -l '"node": ">=18"' -n .

Length of output: 29


请确认 Node.js 引擎要求已升级至 ≥20 并同步更新相关配置
packages/taro-plugin-inject/package.json 中的 Node.js 引擎要求由 >=18 升级为 >=20,需确保整个仓库及 CI/CD 配置一致。

请重点核对:

  • 所有子包 package.json"engines": { "node": ">=20" } 是否已统一更新
  • CI/CD 流水线(如 GitHub Actions、Jenkins、Azure Pipelines 等)使用的 Node.js 版本是否已切换至 22.x
  • 版本管理文件(如 .nvmrc.node-version)中是否也已更新为 Node.js 20 或更高
  • pnpm 版本是否已同步升级至 10.x
packages/taro-platform-swan/package.json (1)

29-31: 确认 Node.js 引擎升级一致性: 将 engines.node>=18 升级为 >=20,符合本次 PR 的整体升级目标。请同时检查 .github/workflows、文档(如 CONTRIBUTING.md)以及本地环境配置(如 .nvmrc.node-version)是否已同步更新至新的 Node.js 版本要求。

packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json (1)

26-27: 更新 Node.js 引擎到 >=20: 已将 engines.node>=18 提升至 >=20,与项目中其他包保持一致,保证插件在 Node 20+ 环境下正常运行。

packages/taro-platform-weapp/package.json (1)

29-30: 引擎版本升级: 已将微信小程序平台插件的 engines.node 升级为 >=20,确保该包在 Node.js 20 及以上版本中兼容与稳定。

npm/darwin-arm64/package.json (1)

17-18: 本地绑定包 Node.js 引擎升级: 将 darwin-arm64 原生绑定包的 engines.node>=18 升级到 >=20,与其他平台绑定包保持一致,满足最新 LTS 要求。

npm/linux-x64-gnu/package.json (1)

17-18: 本地绑定包 Node.js 引擎升级: 将 linux-x64-gnu 原生绑定包的 engines.node>=18 升级到 >=20,确保支持最新 LTS 及以上版本。

packages/taro-api/package.json (1)

37-39: 更新 Node.js 引擎版本要求至 >=20
已将 "node" 最低版本从 >=18 升级到 >=20,与本次 PR 去除对 Node.js 18 支持、引入新版本支持的目标一致。
请核实是否需进一步将版本范围调整至 >=22 以精准反映对 Node.js 22 的支持,并确保 CI 工作流、贡献指南等处也同步更新。

packages/taro-webpack5-runner/package.json (1)

32-34: 同步更新 Node.js 引擎版本至 >=20
此处将 node 引擎要求由 >=18 提升至 >=20,保持与仓库中其他包一致。
请确认是否应进一步限定为 >=22,并检查 CI、文档、示例项目中所有相关配置已同步调整。

packages/taro-react/package.json (1)

27-29: 升级 Node.js 引擎要求到 >=20
"node": ">=18" 改为 ">=20",契合整体升级计划。
建议复核是否需要锁定到 >=22 以匹配对 Node.js 22 的支持,并检查所有工作流与开发文档是否一致。

packages/stylelint-taro/package.json (1)

38-40: 将 Node.js 引擎最低版本提升至 >=20
已去除对 Node.js 18 的支持并升级为 >=20,符合集成更新。
请确认是否应指定 >=22 并在 CI、文档及示例中同步调整引用。

npm/darwin-x64/package.json (1)

16-18: 调整 Node.js 引擎要求到 >=20
此处与其他平台绑定包一致,将引擎要求从 >=18 升至 >=20
建议确认是否需要进一步收紧至 >=22,并确保发布脚本和文档中无遗留的旧版本条件。

packages/eslint-config-taro/package.json (1)

26-26: 升级 Node.js 最低版本至 >=20
已将 engines.node 从 >=18 提升至 >=20,与 monorepo 中其他包的版本要求保持一致,成功移除对 Node 18 的支持并确保兼容 Node 20+。

packages/taro-loader/package.json (1)

29-29: 同步更新 Node.js 引擎版本要求至 >=20
@tarojs/taro-loader 的 engines.node 已从 >=18 升级到 >=20,与整体升级保持一致,确保在构建和运行时使用 Node 20+。

packages/shared/package.json (1)

33-33: 对齐 Node.js 引擎最低版本为 >=20
将 engines.node 约束从 >=18 更新为 >=20,与其他核心包一致,去除对旧版本 Node 的兼容。

packages/taro-cli/templates/default/package.json.tmpl (1)

110-110: 模板中 @types/node 版本升级至 ^20
已将模板 devDependencies 中的 @types/node^18 更新到 ^20,与引擎需求同步,保证新项目生成后 typings 与 Node 20+ 兼容。

packages/taro-plugin-vue-devtools/package.json (1)

30-30: 升级 Node.js 引擎要求至 >=20
已将 engines.node 从 >=18 提升至 >=20,与整体环境升级保持一致,保证插件在 Node 20+ 环境下正常运行。

packages/taro-plugin-mini-ci/package.json (1)

32-32: 将 Node.js 引擎要求升级至 >=20
此处已将 engines.node>=18 统一提升至 >=20,与整体仓库的版本策略保持一致。CI/CD 流水线和依赖配置已同步更新,无需额外修改。

packages/postcss-html-transform/package.json (1)

27-27: 将 Node.js 引擎要求升级至 >=20
此处已将 engines.node>=18 升级为 >=20,与仓库中其他包的版本要求保持一致。

packages/stylelint-config-taro-rn/package.json (1)

26-27: 将 Node.js 引擎要求升级至 >=20
已统一将 engines.node>=18 提升至 >=20,并保持与其他插件配置一致。

packages/stylelint-taro-rn/package.json (1)

42-43: 将 Node.js 引擎要求升级至 >=20
已将此包的最低 Node.js 版本从 >=18 升级至 >=20,符合整体版本规范。

packages/taro-components-library-vue3/package.json (1)

18-19: 将 Node.js 引擎要求升级至 >=20
该包已将 engines.node>=18 统一提升至 >=20,与其他组件库及示例项目保持一致。

packages/rollup-plugin-copy/package.json (1)

21-21: Node 引擎版本要求更新正确
已将 "node" 引擎版本从 >=18 升级到 >=20,与项目整体目标一致,也能兼容 Node.js 22 及更高版本。

packages/taro-with-weapp/package.json (1)

33-33: Node 引擎版本要求更新正确
已将 "node" 引擎版本从 >=18 升级到 >=20,与其他包的配置保持一致,满足项目对环境的统一要求。

packages/taro-webpack5-prebundle/package.json (1)

33-33: Node 引擎版本要求更新正确
将最小 Node 版本要求从 18 升级至 20,符合整体升级策略,可在 Node 20+(包括 22)环境中正常使用。

packages/taro-transformer-wx/package.json (1)

33-33: Node 引擎版本要求更新正确
已将 "node" 引擎门槛从 >=18 提升到 >=20,与项目其他模块保持同步,确保 CI/CD 环境一致性。

packages/babel-plugin-transform-taroapi/package.json (1)

19-19: Node 引擎版本要求更新正确
将 Node.js 最低版本从 18 升级至 20,满足对新特性支持及安全性需求,与整体升级方向一致。

packages/taro-framework-vue3/package.json (1)

29-29: 引擎版本升级符合预期
已将 node 引擎要求从 >=18 更新为 >=20,与全局升级策略保持一致。请确认 CONTRIBUTING.md、示例项目及 CI Workflow(如 .github/workflows/nodejs.yml)中有关 Node.js 版本的约束也已同步更新。

packages/taro-rn-runner/package.json (1)

31-31: 同步更新 RN Runner 的 Node.js 要求
@tarojs/rn-runnerengines.node 已提升至 >=20,与其他包保持一致。建议检查相关 GitHub Actions 配置和文档,确保构建及测试均在 Node.js 20+ 环境下执行。

packages/taro-rn-supporter/package.json (1)

29-29: 统一升级 RN Supporter 引擎约束
@tarojs/rn-supporter 的 Node.js 要求已更新为 >=20,符合此次版本策略。请验证 CONTRIBUTING.md 和开发环境指南中对 Node.js 和 pnpm 版本的说明已同步。

npm/win32-x64-msvc/package.json (1)

17-17: 升级 Windows Binding 包的 Node.js 约束
@tarojs/binding-win32-x64-msvcengines.node 已从 >=18 提升至 >=20。请确认发布配置及 CI/CD 流程对 Node.js 20+ 的兼容性已验证。

npm/linux-x64-musl/package.json (1)

16-16: 升级 Linux Binding 包的 Node.js 约束
@tarojs/binding-linux-x64-musl 已将 engines.node 更新为 >=20,与全局标准一致。建议检查发布脚本和 CI 环境,确保对 Node.js 20+ 的完整支持。

packages/taro-cli/templates/plugin-compile/package.json.tmpl (1)

38-38: 更新 @types/node^20
本次变更将模板的 Node.js 类型定义依赖提升至 v20,符合项目整体版本升级目标。

packages/create-app/package.json (1)

30-30: 提升 Node 引擎最低版本至 >=20
与仓库其他包的 Node.js 引擎要求保持一致,确保兼容性和统一性。

packages/postcss-pxtransform/package.json (1)

34-34: 提升 Node 引擎最低版本至 >=20
该更新与整体 Node.js 版本升级策略一致,请确保 CI/CD 配置已同步更新。

.github/dependabot.yml (1)

12-12: 校正 Dependabot 忽略规则范围
@types/node 的忽略版本范围调整为 >= 20.0.0, < 23.0.0,与项目中类型定义版本限制一致。

examples/mini-program-example/package.json (2)

5-5: 调整 description 字段格式
在 “小程序” 与 “demo” 之间添加空格,使描述更具可读性。


84-84: 更新 @types/node^20
示例项目的类型定义已同步至 v20,以匹配 Node.js 升级要求。

.github/workflows/publish.yml (1)

89-92: 升级 pnpm 动作和版本: 将 pnpm/action-setup 从 v3 升级到 v4 并设置版本为 10,符合项目统一使用 pnpm v10 的目标。

.github/workflows/nodejs.yml (2)

51-59: 平台排除规则确认: 排除了 macOS 和 Windows 上的所有 Node.js 版本,仅在 ubuntu-latest 上运行,符合文档中 “目前只在 ubuntu-latest 执行” 的说明。请再次确认是否有意仅在 Ubuntu 平台测试。


65-68: 升级 pnpm 配置: 将 pnpm/action-setup 升级到 v4 并使用 pnpm v10,保持与其他 CI 一致。

CONTRIBUTING.md (2)

13-13: 更新开发环境要求: 将 Node.js 推荐版本提升至 v20.19.1+,pnpm 推荐版本提升至 v10,已与 PR 目标保持一致。


39-39: 校验外链文档版本: npm link 文档链接指向 v11 CLI,建议确认当前项目是否需要指向 pnpm link 或其他包管理器文档,并验证该 URL 是否为最新版本。

package.json (1)

98-98: 升级 @types/node 版本: 将类型定义依赖从 ^18 更新为 ^20,与最低 Node.js 20 的引擎需求保持一致。

.github/workflows/sync-components-types.yml (1)

37-40: 升级 pnpm 和 Node.js 版本: 将 pnpm/action-setup 升级到 v4 (pnpm v10),并将 Node.js 版本提升至 22,保持与其他 CI 流程一致。

.github/workflows/build-rust-binding.yml (1)

50-50: 升级 pnpm Action 到 v4,确认版本号正确
uses: pnpm/[email protected] 升级到 @v4,对标 pnpm 官方建议。请确认该 Action v4 在 Node.js 22 环境下工作正常,且与项目中其他 workflows 中 Action 版本保持一致。

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)
pnpm-workspace.yaml (1)

11-11: 为文件末尾补充换行符
YAMLlint 报告在文件末尾缺少新行,建议在最后一行后添加一个空行以符合 YAML 规范和 lint 规则。

   "@babel/types": "^7.27.1"
+ 
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 11-11: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7be6f30 and 522b04c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • packages/taro-helper/package.json (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/taro-helper/package.json
🧰 Additional context used
🪛 YAMLlint (1.35.1)
pnpm-workspace.yaml

[error] 11-11: no new line character at the end of file

(new-line-at-end-of-file)

⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Testing on Node.js (windows-latest)
  • GitHub Check: Testing on Node.js (macos-13)
  • GitHub Check: Testing on Node.js 22.x (ubuntu-latest)
  • GitHub Check: Testing on Node.js 20.x (ubuntu-latest)

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

🔭 Outside diff range comments (1)
packages/taro-transformer-wx/src/render.ts (1)

1755-1762: ⚠️ Potential issue

检查逻辑错误:重复判断始终为真
当前遍历 this.componentProperties 时,if (this.componentProperties.has(componentName)) 在循环中对同一集合判断自身必然成立,会导致首次迭代即抛错。

应当改为检测与其他集合(如 this.initState)的重复,例如:

- this.componentProperties.forEach((componentName) => {
-   if (this.componentProperties.has(componentName)) {
+ this.componentProperties.forEach((componentName) => {
+   if (this.initState.has(componentName)) {
       throw codeFrameError(…)
     }

或根据业务逻辑选择合适的集合进行判断。

🧹 Nitpick comments (2)
packages/taro-transformer-wx/src/render.ts (2)

2422-2422: 性能优化:避免使用 cloneDeep 克隆 Set
cloneDeep 对 Set 的深度拷贝开销较大,可直接使用原生构造拷贝:

- let componentProperties = cloneDeep(this.componentProperties)
+ let componentProperties = new Set(this.componentProperties)

2424-2429: 优化遍历与删除逻辑
forEach 内部对同一集合执行删除操作会影响迭代行为,建议先收集待删除项再统一删除,或改用 filter/map 生成新集合,避免并发修改带来的隐患。

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f2f98f7 and 7f5135a.

📒 Files selected for processing (1)
  • packages/taro-transformer-wx/src/render.ts (20 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
packages/taro-transformer-wx/src/render.ts (2)
packages/taro-transformer-wx/src/jsx.ts (2)
  • buildBlockElement (127-137)
  • setJSXAttr (81-102)
packages/taro-transformer-wx/src/utils.ts (1)
  • isArrayMapCallExpression (351-358)
🪛 Biome (1.9.4)
packages/taro-transformer-wx/src/render.ts

[error] 142-142: Don't use 'Function' as a type.

Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.

(lint/complexity/noBannedTypes)


[error] 791-792: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Testing on Rust
🔇 Additional comments (13)
packages/taro-transformer-wx/src/render.ts (13)

151-151: 变量命名修正:componentProperiescomponentProperties
已将属性名统一为 componentProperties,提高代码可读性并修正拼写。


367-367: 方法名拼写修正:setProperiessetProperties
方法名已与属性名保持一致,修复了拼写错误。


372-372: 引用属性名更新
setProperties 中正确使用 this.componentProperties 迭代组件属性集合。


458-458: 属性名拼写修正:returnedifStemJSXreturnedIfStemJSX
修复了属性名的大小写和拼写,保持驼峰命名一致。


479-484: 更新引用:returnedIfStemJSX
loopComponentVisitor 中对 returnedIfStemJSX 的判断与删除逻辑已同步更新为新的属性名称。


628-628: 方法名拼写修正:renameIfScopeVaribalerenameIfScopeVariable
修正拼写错误,保持“Variable”单词拼写正确。


1665-1665: 构造函数参数命名修正:componentProperiescomponentProperties
构造函数参数已更正并与类属性同步赋值。


1711-1711: 调用更新:quickappVisitor
将原先错误的 quickappVistor 调用更改为正确的 quickappVisitor


1726-1726: 调用更新:setProperties
在 quickapp 分支中正确调用 this.setProperties(),修复拼写。


1733-1733: 引用属性名更新:deferredHandleClosureJSXFunc
handleClosureComp 中遍历的属性名称已同步更新为 deferredHandleClosureJSXFunc


1736-1736: 属性名拼写修正:quickappVistorquickappVisitor
修正 visitor 定义拼写,与调用处保持一致。


2435-2436: quickapp 平台属性名转换
在 quickapp 场景下将大写组件属性转换为 snake_case,逻辑清晰合理。


2447-2447: 将组件属性纳入状态跟踪
usedState 计算中加入 componentProperties,确保组件属性也被正确跟踪为状态字面量。

@ianzone
Copy link
Contributor Author

ianzone commented May 8, 2025

@yoyo837 不知道怎么解决了,不同平台 jest 生成的快照不一样

@yoyo837
Copy link
Contributor

yoyo837 commented May 8, 2025

@yoyo837 不知道怎么解决了,不同平台 jest 生成的快照不一样

可能哪里没弄对

@ZakaryCode
Copy link
Contributor

ZakaryCode commented May 16, 2025

@yoyo837 不知道怎么解决了,不同平台 jest 生成的快照不一样

pnpm 10 引入的问题,安装的路径在 win 上不太一致导致 tests 内部的 snapshot 部分 chunkid 等出现差异,对应在 webpack 生成的 deterministic id 不一致,改成 named 应该一定程度上可以缩小这种差异避免报错

@ianzone
Copy link
Contributor Author

ianzone commented May 17, 2025

由于 53d8ba9 ,暂时无法使用 node22
先把node18弃用了吧 #17727

@ianzone ianzone closed this May 17, 2025
@ianzone ianzone deleted the node22 branch May 17, 2025 11:28
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.

3 participants