-
Notifications
You must be signed in to change notification settings - Fork 4.9k
fix: 一些杂项 #18025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: 一些杂项 #18025
Conversation
Walkthrough本次变更主要涉及参数和类型命名规范化(如将 Changes
Sequence Diagram(s)sequenceDiagram
participant 调用方
participant TaroAPI
调用方->>TaroAPI: interceptorify(promisifyApi)
TaroAPI-->>调用方: 返回 Interceptorify 实例
Estimated code review effort3 (30–60 minutes) Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 允许类型和值空间同名,但对阅读者不够直观,建议给形参换个更能区分的名字(如api或fn),减少认知负担。-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
⛔ Files ignored due to path filters (1)
packages/eslint-plugin-taro/yarn.lockis 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 ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
清理无效文件,更正拼写错误
Summary by CodeRabbit
文档
样式
重构