-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
chore: disable the default form configuration of vke-table #4794
Conversation
|
WalkthroughThe changes introduce a new Changes
Possibly related PRs
Suggested labels
Suggested reviewers
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 (
|
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
🧹 Outside diff range and nitpick comments (3)
apps/web-antd/src/adapter/vxe-table.ts (1)
19-22
: Consider translating the comment to English for better maintainability.The configuration change looks good and achieves the objective of globally disabling vxe-table's form configuration. However, for better international collaboration, consider translating the Chinese comment to English.
formConfig: { - // 全局禁用vxe-table的表单配置,使用formOptions + // Globally disable vxe-table's form configuration, use formOptions instead enabled: false, },playground/src/adapter/vxe-table.ts (1)
19-22
: Consider translating the Chinese comment to English for better maintainability.The implementation looks good, but for consistency with the codebase and better maintainability, consider translating the comment to English.
- // 全局禁用vxe-table的表单配置,使用formOptions + // Globally disable vxe-table's form configuration, use formOptions insteadpackages/effects/plugins/src/vxe-table/use-vxe-grid.vue (1)
223-225
: LGTM! Consider enhancing the warning message.The added comments effectively explain the edge case with multiple table instances. This supports the PR's objective of globally disabling vxe-table's default form configuration.
Consider enhancing the warning message to be more specific about why formConfig is not supported:
console.warn( - '[Vben Vxe Table]: The formConfig in the grid is not supported, please use the `formOptions` props', + '[Vben Vxe Table]: The formConfig in the grid is not supported as form handling is managed by vben-form. Please use the `formOptions` props instead.', );
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (5)
apps/web-antd/src/adapter/vxe-table.ts
(1 hunks)apps/web-ele/src/adapter/vxe-table.ts
(1 hunks)apps/web-naive/src/adapter/vxe-table.ts
(1 hunks)packages/effects/plugins/src/vxe-table/use-vxe-grid.vue
(1 hunks)playground/src/adapter/vxe-table.ts
(1 hunks)
🔇 Additional comments (4)
apps/web-antd/src/adapter/vxe-table.ts (1)
19-22
: Verify impact on existing vxe-table form usage.
Since this change globally disables vxe-table's form configuration, we should verify that all existing form implementations are using formOptions
instead.
✅ Verification successful
Let me check the actual usage patterns to verify if the configuration is consistently applied and if there are any potential issues.
This will help us verify:
- If the formConfig disabled setting is consistent across all web apps
- How formOptions is actually implemented in the core plugins package
Let me check the adapter files with the correct path pattern and look for any actual form implementations in the playground to ensure completeness.
Let me try one final verification with the exact paths we found earlier:
Configuration change is properly implemented and safe
The verification shows that:
- All web apps (antd, ele, naive) consistently disable vxe-table's form configuration
- The core package properly handles this by:
- Providing
formOptions
as the supported alternative - Warning users when they try to use the deprecated
formConfig
- Providing
- Example implementation in playground correctly uses
formOptions
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for potential vxe-table form usage that might be affected by this change
echo "Checking for vxe-table form usage patterns..."
# Look for direct vxe-table form configurations
rg -l "vxe-form"
# Look for form-related props in vxe-grid usage
rg -l "formConfig|form-config"
# Look for formOptions usage to ensure the alternative is in place
rg -l "formOptions|form-options"
Length of output: 746
Script:
#!/bin/bash
# Check the formConfig settings in all adapter files
echo "Checking formConfig settings in adapter files:"
rg -A 3 "formConfig" "apps/web-*/src/adapter/vxe-table.ts"
echo -e "\nChecking actual form usage patterns:"
# Look for actual form implementations
rg -B 2 -A 2 "formOptions" "packages/effects/plugins/src/vxe-table/"
Length of output: 3544
Script:
#!/bin/bash
# Check formConfig in adapter files with correct path
echo "Checking formConfig settings in adapter files:"
rg -A 3 "formConfig" "apps/{web-antd,web-ele,web-naive}/src/adapter/vxe-table.ts"
echo -e "\nChecking form implementations in playground:"
rg -B 2 -A 2 "vxe-form|formConfig|formOptions" "playground/src/views/examples/vxe-table/form.vue"
Length of output: 635
Script:
#!/bin/bash
# Check formConfig in all adapter files using exact paths
echo "Checking formConfig in web-antd adapter:"
rg -A 3 "formConfig" "apps/web-antd/src/adapter/vxe-table.ts"
echo -e "\nChecking formConfig in web-ele adapter:"
rg -A 3 "formConfig" "apps/web-ele/src/adapter/vxe-table.ts"
echo -e "\nChecking formConfig in web-naive adapter:"
rg -A 3 "formConfig" "apps/web-naive/src/adapter/vxe-table.ts"
Length of output: 779
playground/src/adapter/vxe-table.ts (1)
19-22
: Verify consistent implementation across related files.
The implementation looks correct. Let's verify that this change is consistently implemented across all related files mentioned in the summary.
✅ Verification successful
Implementation is consistent across all adapter files
The formConfig implementation with enabled: false
is consistently implemented across all vxe-table adapter files:
- playground/src/adapter/vxe-table.ts
- apps/web-naive/src/adapter/vxe-table.ts
- apps/web-ele/src/adapter/vxe-table.ts
- apps/web-antd/src/adapter/vxe-table.ts
All files have identical configuration and comments, indicating proper synchronization across the codebase.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify consistent formConfig implementation across related files
# Expected: All files should have the same formConfig structure with enabled: false
# Search for formConfig implementation in related files
rg -U "formConfig.*?\{.*?enabled: false.*?\}" \
--type ts \
--glob "apps/web-*/src/adapter/vxe-table.ts"
Length of output: 102
Script:
#!/bin/bash
# Let's try a broader search to find any vxe-table adapter files and their formConfig implementations
# First, find all vxe-table adapter files
fd "vxe-table.ts" --type f
# Then search for formConfig patterns in these files
rg -U "formConfig" --type ts
Length of output: 495
Script:
#!/bin/bash
# Let's examine the formConfig implementation in each adapter file
echo "=== playground/src/adapter/vxe-table.ts ==="
rg -U "formConfig:.*?\{.*?\}" -A 2 playground/src/adapter/vxe-table.ts
echo -e "\n=== apps/web-naive/src/adapter/vxe-table.ts ==="
rg -U "formConfig:.*?\{.*?\}" -A 2 apps/web-naive/src/adapter/vxe-table.ts
echo -e "\n=== apps/web-ele/src/adapter/vxe-table.ts ==="
rg -U "formConfig:.*?\{.*?\}" -A 2 apps/web-ele/src/adapter/vxe-table.ts
echo -e "\n=== apps/web-antd/src/adapter/vxe-table.ts ==="
rg -U "formConfig:.*?\{.*?\}" -A 2 apps/web-antd/src/adapter/vxe-table.ts
Length of output: 724
Script:
#!/bin/bash
# Let's try a different approach with simpler pattern matching and more context
echo "=== playground/src/adapter/vxe-table.ts ==="
rg "formConfig" -B 2 -A 4 playground/src/adapter/vxe-table.ts
echo -e "\n=== apps/web-naive/src/adapter/vxe-table.ts ==="
rg "formConfig" -B 2 -A 4 apps/web-naive/src/adapter/vxe-table.ts
echo -e "\n=== apps/web-ele/src/adapter/vxe-table.ts ==="
rg "formConfig" -B 2 -A 4 apps/web-ele/src/adapter/vxe-table.ts
echo -e "\n=== apps/web-antd/src/adapter/vxe-table.ts ==="
rg "formConfig" -B 2 -A 4 apps/web-antd/src/adapter/vxe-table.ts
Length of output: 1310
apps/web-naive/src/adapter/vxe-table.ts (1)
19-22
: Breaking Change: Verify impact of disabling vxe-table's form configuration.
The implementation correctly disables the default form configuration as intended, and the comment clearly explains the purpose. However, this is a breaking change that could affect existing implementations.
Let's verify the impact across the codebase:
Consider adding:
- Migration guide in the PR description
- Warning comment about the breaking nature of this change
apps/web-ele/src/adapter/vxe-table.ts (1)
19-22
: LGTM! Consider translating the comment to English.
The addition of formConfig
with enabled: false
correctly implements the PR objective to globally disable vxe-table's default form configuration.
Consider translating the Chinese comment to English for consistency:
- // 全局禁用vxe-table的表单配置,使用formOptions
+ // Globally disable vxe-table form configuration, use formOptions instead
Let's verify the impact of this change:
✅ Verification successful
The formConfig change is consistent across all apps and properly handled
The verification shows that:
- The same formConfig change (enabled: false) is consistently applied across all app adapters:
- apps/web-ele/src/adapter/vxe-table.ts
- apps/web-naive/src/adapter/vxe-table.ts
- apps/web-antd/src/adapter/vxe-table.ts
- playground/src/adapter/vxe-table.ts
- The packages/effects/plugins/src/vxe-table/use-vxe-grid.vue component already handles this configuration by:
- Enforcing formConfig.enabled = false
- Warning users when they try to use formConfig instead of formOptions
- Providing proper fallback to vben-form
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for any direct usage of vxe-table form configuration that might be affected by this change
# Search for form-related configurations in vue files
rg -t vue "formConfig|form-config" -A 5
# Search for potential form-related imports or configurations
ast-grep --pattern 'import { $_ } from "vxe-table"'
Length of output: 123
Script:
#!/bin/bash
# Let's try a broader search without file type restrictions
# Search for form-related configurations
rg "formConfig|form-config" -A 5
# Search for vxe-table imports and usage
rg "from ['|\"]vxe-table" -A 2
# Search for potential form configurations in .vue, .ts, and .js files
fd -e vue -e ts -e js --exec grep -l "formConfig\|form-config" {} \;
# Look for vxe-table configuration files
fd -g "*vxe*.{ts,js,vue}"
Length of output: 5575
* fix: 处理某个页面加载多个Table时,第2个之后的Table初始化报出警告 * fix: 使用vxe-table时全局禁用formConfig
Description
Type of change
Please delete options that are not relevant.
pnpm-lock.yaml
unless you introduce a new test example.Checklist
pnpm run docs:dev
command.pnpm test
.feat:
,fix:
,perf:
,docs:
, orchore:
.Summary by CodeRabbit
New Features
formConfig
option in the grid configuration, allowing for enhanced control over form handling invxe-table
.formOptions
.Bug Fixes
Documentation