Skip to content

Conversation

@ianzone
Copy link
Contributor

@ianzone ianzone commented Nov 24, 2025

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

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

  • 错误修复 (Bugfix) issue: fix #
  • 新功能 (Feature)
  • 代码重构 (Refactor)
  • TypeScript 类型定义修改 (Types)
  • 文档修改 (Docs)
  • 代码风格更新 (Code style update)
  • 构建优化 (Chore)
  • 其他,请描述 (Other, please describe):

这个 PR 涉及以下平台:

  • 所有平台
  • Web 端(H5)
  • 移动端(React-Native)
  • 鸿蒙(Harmony)
  • 鸿蒙容器(Harmony Hybrid)
  • ASCF 元服务
  • 快应用(QuickApp)
  • 所有小程序
  • 微信小程序
  • 企业微信小程序
  • 京东小程序
  • 百度小程序
  • 支付宝小程序
  • 支付宝 IOT 小程序
  • 钉钉小程序
  • QQ 小程序
  • 飞书小程序
  • 快手小程序
  • 头条小程序

Summary by CodeRabbit

发布说明

  • 新增功能

    • ScrollView 组件新增 enhancedshowScrollbar 属性,提供更多自定义选项。
  • 错误修复

    • 修复了 pull-to-refresh 组件在嵌套场景下的移除行为,提升组件稳定性。

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 24, 2025

总体概述

本变更包含依赖项重大升级(Stencil Core 2→4、Puppeteer 19→24、移除 Jest)、多个输入组件中的属性名修正(onInputExcuted→onInputExecuted)、ScrollView 文档新增 API 属性、pull-to-refresh 子节点移除逻辑优化、tabbar 导入路径更新及 Stencil 构建配置调整。

变更详情

内聚组件 / 文件 变更摘要
输入组件属性名修正
packages/taro-components-react/src/components/input/index.tsx, packages/taro-components/src/components/input/input.tsx
修正内部标志属性名从 onInputExcuted 改为 onInputExecuted;扩展 handleInput 事件类型以包含 InputEvent;将组合事件绑定从 onCompositionStart/End 改为 onCompositionstart/onCompositionend,与 DOM 事件属性名对齐。
依赖项更新与整理
packages/taro-components/package.json
升级 @stencil/core 从 2.22.3→4.38.3;升级 @stencil/react-output-target 从 0.4.0→0.5.1;升级 @stencil/vue-output-target 从 0.7.0→0.8.6;升级 puppeteer 从 ^19.2.0→^24.31.0;新增 sass 和 tsconfig-paths 到 devDependencies;将 rollup-plugin-node-externals 从 dependencies 移至 devDependencies;移除 Jest 相关包;删除 pretest:ci 脚本。
拉取刷新组件逻辑优化
packages/taro-components/src/components/pull-to-refresh/pull-to-refresh.tsx
为 removeChild 添加包装器,正确处理嵌套子节点移除:当目标节点的父级为内部内容元素时调用 child.removeChild(node),否则调用原始 removeChild 方法。
ScrollView 文档 API 扩展
packages/taro-components/src/components/scroll-view/readme.md
新增两个公开布尔类型属性:enhanced(默认 false)和 showScrollbar(默认 true)。
Tabbar 导入路径调整
packages/taro-router/src/tabbar.ts
变更导入来源从 @tarojs/components/dist/components 改为 @tarojs/components/dist/components/taro-tabbar;重命名导入符号为 defineCustomElementTaroTabbar
Stencil 构建配置更新
packages/taro-components/scripts/stencil/stencil.config.ts
从 dist-custom-elements OutputTarget 中移除 autoDefineCustomElements: false 选项。

预估代码审查工作量

🎯 3 (中等复杂) | ⏱️ ~20-25 分钟

需要重点关注的区域:

  • packages/taro-components/package.json - Stencil 主版本升级(2→4)可能涉及兼容性变化;需验证 Jest 移除是否完全替换为其他测试框架
  • packages/taro-components/src/components/pull-to-refresh/pull-to-refresh.tsx - removeChild 包装逻辑需验证其在嵌套场景中的正确性和边界情况处理
  • packages/taro-components/src/components/input/input.tsx - 组合事件绑定大小写变更需确认与浏览器 DOM 事件兼容性
  • packages/taro-router/src/tabbar.ts - 导入路径变更需确认新路径的有效性和导出正确性

建议审查人

  • luckyadam
  • yoyo837
  • tutuxxx

🐰 依赖升级如羽毛轻飘,
输入修正消除拼写烦恼,
Pull-to-refresh 拥抱新逻辑,
ScrollView 展翅添新飞沙,
Stencil 构建迎接新时代!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题「chore: stencil update」准确地总结了主要变更——Stencil 框架及相关依赖的升级,这是跨多个文件的核心改动。
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 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 eb04f60 and 518954e.

📒 Files selected for processing (1)
  • packages/taro-components/scripts/stencil/stencil.config.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/taro-components/scripts/stencil/stencil.config.ts
⏰ 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). (5)
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai bot requested review from luckyadam and tutuxxx November 24, 2025 02:38
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: 2

🧹 Nitpick comments (1)
packages/taro-cli-convertor/report/static/js/bundle.js (1)

2127-51707: 建议验证 bundle 文件是否应该提交到源码库。

通常构建产物(如 bundle.js)应该在 CI/CD 过程中生成,而不是直接提交到版本控制系统。这样可以避免合并冲突、减小仓库体积,并确保代码和构建产物的一致性。

不过,如果这个文件是用于静态报告查看器且需要预构建资源,则提交它可能是合理的。请确认这是否是有意为之的设计决策。

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dc9bd71 and ba08f4a.

⛔ Files ignored due to path filters (2)
  • packages/taro-cli-convertor/report/static/js/bundle.js.map is excluded by !**/*.map
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • packages/taro-cli-convertor/report/static/js/bundle.js (22 hunks)
  • packages/taro-components-react/src/components/input/index.tsx (1 hunks)
  • packages/taro-components/package.json (1 hunks)
  • packages/taro-components/src/components/input/input.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-08-08T02:32:58.265Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18146
File: packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json:12-14
Timestamp: 2025-08-08T02:32:58.265Z
Learning: 在 Taro 项目的 pnpm 工作区中,Vitest 相关依赖(vitest 和 vitest/coverage-istanbul)被管理在根目录的 package.json 中,而不是各个子包的 devDependencies 中。这是 monorepo 中依赖提升的标准做法。

Applied to files:

  • packages/taro-components/package.json
📚 Learning: 2025-09-05T18:40:45.775Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18150
File: packages/taro-platform-harmony-hybrid/package.json:43-45
Timestamp: 2025-09-05T18:40:45.775Z
Learning: 在 tarojs/plugin-platform-harmony-hybrid 包中,tarojs/components-library-react、tarojs/components-library-solid 和 tarojs/components-library-vue3 必须作为直接依赖(dependencies)而不能作为 peer 依赖,因为插件源码中有对这些包的直接引用,包括 componentAdapter* getter 方法和 webpack 别名配置。

Applied to files:

  • packages/taro-components/package.json
📚 Learning: 2025-11-21T07:15:22.634Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18646
File: packages/taro/package.json:40-40
Timestamp: 2025-11-21T07:15:22.634Z
Learning: 在 tarojs/taro 包中添加 vite 作为 devDependency 是为了让 tarojs/vite-runner 能够依赖正确的 vite 类型版本,确保 monorepo 中的类型兼容性。

Applied to files:

  • packages/taro-components/package.json
📚 Learning: 2025-05-25T18:02:31.387Z
Learnt from: ianzone
Repo: NervJS/taro PR: 17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。

Applied to files:

  • packages/taro-components/package.json
⏰ 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). (4)
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
🔇 Additional comments (5)
packages/taro-components/src/components/input/input.tsx (1)

277-278: LGTM!事件名称更改与 Stencil 3.x 一致

将事件处理器从 onCompositionStart/onCompositionEnd 改为 onCompositionstart/onCompositionend 符合 Stencil 框架使用原生 DOM 事件命名的约定,与代码中 103-104 行的 addEventListener 调用保持一致。

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

77-94: 开发依赖添加合理

新增的 devDependencies 包括:

  • @tarojs/helper:workspace 依赖(符合 Taro monorepo 标准实践)
  • Jest 测试套件(jest、jest-cli、jest-environment-node、jest-runner)
  • rollup-plugin-node-externalssasstsconfig-paths:构建工具

这些依赖的添加有助于改进测试基础设施和构建配置。特别注意 rollup-plugin-node-externals 从 dependencies 移至 devDependencies 是正确的分类调整。

根据代码库学习经验,在 Taro monorepo 中使用 workspace 依赖是标准做法。


59-59: 验证 Stencil 3.x 升级已完成

@stencil/core 从 2.22.3 升级到 3.4.2 需要参考官方的 Stencil v3.0.0 破坏性变更指南。根据官方迁移指南,主要的破坏性变更包括:

  • onInput 和 onInputCapture 事件的接口已更新,从接受 Event 参数改为接受 InputEvent 参数
  • 移除了 'angular' 输出目标,改为使用 @stencil/angular-output-target
  • dist-custom-elements-bundle 输出目标已被移除,用户应迁移到 dist-custom-elements 输出目标

请确认已按照官方迁移指南更新了组件代码(特别是事件处理器的类型定义)并验证了依赖的输出目标配置。

packages/taro-cli-convertor/report/static/js/bundle.js (2)

8112-8112: LGTM!

Webpack 样板代码的空白行更改不影响功能。

Also applies to: 8126-8126, 8129-8129, 8133-8133, 8146-8146, 8176-8176, 8188-8188, 8200-8200, 8205-8205, 8216-8216


14792-14792: 修正范围:仅 Input 组件确认了属性名称的破坏性改动。

验证发现,本次提交仅修改了 Input 组件的事件属性名称,Search 和 TextArea 组件并未进行相应改动。

实际变更范围:

  • packages/taro-components-react/src/components/input/index.tsx 第 261-262 行:onCompositionStartoncompositionstartonCompositionEndoncompositionend
  • packages/taro-components/src/components/input/input.tsx 第 277-278 行:同上变更

这确实是破坏性的 API 改动(与 Stencil 框架更新相关),建议:

  1. 确认是否需要发布 major 版本
  2. 在 CHANGELOG 中明确标注此破坏性改动
  3. 如需平滑升级,考虑在过渡期提供向后兼容支持

Likely an incorrect or invalid review comment.

@liuyuinsdu
Copy link

liuyuinsdu commented Nov 24, 2025 via email

@coderabbitai coderabbitai bot requested a review from yoyo837 November 24, 2025 03:23
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 (2)
packages/taro-cli-convertor/report/static/js/bundle.js (2)

33760-33832: 组合事件回调直接调用缺少空值保护,建议与其他事件写法保持一致

这里通过解构拿到 _onCompositionstart / _onCompositionend,在 onCompositionStart/End 中被直接调用:

  • 如果上层未传入 onCompositionStart / onCompositionEnd_onCompositionstart / _onCompositionend 可能为 undefined,直接调用会抛 TypeError
  • 下方 Search 相关代码已经采用了 onCompositionStart === null || onCompositionStart === void 0 ? void 0 : onCompositionStart(e) 这种可选调用形式,可以参考保持一致。

建议在这里也加上空值保护,例如:

-    onCompositionStart: function onCompositionStart(event) {
-      _onCompositionstart(event);
+    onCompositionStart: function onCompositionStart(event) {
+      _onCompositionstart === null || _onCompositionstart === void 0 ? void 0 : _onCompositionstart(event);
       if (onOriginCompositionStart) {
         onOriginCompositionStart(event);
       }
     },
-    onCompositionEnd: function onCompositionEnd(event) {
-      _onCompositionend(event);
+    onCompositionEnd: function onCompositionEnd(event) {
+      _onCompositionend === null || _onCompositionend === void 0 ? void 0 : _onCompositionend(event);
       if (onOriginCompositionEnd) {
         onOriginCompositionEnd(event);
       }

另外,变量名 _onCompositionstart / _onCompositionend 与外部 prop 名(onCompositionStart / onCompositionEnd)大小写略不一致,阅读时稍有干扰,如后续有机会重编 bundle,可考虑在源码层面统一命名风格。


51175-51195: Search 组合输入事件逻辑合理,函数命名可按需微调

这一段通过 handleonCompositionstart / handleonCompositionend 维护 composedRef 状态,并用可选调用安全地转发到 onCompositionStart / onCompositionEnd,行为上是合理的;随后作为 onCompositionStart / onCompositionEnd prop 传给输入组件也符合预期。

唯一是函数名 handleonCompositionstart / handleonCompositionend 略难读,如果不依赖当前命名与其他地方做字符串映射,后续在源码中可以考虑改成更常见的 camelCase,如 handleCompositionStart / handleCompositionEnd,以提升可读性。

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ba08f4a and a0470c1.

📒 Files selected for processing (3)
  • packages/taro-cli-convertor/report/static/js/bundle.js (11 hunks)
  • packages/taro-components-react/src/components/input/index.tsx (5 hunks)
  • packages/taro-components/src/components/pull-to-refresh/pull-to-refresh.tsx (4 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: ianzone
Repo: NervJS/taro PR: 18150
File: packages/taro-platform-harmony-hybrid/package.json:43-45
Timestamp: 2025-09-05T18:40:45.775Z
Learning: 在 tarojs/plugin-platform-harmony-hybrid 包中,tarojs/components-library-react、tarojs/components-library-solid 和 tarojs/components-library-vue3 必须作为直接依赖(dependencies)而不能作为 peer 依赖,因为插件源码中有对这些包的直接引用,包括 componentAdapter* getter 方法和 webpack 别名配置。
Learnt from: ianzone
Repo: NervJS/taro PR: 17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
⏰ 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). (5)
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • 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 - x86_64-apple-darwin
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
🔇 Additional comments (3)
packages/taro-components-react/src/components/input/index.tsx (1)

51-51: 修正拼写错误,提升代码质量。

将内部标志 onInputExcuted 统一重命名为 onInputExecuted,所有引用均已一致更新。这是一个纯粹的拼写修正,没有引入功能变更。

Also applies to: 56-56, 93-93, 96-96, 118-118, 125-125, 137-137, 162-162

packages/taro-components/src/components/pull-to-refresh/pull-to-refresh.tsx (1)

140-146: 正确实现 removeChild 代理,保持 DOM 操作一致性。

新增的 removeChild 代理逻辑与已有的 appendChildinsertBeforereplaceChild 代理模式保持一致。通过检查 node.parentNode === child 来判断是否需要委托给内部内容元素的 removeChild 方法,否则回退到原始实现。这确保了嵌套节点移除操作的正确性。

packages/taro-cli-convertor/report/static/js/bundle.js (1)

8109-8218: webpack runtime 生成代码的格式化变更,无功能影响

这一段只是 webpack 引导/runtime 代码中的空行或注释格式调整,不改变执行逻辑,可以保持现状,无需额外修改。

@codecov
Copy link

codecov bot commented Nov 24, 2025

Codecov Report

❌ Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 55.03%. Comparing base (dc9bd71) to head (518954e).

Files with missing lines Patch % Lines
...src/components/pull-to-refresh/pull-to-refresh.tsx 80.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #18649      +/-   ##
==========================================
- Coverage   56.33%   55.03%   -1.30%     
==========================================
  Files         447      529      +82     
  Lines       23342    26516    +3174     
  Branches     5763     6470     +707     
==========================================
+ Hits        13149    14594    +1445     
- Misses       8364    10084    +1720     
- Partials     1829     1838       +9     
Flag Coverage Δ
taro-cli 72.85% <ø> (ø)
taro-runtime 60.33% <ø> (ø)
taro-web 49.68% <91.66%> (-3.44%) ⬇️

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

Files with missing lines Coverage Δ
...ges/taro-components/src/components/input/input.tsx 61.94% <100.00%> (ø)
...src/components/pull-to-refresh/pull-to-refresh.tsx 38.75% <80.00%> (ø)

... and 86 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.

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 00c9ac7 and 40f900e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • packages/taro-components/package.json (1 hunks)
  • packages/taro-components/scripts/stencil/stencil.config.ts (3 hunks)
🧰 Additional context used
🧠 Learnings (6)
📚 Learning: 2025-08-08T02:32:58.265Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18146
File: packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json:12-14
Timestamp: 2025-08-08T02:32:58.265Z
Learning: 在 Taro 项目的 pnpm 工作区中,Vitest 相关依赖(vitest 和 vitest/coverage-istanbul)被管理在根目录的 package.json 中,而不是各个子包的 devDependencies 中。这是 monorepo 中依赖提升的标准做法。

Applied to files:

  • packages/taro-components/package.json
  • packages/taro-components/scripts/stencil/stencil.config.ts
📚 Learning: 2025-09-05T18:40:45.775Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18150
File: packages/taro-platform-harmony-hybrid/package.json:43-45
Timestamp: 2025-09-05T18:40:45.775Z
Learning: 在 tarojs/plugin-platform-harmony-hybrid 包中,tarojs/components-library-react、tarojs/components-library-solid 和 tarojs/components-library-vue3 必须作为直接依赖(dependencies)而不能作为 peer 依赖,因为插件源码中有对这些包的直接引用,包括 componentAdapter* getter 方法和 webpack 别名配置。

Applied to files:

  • packages/taro-components/package.json
  • packages/taro-components/scripts/stencil/stencil.config.ts
📚 Learning: 2025-11-21T07:15:22.634Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18646
File: packages/taro/package.json:40-40
Timestamp: 2025-11-21T07:15:22.634Z
Learning: 在 tarojs/taro 包中添加 vite 作为 devDependency 是为了让 tarojs/vite-runner 能够依赖正确的 vite 类型版本,确保 monorepo 中的类型兼容性。

Applied to files:

  • packages/taro-components/package.json
  • packages/taro-components/scripts/stencil/stencil.config.ts
📚 Learning: 2025-05-25T18:02:31.387Z
Learnt from: ianzone
Repo: NervJS/taro PR: 17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。

Applied to files:

  • packages/taro-components/package.json
  • packages/taro-components/scripts/stencil/stencil.config.ts
📚 Learning: 2025-08-25T22:16:50.118Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18150
File: packages/babel-plugin-transform-taroapi/tests/__mocks__/h5-definition.json:2356-2356
Timestamp: 2025-08-25T22:16:50.118Z
Learning: The file `packages/babel-plugin-transform-taroapi/tests/__mocks__/h5-definition.json` is auto-generated by the post-build script `packages/taro-platform-h5/scripts/post-build.mjs`, which copies content from `taro-platform-h5/dist/definition.json`. This file should not be manually edited.

Applied to files:

  • packages/taro-components/scripts/stencil/stencil.config.ts
📚 Learning: 2025-06-23T00:09:31.233Z
Learnt from: ianzone
Repo: NervJS/taro PR: 17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。

Applied to files:

  • packages/taro-components/scripts/stencil/stencil.config.ts
⏰ 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). (6)
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-musl
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
🔇 Additional comments (8)
packages/taro-components/scripts/stencil/stencil.config.ts (2)

92-93: 注释改进,LGTM!

注释内容更加清晰,准确说明了为什么不在构建时转换为 ES5。


118-118: testRegex 格式更新正确

testRegex 从字符串格式改为数组格式,符合新版本 Jest/Stencil 的配置要求。测试匹配模式保持不变。

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

75-77: 输出目标包更新与核心版本对齐

更新了 React 和 Vue3 的输出目标包版本,与 @stencil/core 4.38.3 保持兼容。新增的 @tarojs/helper 可能用于构建脚本中的辅助功能。


82-85: 显式声明 Jest 依赖改进了依赖管理

现在明确声明了 Jest 相关依赖包,这与 stencil.config.ts 中第 97-100 行的注释相呼应。显式声明这些依赖有助于:

  1. 提高依赖管理的透明度
  2. 避免依赖提升带来的版本不确定性
  3. 便于其他开发者理解测试环境的要求

90-90: Puppeteer 更新合理

Puppeteer 更新到 20.9.0,可能包含性能改进和更好的浏览器支持。


92-92: 依赖分类修正正确

rollup-plugin-node-externals 移至 devDependencies 是正确的,因为它是构建工具,仅在编译时需要。


93-94: 构建工具依赖完善

明确声明了 sass 和 tsconfig-paths 依赖,分别用于样式编译和模块路径解析。版本选择合理。


59-59: 手动验证 Stencil 从 2.22.3 升级到 4.38.3 的适配情况

该升级跨越两个大版本(2.x → 3.x → 4.x),包含多项破坏性变更。由于沙箱环境限制无法执行自动化构建和测试,需要手动验证以下内容:

Stencil 3.0 关键变更:

  • outputTargets 配置更新(dist-custom-elements-bundle 已移除)
  • autoDefineCustomElements 已重命名为 customElementsExportBehavior
  • 默认启用 Source Maps(若需旧行为需显式设置 sourceMap: false

Stencil 4.0 关键变更:

  • transformAliasedImportPaths 现默认为 true
  • 删除 enableCacheStats 等已弃用标志
  • 移除浏览器内编译支持
  • 需要 Node 16+ 支持

需手动验证的项目:

  1. packages/taro-components/stencil.config.ts 是否正确适配上述配置变更
  2. 构建产物完整性(dist/components、loader 等)
  3. 三个框架代理文件正确生成(React、Vue3、Solid)
  4. 完整的测试套件通过情况
  5. 生成的类型声明(.d.ts 文件)完整性

请本地运行完整的构建和测试流程验证升级的正确性。

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)
packages/taro-components/package.json (1)

77-77: 说明 @tarojs/helper 的用途。

新增的 @tarojs/helper devDependency 的具体用途不明确。请确认:

  1. 这个依赖在本包中的使用位置
  2. 是否在 stencil 配置或构建脚本中被引用
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 40f900e and ea9fbd9.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • packages/taro-components/package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2025-08-08T02:32:58.265Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18146
File: packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json:12-14
Timestamp: 2025-08-08T02:32:58.265Z
Learning: 在 Taro 项目的 pnpm 工作区中,Vitest 相关依赖(vitest 和 vitest/coverage-istanbul)被管理在根目录的 package.json 中,而不是各个子包的 devDependencies 中。这是 monorepo 中依赖提升的标准做法。

Applied to files:

  • packages/taro-components/package.json
📚 Learning: 2025-09-05T18:40:45.775Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18150
File: packages/taro-platform-harmony-hybrid/package.json:43-45
Timestamp: 2025-09-05T18:40:45.775Z
Learning: 在 tarojs/plugin-platform-harmony-hybrid 包中,tarojs/components-library-react、tarojs/components-library-solid 和 tarojs/components-library-vue3 必须作为直接依赖(dependencies)而不能作为 peer 依赖,因为插件源码中有对这些包的直接引用,包括 componentAdapter* getter 方法和 webpack 别名配置。

Applied to files:

  • packages/taro-components/package.json
📚 Learning: 2025-08-25T22:16:50.118Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18150
File: packages/babel-plugin-transform-taroapi/tests/__mocks__/h5-definition.json:2356-2356
Timestamp: 2025-08-25T22:16:50.118Z
Learning: The file `packages/babel-plugin-transform-taroapi/tests/__mocks__/h5-definition.json` is auto-generated by the post-build script `packages/taro-platform-h5/scripts/post-build.mjs`, which copies content from `taro-platform-h5/dist/definition.json`. This file should not be manually edited.

Applied to files:

  • packages/taro-components/package.json
📚 Learning: 2025-11-21T07:15:22.634Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18646
File: packages/taro/package.json:40-40
Timestamp: 2025-11-21T07:15:22.634Z
Learning: 在 tarojs/taro 包中添加 vite 作为 devDependency 是为了让 tarojs/vite-runner 能够依赖正确的 vite 类型版本,确保 monorepo 中的类型兼容性。

Applied to files:

  • packages/taro-components/package.json
📚 Learning: 2025-05-25T18:02:31.387Z
Learnt from: ianzone
Repo: NervJS/taro PR: 17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。

Applied to files:

  • packages/taro-components/package.json
⏰ 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). (5)
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
🔇 Additional comments (3)
packages/taro-components/package.json (3)

75-77: 验证 Jest 依赖与单仓库测试配置的一致性。

该 PR 在 devDependencies 中新增了 jest、jest-cli、jest-environment-node 和 jest-runner(版本 27.5.1)。根据项目中的依赖提升约定,测试框架和工具通常在根目录 package.json 中统一管理。请确认:

  1. 这些 Jest 依赖是否应该在根目录 package.json 中声明而不是在此子包中
  2. 是否与其他包的测试配置冲突
  3. stencil 官方是否要求在包级别声明特定版本的 Jest

92-92: 确认 rollup-plugin-node-externals 从 dependencies 移至 devDependencies 的正确性。

rollup-plugin-node-externals 已从 dependencies 移至 devDependencies 并升级至 ^5.0.0。请确认:

  1. 这个插件仅在构建时使用,运行时不需要
  2. 该移动不会影响生产环境

90-90: 我需要进一步检查代码库中的测试脚本和 puppeteer 使用情况,以完整验证升级的影响。

Based on the web search results, I have confirmed significant breaking changes between puppeteer 19.2.0 and 24.31.0. In v24.0.0 (released January 9, 2025), puppeteer includes URL fragments into HTTPRequest/Response instances and removes deprecated Launch and Connect options. Additionally, the v24.0.0 release removed support for Firefox over CDP.

These are definitive breaking changes documented in the official changelog. The URL fragment inclusion is particularly significant as it will affect any tests that rely on exact URL matching (URLs that previously matched without fragments will now include them, e.g., https://example.com/ becomes https://example.com/#anchor).

强烈需要验证测试脚本的兼容性。

根据 Puppeteer 官方文档确认,v24.0.0 引入了多个破坏性变更:

  1. 移除已弃用的 Launch 和 Connect 选项,需要检查测试脚本中的相关调用
  2. HTTPRequest/Response 返回的 URL 现在包含 URL 片段(#后缀),这会影响基于 URL 精确匹配的测试逻辑
  3. 移除对 Firefox 通过 CDP 的支持,若测试依赖 Firefox,需要调整

升级前必须:

  • 审查第 41 行的 pretest:ci 脚本及其涉及的所有测试文件,检查是否使用被移除的选项、Firefox 或依赖 URL 精确匹配的逻辑
  • 在 CI 环境运行完整测试以验证兼容性

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 45c81de and 7d6d89d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • .pnpmfile.cjs (0 hunks)
  • packages/taro-components/package.json (2 hunks)
💤 Files with no reviewable changes (1)
  • .pnpmfile.cjs
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-08-08T02:32:58.265Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18146
File: packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json:12-14
Timestamp: 2025-08-08T02:32:58.265Z
Learning: 在 Taro 项目的 pnpm 工作区中,Vitest 相关依赖(vitest 和 vitest/coverage-istanbul)被管理在根目录的 package.json 中,而不是各个子包的 devDependencies 中。这是 monorepo 中依赖提升的标准做法。

Applied to files:

  • packages/taro-components/package.json
📚 Learning: 2025-08-25T22:16:50.118Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18150
File: packages/babel-plugin-transform-taroapi/tests/__mocks__/h5-definition.json:2356-2356
Timestamp: 2025-08-25T22:16:50.118Z
Learning: The file `packages/babel-plugin-transform-taroapi/tests/__mocks__/h5-definition.json` is auto-generated by the post-build script `packages/taro-platform-h5/scripts/post-build.mjs`, which copies content from `taro-platform-h5/dist/definition.json`. This file should not be manually edited.

Applied to files:

  • packages/taro-components/package.json
📚 Learning: 2025-09-05T18:40:45.775Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18150
File: packages/taro-platform-harmony-hybrid/package.json:43-45
Timestamp: 2025-09-05T18:40:45.775Z
Learning: 在 tarojs/plugin-platform-harmony-hybrid 包中,tarojs/components-library-react、tarojs/components-library-solid 和 tarojs/components-library-vue3 必须作为直接依赖(dependencies)而不能作为 peer 依赖,因为插件源码中有对这些包的直接引用,包括 componentAdapter* getter 方法和 webpack 别名配置。

Applied to files:

  • packages/taro-components/package.json
📚 Learning: 2025-11-21T07:15:22.634Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18646
File: packages/taro/package.json:40-40
Timestamp: 2025-11-21T07:15:22.634Z
Learning: 在 tarojs/taro 包中添加 vite 作为 devDependency 是为了让 tarojs/vite-runner 能够依赖正确的 vite 类型版本,确保 monorepo 中的类型兼容性。

Applied to files:

  • packages/taro-components/package.json
⏰ 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). (5)
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • 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 - x86_64-apple-darwin
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7d6d89d and eb04f60.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • packages/taro-components/package.json (1 hunks)
  • packages/taroize/src/wxml.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2025-08-25T22:16:50.118Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18150
File: packages/babel-plugin-transform-taroapi/tests/__mocks__/h5-definition.json:2356-2356
Timestamp: 2025-08-25T22:16:50.118Z
Learning: The file `packages/babel-plugin-transform-taroapi/tests/__mocks__/h5-definition.json` is auto-generated by the post-build script `packages/taro-platform-h5/scripts/post-build.mjs`, which copies content from `taro-platform-h5/dist/definition.json`. This file should not be manually edited.

Applied to files:

  • packages/taroize/src/wxml.ts
  • packages/taro-components/package.json
📚 Learning: 2025-08-08T02:32:58.265Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18146
File: packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json:12-14
Timestamp: 2025-08-08T02:32:58.265Z
Learning: 在 Taro 项目的 pnpm 工作区中,Vitest 相关依赖(vitest 和 vitest/coverage-istanbul)被管理在根目录的 package.json 中,而不是各个子包的 devDependencies 中。这是 monorepo 中依赖提升的标准做法。

Applied to files:

  • packages/taro-components/package.json
📚 Learning: 2025-09-05T18:40:45.775Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18150
File: packages/taro-platform-harmony-hybrid/package.json:43-45
Timestamp: 2025-09-05T18:40:45.775Z
Learning: 在 tarojs/plugin-platform-harmony-hybrid 包中,tarojs/components-library-react、tarojs/components-library-solid 和 tarojs/components-library-vue3 必须作为直接依赖(dependencies)而不能作为 peer 依赖,因为插件源码中有对这些包的直接引用,包括 componentAdapter* getter 方法和 webpack 别名配置。

Applied to files:

  • packages/taro-components/package.json
📚 Learning: 2025-05-25T18:02:31.387Z
Learnt from: ianzone
Repo: NervJS/taro PR: 17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。

Applied to files:

  • packages/taro-components/package.json
📚 Learning: 2025-11-21T07:15:22.634Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18646
File: packages/taro/package.json:40-40
Timestamp: 2025-11-21T07:15:22.634Z
Learning: 在 tarojs/taro 包中添加 vite 作为 devDependency 是为了让 tarojs/vite-runner 能够依赖正确的 vite 类型版本,确保 monorepo 中的类型兼容性。

Applied to files:

  • packages/taro-components/package.json
⏰ 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). (5)
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • 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
🔇 Additional comments (5)
packages/taro-components/package.json (5)

69-89: ✅ Jest 依赖项已正确移除。

确认 devDependencies 中已完全移除 Jest 相关的依赖项(jest、jest-cli、jest-runner、jest-environment-node)以及不匹配的 @types/jest^27.4.1。该包现已正确继承根目录的 Jest 29.x 配置,避免了类型和运行时的不兼容问题。


58-58: ✅ Stencil 4.38.3 主版本升级与输出目标兼容。

@stencil/core 从 2.22.3 升级至 4.38.3 并配套升级 @stencil/react-output-target(0.5.1)和 @stencil/vue-output-target(0.8.6)。已通过官方文档确认这些版本组合兼容。确保 stencil.config.ts 已适配 Stencil 4.x 的配置要求(如 transformAliasedImportPaths)。

Also applies to: 74-76


84-84: 验证 Puppeteer 24.31.0 与测试脚本的兼容性。

Puppeteer 从 ^19.2.0 升级至 ^24.31.0(主版本跨度大)。请确认:

  1. 第 41-44 行的测试脚本(stencil test)能正常运行
  2. 与 Node 18+ 环保相兼容(第 55 行指定)
  3. 任何截图或 E2E 测试场景正常工作

63-63: 确认 hammerjs 的实际使用。

hammerjs ^2.0.8 被添加到 dependencies(而非 devDependencies)。请确认此库确实在源代码中被引入且必要,避免无用依赖膨胀。


87-88: ✅ 构建工具链补充。

新增 sass ^1.58.3 和 tsconfig-paths ^3.14.1 作为 devDependencies,支持 Stencil 4.x 的样式与路径解析。版本选择合理。

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.

2 participants