Skip to content

Conversation

@ianzone
Copy link
Contributor

@ianzone ianzone commented Jul 17, 2025

清理无效文件,更正拼写错误

Summary by CodeRabbit

  • 文档

    • 删除了部分包的变更日志文件,移除了历史更新记录。
    • 修正了部分文档和注释中的参数命名及拼写,使其与实际代码保持一致,提高了可读性。
  • 样式

    • 统一了参数命名风格(如 reactdom → reactDOM),提升代码一致性。
  • 重构

    • 对部分公开 API 的参数和类型命名进行了规范化调整,不影响实际功能。
    • 修正了注释中的拼写错误,提升文档清晰度。

@coderabbitai
Copy link

coderabbitai bot commented Jul 17, 2025

Walkthrough

本次变更主要涉及参数和类型命名规范化(如将 reactdom 统一为 reactDOMpromiseifyApi 统一为 promisifyApi),修正注释拼写错误,以及删除了部分包的变更日志文件。代码逻辑未发生实质性变更,仅做了风格和文档上的一致性调整。

Changes

文件/分组 变更摘要
.../eslint-plugin-taro/CHANGELOG.md
.../taro-components/CHANGELOG.md
删除了变更日志(changelog)文件,移除历史变更记录。
.../shared/src/shortcuts.ts 修正注释拼写错误:“Attrtibutes” 改为 “Attributes”。
.../taro-api/src/interceptor/index.ts
.../taro/types/api/taro.extend.d.ts
参数及类型命名由 promiseifyApi 统一为 promisifyApi,相关接口同步调整。
.../taro-framework-react/src/runtime/connect-native.ts
.../taro-platform-harmony-cpp/src/runtime/framework/native-page.ts
.../taro-platform-harmony/src/runtime-framework/react/native-page.ts
.../taro-router/README.md
统一参数命名为 reactDOM,包括函数签名、内部变量及文档描述。

Sequence Diagram(s)

sequenceDiagram
    participant 调用方
    participant TaroAPI
    调用方->>TaroAPI: interceptorify(promisifyApi)
    TaroAPI-->>调用方: 返回 Interceptorify 实例
Loading

Estimated code review effort

3 (30–60 minutes)

Poem

🐇
变量名如风吹柳,
reactDOM 一致走。
拼写修正无烦忧,
changelog 说再见,
代码整洁心悠悠!
🌱


📜 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 f8f4c52 and f63bf61.

📒 Files selected for processing (1)
  • packages/taro-platform-harmony/src/runtime-framework/react/native-page.ts (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/taro-platform-harmony/src/runtime-framework/react/native-page.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 - x86_64-unknown-linux-musl
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • 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 WASM / stable - wasm32-wasi
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai bot requested review from tutuxxx and yoyo837 July 17, 2025 14:21
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/types/api/taro.extend.d.ts (2)

176-180: JSDoc 描述仍使用旧拼写 promiseify

注释第 177 行 “包裹 promiseify api 的洋葱圈模型” 中的 “promiseify” 未同步更新为 “promisify”,与实际参数名不一致,容易误导使用者。

- * 包裹 promiseify api 的洋葱圈模型
+ * 包裹 promisify api 的洋葱圈模型

231-231: 类型别名与形参同名可能产生阅读歧义

interceptorify<T, R>(promisifyApi: interceptorify.promisifyApi<T, R>) 的形参与命名空间中的类型别名同名。虽然 TS 允许类型和值空间同名,但对阅读者不够直观,建议给形参换个更能区分的名字(如 apifn),减少认知负担。

-interceptorify<T, R>(promisifyApi: interceptorify.promisifyApi<T, R>): interceptorify.Interceptorify<T, R>
+interceptorify<T, R>(api: interceptorify.promisifyApi<T, R>): interceptorify.Interceptorify<T, R>
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7642ca8 and b14e5cd.

⛔ Files ignored due to path filters (1)
  • packages/eslint-plugin-taro/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (9)
  • packages/eslint-plugin-taro/CHANGELOG.md (0 hunks)
  • packages/shared/src/shortcuts.ts (1 hunks)
  • packages/taro-api/src/interceptor/index.ts (1 hunks)
  • packages/taro-components/CHANGELOG.md (0 hunks)
  • packages/taro-framework-react/src/runtime/connect-native.ts (1 hunks)
  • packages/taro-platform-harmony-cpp/src/runtime/framework/native-page.ts (1 hunks)
  • packages/taro-platform-harmony/src/runtime-framework/react/native-page.ts (5 hunks)
  • packages/taro-router/README.md (2 hunks)
  • packages/taro/types/api/taro.extend.d.ts (3 hunks)
💤 Files with no reviewable changes (2)
  • packages/taro-components/CHANGELOG.md
  • packages/eslint-plugin-taro/CHANGELOG.md
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: ianzone
PR: NervJS/taro#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 文件。
packages/taro-router/README.md (1)
Learnt from: ianzone
PR: NervJS/taro#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 文件。
packages/taro-platform-harmony-cpp/src/runtime/framework/native-page.ts (1)
Learnt from: ianzone
PR: NervJS/taro#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 文件。
packages/taro-platform-harmony/src/runtime-framework/react/native-page.ts (1)
Learnt from: ianzone
PR: NervJS/taro#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 文件。
packages/taro-framework-react/src/runtime/connect-native.ts (1)
Learnt from: ianzone
PR: NervJS/taro#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 文件。
🧬 Code Graph Analysis (1)
packages/taro-platform-harmony/src/runtime-framework/react/native-page.ts (1)
packages/taro-framework-react/src/runtime/react-meta.ts (1)
  • reactMeta (10-13)
⏰ 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 - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-musl
  • 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 (18)
packages/shared/src/shortcuts.ts (1)

9-9: 注释拼写修正无误,感谢清理
纯注释变动,不影响功能。

packages/taro-api/src/interceptor/index.ts (1)

34-36: 一致性验证通过:已完成拼写更正

已使用 rg 工具检查,全量代码库中不存在旧的 promiseifyApi 拼写,所有相关位置均已统一为 promisifyApi

packages/taro-router/README.md (2)

7-7: 文档更新:参数名称标准化

将文档中的参数名从 reactdom 更新为 reactDOM,遵循 camelCase 命名约定。


29-29: 文档更新:参数描述标准化

参数描述部分也相应更新为 reactDOM,与函数签名保持一致。

packages/taro-platform-harmony-cpp/src/runtime/framework/native-page.ts (2)

449-449: 参数命名标准化

reactdom 参数重命名为 reactDOM,遵循 camelCase 命名约定,与其他平台实现保持一致。


454-454: 变量赋值更新

相应更新 ReactDOM 变量赋值以使用新的参数名。

packages/taro-framework-react/src/runtime/connect-native.ts (4)

348-348: 参数命名标准化

createH5NativeComponentConfig 函数中将 reactdom 参数重命名为 reactDOM,遵循 camelCase 命名约定。


352-352: 变量赋值更新

相应更新 ReactDOM 变量赋值以使用新的参数名。


358-358: 参数命名标准化

createNativeComponentConfig 函数中将 reactdom 参数重命名为 reactDOM,保持命名一致性。


361-361: 变量赋值更新

相应更新 ReactDOM 变量赋值以使用新的参数名。

packages/taro-platform-harmony/src/runtime-framework/react/native-page.ts (7)

29-29: 注释格式优化

改进注释格式,在标点符号后添加空格以提高可读性。


323-323: 注释格式优化

改进注释格式,在 "onUnload" 前后添加空格以提高可读性。


384-384: 注释格式优化

改进注释格式,在 "Current" 前后添加空格以提高可读性。


421-421: 参数命名标准化

reactdom 参数重命名为 reactDOM,遵循 camelCase 命名约定,与其他平台实现保持一致。


426-426: 变量赋值更新

相应更新 ReactDOM 变量赋值以使用新的参数名。


445-445: 类型安全改进

显式调用 toString() 确保 compId 作为字符串传递,提高类型安全性。


448-448: 类型安全改进

document.getElementById() 调用中显式转换 compId 为字符串,确保类型一致性。

packages/taro/types/api/taro.extend.d.ts (1)

55-59: 命名统一 👍

promiseifyApi 统一更正为 promisifyApi,并同步更新了 proceed 的类型引用,类型声明保持一致,符合语义,没发现问题。

@codecov
Copy link

codecov bot commented Jul 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.99%. Comparing base (7642ca8) to head (f63bf61).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #18025   +/-   ##
=======================================
  Coverage   54.99%   54.99%           
=======================================
  Files         417      417           
  Lines       21696    21696           
  Branches     5358     5334   -24     
=======================================
  Hits        11931    11931           
- Misses       8090     8094    +4     
+ Partials     1675     1671    -4     
Flag Coverage Δ
taro-cli 72.56% <ø> (ø)
taro-runtime 59.87% <ø> (ø)
taro-web 53.19% <ø> (ø)

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

Files with missing lines Coverage Δ
packages/taro-api/src/interceptor/index.ts 100.00% <100.00%> (ø)

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

@ianzone ianzone mentioned this pull request Jul 18, 2025
1 task
This was referenced Jul 19, 2025
@ianzone ianzone requested a review from yoyo837 July 21, 2025 13:23
@yoyo837 yoyo837 merged commit b1e8dc9 into NervJS:main Jul 22, 2025
24 checks passed
@ianzone ianzone deleted the misc branch July 22, 2025 07:01
This was referenced Jul 26, 2025
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