-
Notifications
You must be signed in to change notification settings - Fork 273
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(form): replace with Taro Form and add the rest property for passt… #3016
Conversation
""" Walkthrough本次变更涉及多个文件。主要调整包括在 Changes
Sequence Diagram(s)sequenceDiagram
participant U as 用户
participant F as TForm组件
participant H as 事件处理器
U->>F: 提交表单数据
F->>H: 触发表单提交事件
H-->>F: 返回处理结果
F-->>U: 显示提交反馈
Possibly related PRs
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
packages/nutui-taro-demo/src/pages/index/index.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "taro/react" to extend from. Please check that the name of the config is correct. The config "taro/react" was referenced from the config file in "/packages/nutui-taro-demo/.eslintrc". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. 📜 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 (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feat_v3.x #3016 +/- ##
=============================================
+ Coverage 85.75% 85.79% +0.04%
=============================================
Files 281 281
Lines 18527 18527
Branches 2809 2810 +1
=============================================
+ Hits 15887 15896 +9
+ Misses 2635 2626 -9
Partials 5 5 ☔ View full report in Codecov by Sentry. |
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)
src/packages/form/form.taro.tsx (2)
10-10
: 继承自TFormProps
以对接 Taro 表单属性
此变更使自定义表单组件与 Taro 框架更加契合,但需留意自定义属性与 Taro 自带属性是否存在重名或冲突。
82-83
: 将原生<form>
替换为<TForm>
利用 Taro 原生组件可更好实现多端兼容,且仍保留对 onSubmit、onReset 等表单事件的支持。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
package.json
(2 hunks)packages/nutui-taro-demo/src/pages/index/index.tsx
(1 hunks)scripts/harmony/update-taro-entry.js
(0 hunks)src/packages/form/form.taro.tsx
(4 hunks)
💤 Files with no reviewable changes (1)
- scripts/harmony/update-taro-entry.js
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: build
- GitHub Check: test
🔇 Additional comments (6)
packages/nutui-taro-demo/src/pages/index/index.tsx (1)
84-84
: 从条件中移除com.dd
判断项后,请确认是否影响组件的筛选逻辑
如果com.dd
曾用于标识特殊组件,而此变更明确表示已不再需要该标识,则此更新可简化逻辑。若未来仍需区分这些组件,需确保具备新的标识或其它处理方式。package.json (1)
60-60
: 移除SKIPDD=1
环境变量对脚本流程的潜在影响
在多个脚本命令中去除了SKIPDD=1
,可能导致脚本执行时跳过特定步骤的逻辑发生变化。请确认彻底不再需要此变量来规避特定流程,或考虑为相关用途提供新的可控方案。Also applies to: 63-63, 73-73
src/packages/form/form.taro.tsx (4)
3-3
: 改为从 Taro 引入表单相关接口
通过import { Form as TForm, FormProps as TFormProps } from '@tarojs/components'
,可充分发挥 Taro 自带组件及其特性的优势。
6-6
: 引入ComponentDefaults
请确认ComponentDefaults
中的属性与TFormProps
不会产生冲突,以免覆盖或混淆同名属性。
52-52
: 通过...rest
透传剩余属性
这样能够保留更高的灵活度,允许外部传入更多 Taro 支持的属性。若有关键属性需特殊处理,需主动拦截管理。
107-107
: 闭合<TForm>
标签
与上方<TForm>
匹配,在多端编译环境中务必确认可稳定渲染完毕并正确处理事件。
Summary by CodeRabbit
Chores
Refactor
New Features