Skip to content

Revert/main#18685

Merged
Single-Dancer merged 4 commits intomainfrom
revert/main
Jan 8, 2026
Merged

Revert/main#18685
Single-Dancer merged 4 commits intomainfrom
revert/main

Conversation

@Muyouz
Copy link
Copy Markdown
Contributor

@Muyouz Muyouz commented Dec 19, 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

发布说明

  • Bug 修复

    • 修复 Input 组件中对输入标志的命名与事件大小写一致性,保证输入行为稳定。
  • 文档更新

    • 更新 scroll-view 文档,移除了两个已弃用的属性说明。
  • 测试

    • 切换与重构测试工具链(部分包由 Vitest 迁移至 Jest)、调整测试脚本与覆盖行为,移除或替换若干测试配置与工具。
  • 基础设施 / 运维

    • 统一回退 CI checkout 版本并调整 macOS 目标、移除自动下载头less 浏览器脚本、更新若干构建与依赖声明(含降级)。

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 19, 2025

Walkthrough

将多个 GitHub Actions 的 actions/checkout 从 v6 降级到 v5,调整测试/依赖工具(Vitest↔Jest、devDependencies 变更)、修复输入组件拼写与 composition 事件命名、修改 Stencil 输出配置、移除 Puppeteer 下载逻辑及若干测试/文档小改动。

Changes

Cohort / File(s) 变更说明
GitHub Actions:checkout 版本降级
.github/workflows/...auto-review.yml, build-rust-binding.yml, build-rust-wasm.yml, dependabot-update-lockfile.yml, issue-labeler.yml, publish.yml, sync-components-types.yml
将所有工作流中的 actions/checkout@v6 改为 @v5;无其他流程性改动。
Node.js CI 工作流调整
.github/workflows/nodejs.yml
将 macOS matrix 更新为 macos-latest、checkout 降级;安装改为 pnpm -r install --frozen-lockfile;测试步骤改为基于平台的 bash 条件脚本(macOS 特殊过滤)。
根 package.json & 测试工具降级/移除
package.json, vitest.config.ts
移除/调整脚本(删 pretest:ci,test 加 --aggregate-output);降级 vitest@vitest/coverage-istanbul;移除 puppeteervite;更新 vitest 配置 glob(.mts.ts)。
babel-plugin-transform-solid-jsx:从 Vitest 迁移到 Jest
packages/babel-plugin-transform-solid-jsx/package.json, packages/babel-plugin-transform-solid-jsx/jest.config.js, packages/babel-plugin-transform-solid-jsx/test/unique-transform.spec.js, packages/babel-plugin-transform-solid-jsx/vitest.config.mts
用 Jest 替换 Vitest:新增 jest.config.js、修改 package.json 脚本、测试文件从 ESM 改为 CommonJS、删除 Vitest 配置文件。
个别 package.json 脚本调整
packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json, packages/babel-plugin-transform-taroapi/package.json
删除或调整 snapshot 更新脚本(移除 updateSnapshot / 将 --update 改为 --updateSnapshot)。
输入组件:拼写与事件命名更改
packages/taro-components-react/src/components/input/index.tsx, packages/taro-components/src/components/input/input.tsx
将实例/内部标志 onInputExecuted 重命名为 onInputExcuted(声明、初始化、引用);调整 JSX composition 事件属性为 onCompositionStart/onCompositionEnd
taro-components:Stencil 配置与实现变更
packages/taro-components/scripts/stencil/stencil.config.ts, packages/taro-components/src/components/pull-to-refresh/pull-to-refresh.tsx, packages/taro-components/package.json
dist-custom-elements 输出目标添加 autoDefineCustomElements: false;将 host 的 removeChild 绑定改为直接绑定 child 的 removeChild;调整依赖(降级 @stencil/core、添加 hammerjs、Puppeteer 与 Jest 相关 devDeps)。
测试/文档小改动
packages/taro-components/__tests__/form.e2e.ts, packages/taro-components/src/components/scroll-view/readme.md
移除单选按钮的显式等待断言;从组件 readme 中移除 enhancedshowScrollbar 条目。
路由与脚本调整
packages/taro-router/src/tabbar.ts, packages/taro/package.json, scripts/download.mjs
简化 defineCustomElementTaroTabbar 导入路径;根 package.json 移除 vite 并调整 peer/devDeps;清空 scripts/download.mjs(移除 Puppeteer 下载逻辑)。

Sequence Diagram(s)

(此变更以配置、测试框架迁移与拼写/依赖调整为主,未引入新的多组件顺序控制流,故省略序列图。)

Estimated code review effort

🎯 3 (中等复杂度) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • tutuxxx
  • luckyadam
  • yoyo837

Poem

🐰 兔子轻敲键盘忙,
版本上下换一行,
Jest 与 Vitest 换新装,
拼写修正少彷徨,
配置收整笑盈盈 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive PR标题"Revert/main"过于通用且缺乏具体信息,无法清晰传达该PR的主要变更内容。 建议更新标题以明确说明回退的具体内容,例如:"Revert aggressive vite and stencil upgrades" 或 "Rollback core version due to compilation issues"。
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch revert/main

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.

Copy link
Copy Markdown

@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: 4

♻️ Duplicate comments (7)
.github/workflows/build-rust-wasm.yml (1)

12-12: Checkout action 版本回退

此文件中的 checkout action 也从 v6 回退到 v5,与 PR 中其他工作流文件的更改保持一致。

.github/workflows/issue-labeler.yml (1)

20-20: Checkout action 版本回退

此文件中的 checkout action 从 v6 回退到 v5,与 PR 中其他工作流的更改一致。

.github/workflows/auto-review.yml (1)

14-14: Checkout action 版本回退

此文件中的 checkout action 从 v6 回退到 v5,与 PR 中其他工作流的更改一致。

.github/workflows/publish.yml (1)

32-32: Checkout action 版本回退

此工作流中的三个 checkout 步骤都从 v6 回退到 v5,与 PR 中其他工作流的更改保持一致。

Also applies to: 94-94, 279-279

.github/workflows/dependabot-update-lockfile.yml (1)

15-15: Checkout action 版本回退

此文件中的 checkout action 从 v6 回退到 v5,与 PR 中其他工作流的更改一致。这是回退 PR 中的最后一个工作流文件更改。

.github/workflows/nodejs.yml (2)

66-66: 验证 actions/checkout@v5 的兼容性

与其他工作流文件一致,此处也将 checkout action 降级到 v5。请参考 .github/workflows/build-rust-binding.yml 中的验证建议。


154-154: 验证 actions/checkout@v5 的兼容性

与其他工作流文件一致,此处也将 checkout action 降级到 v5。请参考前面的验证建议。

🧹 Nitpick comments (2)
packages/taro-components/src/components/pull-to-refresh/pull-to-refresh.tsx (2)

119-119: 注释中的错别字。

注释中"组建"应为"组件"(component)。


139-139: 确认 removeChild 代理模式的设计意图和潜在风险。

第 139 行 this.el.removeChild = child?.removeChild.bind(child) 是有意的设计模式。该模式在 appendChild、insertBefore、replaceChild 上一致应用,表明所有子元素 DOM 操作都意图通过 .rmc-pull-to-refresh-content 包装元素进行路由。

潜在问题:

  • 若 querySelector 未找到目标元素,child?.removeChild.bind(child) 返回 undefined,调用 this.el.removeChild(node) 将抛出"undefined is not a function"而非预期的 DOM 错误
  • 此设计限制了 this.el 的 API,外部代码只能移除属于 child 的节点

建议审视:

  1. 此设计模式是否与该组件的预期使用方式一致
  2. 是否应添加防御性检查,处理 child 为 null 的场景
  3. 是否有相关的用户报告或实际使用问题
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4e186a3 and 05736cb.

⛔ Files ignored due to path filters (5)
  • packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/tests/__snapshots__/index.spec.ts.snap is excluded by !**/*.snap
  • packages/babel-plugin-transform-taroapi/tests/__snapshots__/harmony.spec.ts.snap is excluded by !**/*.snap
  • packages/babel-plugin-transform-taroapi/tests/__snapshots__/index.spec.ts.snap is excluded by !**/*.snap
  • 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 (26)
  • .github/workflows/auto-review.yml (1 hunks)
  • .github/workflows/build-rust-binding.yml (1 hunks)
  • .github/workflows/build-rust-wasm.yml (1 hunks)
  • .github/workflows/dependabot-update-lockfile.yml (1 hunks)
  • .github/workflows/issue-labeler.yml (1 hunks)
  • .github/workflows/nodejs.yml (4 hunks)
  • .github/workflows/publish.yml (3 hunks)
  • .github/workflows/sync-components-types.yml (1 hunks)
  • package.json (3 hunks)
  • packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json (0 hunks)
  • packages/babel-plugin-transform-solid-jsx/jest.config.js (1 hunks)
  • packages/babel-plugin-transform-solid-jsx/package.json (1 hunks)
  • packages/babel-plugin-transform-solid-jsx/test/unique-transform.spec.js (1 hunks)
  • packages/babel-plugin-transform-solid-jsx/vitest.config.mts (0 hunks)
  • packages/babel-plugin-transform-taroapi/package.json (1 hunks)
  • packages/taro-components-react/src/components/input/index.tsx (5 hunks)
  • packages/taro-components/__tests__/form.e2e.ts (0 hunks)
  • packages/taro-components/package.json (2 hunks)
  • packages/taro-components/scripts/stencil/stencil.config.ts (2 hunks)
  • packages/taro-components/src/components/input/input.tsx (6 hunks)
  • packages/taro-components/src/components/pull-to-refresh/pull-to-refresh.tsx (4 hunks)
  • packages/taro-components/src/components/scroll-view/readme.md (0 hunks)
  • packages/taro-router/src/tabbar.ts (1 hunks)
  • packages/taro/package.json (1 hunks)
  • scripts/download.mjs (0 hunks)
  • vitest.config.ts (1 hunks)
💤 Files with no reviewable changes (5)
  • scripts/download.mjs
  • packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json
  • packages/taro-components/tests/form.e2e.ts
  • packages/taro-components/src/components/scroll-view/readme.md
  • packages/babel-plugin-transform-solid-jsx/vitest.config.mts
🧰 Additional context used
🧠 Learnings (9)
📚 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/babel-plugin-transform-taroapi/package.json
  • packages/babel-plugin-transform-solid-jsx/jest.config.js
  • packages/babel-plugin-transform-solid-jsx/test/unique-transform.spec.js
  • packages/taro-components/scripts/stencil/stencil.config.ts
  • packages/babel-plugin-transform-solid-jsx/package.json
  • packages/taro-router/src/tabbar.ts
  • packages/taro/package.json
  • packages/taro-components/package.json
  • vitest.config.ts
📚 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/babel-plugin-transform-taroapi/package.json
  • packages/babel-plugin-transform-solid-jsx/package.json
  • .github/workflows/nodejs.yml
  • packages/taro/package.json
  • package.json
  • packages/taro-components/package.json
  • vitest.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/babel-plugin-transform-solid-jsx/jest.config.js
  • vitest.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/scripts/stencil/stencil.config.ts
  • packages/taro-router/src/tabbar.ts
  • packages/taro/package.json
  • 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/scripts/stencil/stencil.config.ts
  • packages/taro/package.json
  • 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/scripts/stencil/stencil.config.ts
  • packages/taro/package.json
  • package.json
  • packages/taro-components/package.json
📚 Learning: 2025-07-01T15:46:08.457Z
Learnt from: ianzone
Repo: NervJS/taro PR: 17937
File: .github/workflows/issue-labeler.yml:31-31
Timestamp: 2025-07-01T15:46:08.457Z
Learning: stefanbuck/github-issue-parserv3 GitHub Action 的输出字段名称是 `jsonString`,不是 `json`。在工作流中应该使用 `${{ steps.issue-parser.outputs.jsonString }}` 来引用解析后的 JSON 数据。

Applied to files:

  • .github/workflows/issue-labeler.yml
📚 Learning: 2025-08-09T21:41:18.741Z
Learnt from: ianzone
Repo: NervJS/taro PR: 17842
File: .github/workflows/merged.yml:34-41
Timestamp: 2025-08-09T21:41:18.741Z
Learning: 在 NervJS/taro 项目中,merged.yml workflow 故意使用 actions/upload-artifact 而非 actions/cache/save 来保存公共 NX 缓存,因为 Artifact 具有更长的保留时间(最多 90 天),而 Actions Cache 仅保留 7 天。缓存键采用精确匹配策略,不使用 restore-keys 前缀匹配。

Applied to files:

  • .github/workflows/nodejs.yml
📚 Learning: 2025-07-22T09:16:21.180Z
Learnt from: ianzone
Repo: NervJS/taro PR: 18056
File: packages/taro-runtime/tsconfig.json:10-10
Timestamp: 2025-07-22T09:16:21.180Z
Learning: 在使用 rollup-plugin-dts 的项目中,rollup.config.ts 等构建配置文件会被自动排除,不需要在 tsconfig.json 中手动排除。

Applied to files:

  • vitest.config.ts
🧬 Code graph analysis (1)
packages/babel-plugin-transform-solid-jsx/test/unique-transform.spec.js (2)
packages/babel-preset-taro/index.js (1)
  • path (1-1)
packages/taro-components-library-solid/scripts/fix.js (1)
  • path (2-2)
⏰ 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 Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
🔇 Additional comments (19)
packages/taro-components/scripts/stencil/stencil.config.ts (2)

92-94: 文档说明清晰。

注释清楚地解释了为何不在构建时转换为 ES5,而是将此包加入项目的 babel 编译中以避免低版本白屏问题。文档修改合理。


50-50: autoDefineCustomElements: false 是 dist-custom-elements 输出目标的标准配置。

此配置选项在 Stencil 2.x 中是推荐的标准设置,允许更好的 tree-shaking 并减小包体积。该设置与当前使用的 Stencil 2.22.3 版本完全兼容。此配置会被 Stencil v3.0.0+ 中的 customElementsExportBehavior 选项取代。

vitest.config.ts (1)

5-5: vitest 配置文件扩展名与 glob 模式一致

项目中所有 vitest 配置文件均使用 .ts 扩展名,glob 模式 projects: ['packages/*/vitest.config.ts'] 正确匹配了 packages 目录下的 10 个 vitest 配置文件。扩展名从 .mts 回退到 .ts 保持了与实际文件的一致性。

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

14-14: 确认 checkout v5 版本在所有工作流中保持一致

验证结果确认:

  1. v5 仍由 GitHub 维护,持续提供安全补丁和必要的修复
  2. 所有工作流文件(6 个文件,12 处使用)已统一使用 v5
  3. v6 与 v5 的主要差异为凭证处理机制,对大多数工作流无影响

建议补充此次回退的原因说明(若存在与 v6 的兼容性考虑,应在 PR 描述中记录)。

.github/workflows/nodejs.yml (2)

77-77: 验证递归安装命令的必要性

安装命令从 pnpm install 改为 pnpm -r install --frozen-lockfile-r 标志会递归安装所有工作区包。请确认:

  • 这是回退到之前的行为
  • 递归安装不会显著增加 CI 时间

113-113: 移除 pretest:ci 的变更是安全的

pretest:ci 是 packages/taro-components 中的 npm 生命周期钩子,当执行 test:ci 脚本时会自动运行。根目录的 test 脚本通过 pnpm --if-present -r ... test:ci 递归调用各包的 test:ci,pnpm 会自动触发对应的 pretest:ci 钩子执行 Puppeteer 安装。无需额外迁移设置,原有流程通过 npm 标准生命周期机制自动保证。

packages/babel-plugin-transform-solid-jsx/jest.config.js (1)

1-8: Jest 配置正确

此配置文件是从 Vitest 回退到 Jest 的一部分。配置项设置合理:

  • jsdom 环境适用于 DOM 测试
  • babel-jest 转换器正确处理 JSX
  • 覆盖率收集目标明确
  • 模块解析路径配置正确
packages/babel-plugin-transform-solid-jsx/test/unique-transform.spec.js (1)

1-10: 从 ES 模块迁移到 CommonJS 的实现正确

测试文件正确地从 ES 模块风格迁移到 CommonJS,以配合 Jest 测试运行器:

  • 使用 require 替代 import
  • babel-plugin-tester 通过 .default 正确导入
  • 路径处理简化为直接使用 __dirname
  • 插件从 ../dist 加载(匹配打包输出)
packages/taro-components/package.json (5)

41-41: pretest:ci 脚本正确添加

添加 Puppeteer 安装步骤以确保 CI 环境中测试所需的浏览器二进制文件可用。这与在 .github/workflows/nodejs.yml 中移除 pretest:ci 调用的变化一致。


60-60: hammerjs 依赖添加合理

添加 hammerjs 用于触摸手势支持,这是移动端组件库的常见需求。


88-94: 测试工具依赖正确回退

添加的 Jest 相关依赖(jest、jest-cli、jest-runner、jest-environment-node)以及 rollup 工具链正确配置,版本选择与从 Vitest 回退到 Jest 的目标一致。


86-86: Puppeteer 版本为较旧版本

使用的 Puppeteer 版本是 v19.2.0(发布于 2022 年 10 月),当前最新版本是 v24.30.0。由于是回退变更,请注意该版本可能不支持最新的 Chrome/Chromium 特性。建议在后续更新中考虑升级至较新版本。


59-59: 验证 Stencil 主版本降级的兼容性

@stencil/core 从 3.4.2 降级到 2.22.3 涉及主版本回退。请确保:

  • 代码不依赖 v3 特性(如 assetsDirs、dist-custom-elements、inputCapture 事件类型更新)
  • 配置文件与 v2 兼容(无 __deprecated__safari10、sourceMap 默认值差异)
  • 构建系统正常工作
  • 所有 Stencil 组件在 v2.22.3 环境下正常运行
packages/taro/package.json (1)

30-39: vite 依赖已安全移除

vite-runner 在自身的 package.json 中声明了 vite 为 devDependency(^4.2.0)和 peerDependency(^4),因此无需依赖 @tarojs/taro 中的 vite 版本。在 pnpm 工作区中,各个包会独立解析自身的依赖,vite-runner 的类型兼容性由其自身的 vite 声明保证。移除此依赖不会影响 vite-runner 的正常工作和类型解析。

packages/taro-router/src/tabbar.ts (1)

1-1: 桶导出路径正确

导入路径已正确更改为桶导出。defineCustomElementTaroTabbar 是由 Stencil 的 dist-custom-elements 编译输出生成的,在 @tarojs/components/dist/components 中被正确导出,与整个代码库中类似的导入模式(如 defineCustomElementTaroPullToRefreshCore)保持一致。

package.json (2)

34-34: LGTM!

测试脚本添加 --aggregate-output 标志可以改善输出格式,这是一个无害的改进。


112-112: Vitest 版本从 v4.0.14 降级到 v3.2.4 是安全的。仓库中的 vitest 配置不使用任何 v4 特定功能:

  • 无 coverage.all 配置(v4 中已移除)
  • 无 v4 特定的池配置变化(VITEST_MAX_WORKERS、maxWorkers)
  • 无 Module Runner 或 standalone 模式依赖
  • 所有配置使用基础的 provider: 'istanbul' + include 模式,与 v3.2.4 完全兼容

此降级不会导致任何配置破损。

Also applies to: 167-167

Likely an incorrect or invalid review comment.

packages/taro-components/src/components/input/input.tsx (1)

277-278: 验证 Composition 事件属性的大小写。

JSX 中的事件属性从 onCompositionStart/onCompositionEnd 改为 onCompositionstart/onCompositionend(小写)。

通常在 React/JSX 中,事件属性使用驼峰命名(camelCase),但 Stencil 可能有不同的约定。由于这是回退 Stencil 更新的 PR,请确认:

  1. 小写命名是旧版 Stencil 所需的格式吗?
  2. 事件处理是否能正常工作?

注意:addEventListener 使用的原生事件名(第 103-104 行)确实是小写的 compositionstart/compositionend,但 JSX 属性的命名可能不同。

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

25-27: Jest 配置和依赖验证完成,无需进一步调整。

测试脚本已成功迁移至 Jest,配置完整。验证结果:

  • jest.config.js 存在于包目录
  • 测试文件 (test/unique-transform.spec.js) 已就位
  • 所有三个测试脚本均正确配置 Jest 标志
  • Jest 依赖 (@types/jest ^29.5.0) 在根 package.json 中可用
  • 无遗留 vitest 配置文件

steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v5
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

确认 v5 继续获得维护和安全更新

v5 版本继续获得安全更新和主要破坏性变更的修复。v5.0.0 在 2024 年 8 月发布,v5.0.1 在 2024 年 11 月发布,表明该版本仍在主动维护中。

但需要注意:v6 存在与非 GitHub 平台自托管运行器的兼容性问题,因为 v6 使用硬编码的 GitHub Actions 路径,导致 Git 认证失败并造成工作流挂起和超时。对于自托管运行器,建议使用 v5,因为它采用通用 HTTP 授权标头方式,适用于所有平台。

如果项目使用 GitHub 托管的运行器,两个版本都可以工作。如果使用自托管或第三方运行器(Forgejo、Gitea 等),v5 实际上是更好的选择。建议确认此次降级的具体原因。

"test:ci": "vitest run --coverage",
"test:dev": "vitest",
"updateSnapshot": "vitest run --update"
"updateSnapshot": "vitest run --updateSnapshot"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Step 1: Find Vitest version in root package.json
echo "=== Checking Vitest version in root package.json ==="
cat package.json | grep -A5 '"vitest'

# Step 2: Check all snapshot update scripts in packages
echo -e "\n=== Searching for snapshot update scripts with --update flag ==="
rg -n 'vitest.*--update["\s]' packages/*/package.json

echo -e "\n=== Searching for snapshot update scripts with --updateSnapshot flag ==="
rg -n 'vitest.*--updateSnapshot' packages/*/package.json

# Step 3: Check the specific file mentioned in the review
echo -e "\n=== Content of packages/babel-plugin-transform-taroapi/package.json ==="
cat -n packages/babel-plugin-transform-taroapi/package.json | head -30

Repository: NervJS/taro

Length of output: 1544


🌐 Web query:

Vitest correct flag update snapshots --update vs --updateSnapshot

💡 Result:

Use --update (or -u). Vitest's official docs and config option are named update (CLI: -u / --update) to update snapshots; --updateSnapshot is not an official/recognized Vitest CLI flag. [1][2]

Sources:

  • Vitest snapshot guide (shows --update / -u). [1]
  • Vitest config reference (test.update option, CLI: -u / --update). [2]

--updateSnapshot 不是 Vitest 的有效标志,应改为 --update

根据 Vitest 官方文档,更新快照的正确标志是 --update-u--updateSnapshot 不是官方支持的标志。此外,存在包内不一致:packages/taro-rn-runner/package.json 使用了正确的 --update 标志,而该文件使用了无效的 --updateSnapshot。将第 15 行改为 "updateSnapshot": "vitest run --update"

🤖 Prompt for AI Agents
In packages/babel-plugin-transform-taroapi/package.json around line 15, the
"updateSnapshot" script uses the invalid Vitest flag "--updateSnapshot"; change
it to use the supported flag "--update" (or "-u") so the script becomes "vitest
run --update", matching other packages and restoring correct snapshot update
behavior.

this.handleBeforeInput = this.handleBeforeInput.bind(this)
this.isOnComposition = false
this.onInputExecuted = false
this.onInputExcuted = false
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

严重拼写错误:将正确的 "Executed" 改为错误的 "Excuted"

此变更将标识符从 onInputExecuted 重命名为 onInputExcuted,这是引入拼写错误而非修复错误:

  • ✅ "Executed" 是正确的英语拼写(表示"已执行")
  • ❌ "Excuted" 是拼写错误

虽然 AI 摘要提到这是为了"镜像核心输入实现中的相关重命名",但即使是为了保持一致性,也不应该传播拼写错误。

建议:

  1. 如果核心实现中也存在此拼写错误,应该在两处都修正为 onInputExecuted
  2. 这是一个内部标志,修复不会破坏公共 API
🔎 建议的修复方案
  constructor (props) {
    super(props)
    this.handleInput = this.handleInput.bind(this)
    this.handlePaste = this.handlePaste.bind(this)
    this.handleFocus = this.handleFocus.bind(this)
    this.handleBlur = this.handleBlur.bind(this)
    this.handleKeyDown = this.handleKeyDown.bind(this)
    this.handleComposition = this.handleComposition.bind(this)
    this.handleBeforeInput = this.handleBeforeInput.bind(this)
    this.isOnComposition = false
-   this.onInputExcuted = false
+   this.onInputExecuted = false
  }

  inputRef: HTMLInputElement
  isOnComposition: boolean
- onInputExcuted: boolean
+ onInputExecuted: boolean

以及所有其他使用处(93、96、118、125、137、162 行)都应相应修正。

#!/bin/bash
# 检查核心组件实现中是否也存在相同的拼写错误
rg -n "onInputExcuted|onInputExecuted" packages/taro-components/src/components/input/

# 在整个代码库中搜索这两个变体
rg -n "onInputExcuted" --type=ts --type=tsx
rg -n "onInputExecuted" --type=ts --type=tsx

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

🤖 Prompt for AI Agents
In packages/taro-components-react/src/components/input/index.tsx around lines
51,56,93,96,118,125,137,162 the identifier was misspelled as onInputExcuted;
rename every occurrence to onInputExecuted to fix the spelling, update all
internal references and assignments in this file accordingly, and run a
repo-wide search (including core package packages/taro-components) to find and
replace any other onInputExcuted usages so both implementations use the correct
onInputExecuted identifier.

private isOnComposition = false
private isOnPaste = false
private onInputExecuted = false
private onInputExcuted = false
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Find and examine the input.tsx file
find . -path "*/packages/taro-components/src/components/input/input.tsx" -type f

Repository: NervJS/taro

Length of output: 112


🏁 Script executed:

# Search for the misspelled field name to verify it exists
rg "onInputExcuted|onInputExecuted" --type ts --type tsx

Repository: NervJS/taro

Length of output: 82


🏁 Script executed:

# Search for the misspelled field name to verify it exists (corrected file type)
rg "onInputExcuted|onInputExecuted"

Repository: NervJS/taro

Length of output: 1385


🏁 Script executed:

# Check the input.tsx file structure and line numbers
cat -n packages/taro-components/src/components/input/input.tsx | head -250

Repository: NervJS/taro

Length of output: 8042


🏁 Script executed:

# Check git history to see if this is a revert
git log --oneline -20 -- packages/taro-components/src/components/input/input.tsx

Repository: NervJS/taro

Length of output: 129


🏁 Script executed:

# Get more detailed git history for this file
git log --oneline -50 -- packages/taro-components/src/components/input/input.tsx

Repository: NervJS/taro

Length of output: 129


🏁 Script executed:

# Check the current PR or branch context
git log --oneline -1

Repository: NervJS/taro

Length of output: 129


🏁 Script executed:

# Check if there's a recent commit that changed this field name
git log -p --follow -S "onInputExecuted" -- packages/taro-components/src/components/input/input.tsx | head -100

Repository: NervJS/taro

Length of output: 37


🏁 Script executed:

# Search for commits that mention the field name or spelling
git log --all --grep="onInputExecuted\|onInputExcuted\|Input" --oneline -- packages/taro-components/src/components/input/input.tsx

Repository: NervJS/taro

Length of output: 197


🏁 Script executed:

# Look at the recent changes to understand context better
git log --oneline --all -30 | head -30

Repository: NervJS/taro

Length of output: 1741


🏁 Script executed:

# Check git show for the file to see recent changes
git diff HEAD~10..HEAD -- packages/taro-components/src/components/input/input.tsx 2>/dev/null || echo "Not found in last 10 commits"

Repository: NervJS/taro

Length of output: 83


🏁 Script executed:

# Search for any recent changes that might have fixed the spelling
git log --all --oneline -100 | grep -i "input\|typo\|spell\|executed"

Repository: NervJS/taro

Length of output: 123


🏁 Script executed:

# Look at the actual differences across recent commits
git log --all -p -S "onInputExcuted" -- packages/taro-components/src/components/input/input.tsx | head -150

Repository: NervJS/taro

Length of output: 4405


修正拼写错误:onInputExcuted 应为 onInputExecuted

字段 onInputExcuted 拼写错误,"Excuted" 应为 "Executed"。此错误出现在多个位置(第 31、129、132、155、169、202 行)。虽然这是私有字段,不影响公开 API,但应修正代码拼写。

由于本次是回退提交,建议同时修复此拼写错误,或确认是否有特殊原因保留此错误。

🤖 Prompt for AI Agents
packages/taro-components/src/components/input/input.tsx lines
31,129,132,155,169,202: the private field name `onInputExcuted` is misspelled
and should be `onInputExecuted`; rename the field declaration and update all
references at the listed lines to `onInputExecuted`, keeping visibility and
behavior unchanged; search the file for any other occurrences (including
comments, handlers, and bindings) and update them consistently, then run type
checks/compile to ensure no remaining references break.

@Muyouz
Copy link
Copy Markdown
Contributor Author

Muyouz commented Dec 20, 2025

vite及stencil等关键关联库更新过于激进,未充分补充测试用例,目前对一些核心插件的编译和使用造成了严重影响,故先执行回退操作。

@coderabbitai coderabbitai Bot requested a review from yoyo837 January 8, 2026 03:18
Copy link
Copy Markdown

@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

🤖 Fix all issues with AI agents
In @.github/workflows/nodejs.yml:
- Around line 112-120: The test job currently conditionally skips some package
tests when matrix.host equals "macos-latest" by running a filtered pnpm command
(see the "test" step and the conditional checking matrix.host), which reduces
macOS coverage; update the workflow to stop excluding @tarojs/components on
macOS (remove the special-case filtered pnpm call) or make the macOS branch run
the same pnpm -r --aggregate-output command as other hosts, and add an
accompanying TODO->ISSUE: create a tracking issue documenting the macOS test
failures (include reproduction steps, failing packages, and impact) and add a CI
reminder (e.g., a comment or an automated periodic job) so this temporary
workaround is triaged and resolved promptly.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c481ac1 and 4e27eab.

📒 Files selected for processing (2)
  • .github/workflows/build-rust-binding.yml
  • .github/workflows/nodejs.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/build-rust-binding.yml
🧰 Additional context used
🧠 Learnings (2)
📚 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:

  • .github/workflows/nodejs.yml
📚 Learning: 2025-08-09T21:41:18.741Z
Learnt from: ianzone
Repo: NervJS/taro PR: 17842
File: .github/workflows/merged.yml:34-41
Timestamp: 2025-08-09T21:41:18.741Z
Learning: 在 NervJS/taro 项目中,merged.yml workflow 故意使用 actions/upload-artifact 而非 actions/cache/save 来保存公共 NX 缓存,因为 Artifact 具有更长的保留时间(最多 90 天),而 Actions Cache 仅保留 7 天。缓存键采用精确匹配策略,不使用 restore-keys 前缀匹配。

Applied to files:

  • .github/workflows/nodejs.yml
⏰ 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-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
🔇 Additional comments (3)
.github/workflows/nodejs.yml (3)

43-60: macOS 镜像更新合理。

macos-13 更新为 macos-latest 符合 commit 消息中提到的替换过期镜像的目的,确保 CI 使用当前稳定的 macOS 运行器。


66-66: actions/checkout@v5 的选择是合理的。

v6 针对 Docker 容器操作存在已知兼容性问题,且需要 runner 版本 >= v2.329.0 才能在容器中正常工作。由于该项目的工作流广泛使用 Docker 容器(如 dtolnay/rust-toolchain@stablepnpm/action-setup),保持使用 v5 是更安全的做法。如果后续升级到 v6,需要确保:

  1. 所有 runner 已升级至 v2.329.0 或更高版本
  2. 在 staging 环境充分测试 Docker 容器场景

77-77: 无需修改 - pnpm -r 标志在此上下文中是等效的且无害的。

根据 Taro 项目的 pnpm 工作区配置,pnpm install 在根目录执行时会自动启用递归安装(因为 recursiveInstall 默认为 true),所以 pnpm install --frozen-lockfilepnpm -r install --frozen-lockfile 在根目录是等效的。此外,-r 标志已在 .github/workflows/publish.yml:171 中使用,与本改动保持一致,不存在兼容性问题或依赖管理冲突。此更改是冗余但无害的,无需修改。

Likely an incorrect or invalid review comment.

Comment on lines 112 to +120
- name: test
run: pnpm run pretest:ci && pnpm test
#TODO: 需要优化测试流程,目前 macos 无法正常执行测试,暂时跳过,等待后续优化
shell: bash
run: |
if [ "${{ matrix.host }}" = "macos-latest" ]; then
pnpm -r --aggregate-output --filter=./packages/* --filter=./tests --filter=!@tarojs/components test:ci
else
pnpm test
fi
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

条件测试执行降低了 macOS 平台的测试覆盖率。

新增的条件测试流程在 macos-latest 上跳过了部分包(如 @tarojs/components)的测试,仅在其他平台执行完整测试。这存在以下风险:

  1. 平台特定 bug 可能被遗漏:被排除的包在 macOS 上的问题无法被及时发现
  2. 测试覆盖率下降:macOS 平台的可靠性保障减弱
  3. 技术债务:TODO 注释表明这是临时方案,但可能长期存在

建议:

  • 记录 macOS 测试失败的具体原因和影响范围
  • 创建跟踪 issue 来优先修复 macOS 测试问题
  • 考虑添加 CI 提醒,定期检查此临时方案的状态

您是否需要我帮助创建一个跟踪 issue 来记录 macOS 测试问题和后续优化计划?

🤖 Prompt for AI Agents
In @.github/workflows/nodejs.yml around lines 112 - 120, The test job currently
conditionally skips some package tests when matrix.host equals "macos-latest" by
running a filtered pnpm command (see the "test" step and the conditional
checking matrix.host), which reduces macOS coverage; update the workflow to stop
excluding @tarojs/components on macOS (remove the special-case filtered pnpm
call) or make the macOS branch run the same pnpm -r --aggregate-output command
as other hosts, and add an accompanying TODO->ISSUE: create a tracking issue
documenting the macOS test failures (include reproduction steps, failing
packages, and impact) and add a CI reminder (e.g., a comment or an automated
periodic job) so this temporary workaround is triaged and resolved promptly.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.33%. Comparing base (ef4a0b2) to head (4e27eab).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #18685      +/-   ##
==========================================
+ Coverage   52.63%   56.33%   +3.69%     
==========================================
  Files         463      447      -16     
  Lines       25108    23342    -1766     
  Branches     6629     5774     -855     
==========================================
- Hits        13215    13149      -66     
+ Misses       9726     8366    -1360     
+ Partials     2167     1827     -340     
Flag Coverage Δ
taro-cli 72.85% <ø> (ø)
taro-runtime 60.33% <ø> (ø)
taro-web 53.12% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 60 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.

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