feat: integrate DataForm component and useFormValidity hook, update w…#87
feat: integrate DataForm component and useFormValidity hook, update w…#87
Conversation
…ebpack config for module output
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 42 minutes and 56 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRe-exports WordPress DataForm component, hook, and related types to the public API; adds comprehensive Storybook stories demonstrating layouts and validation; updates styling variable names in DataViews CSS; removes Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
webpack.config.js (1)
24-35:⚠️ Potential issue | 🟠 MajorExternalize WordPress DataViews as well.
The new
DataFormexport imports@wordpress/dataviews/wp, but this externals map no longer excludes DataViews. That bundles WordPress DataViews into the library instead of using the consumer-provided WordPress package.Proposed externals update
externals: { react: 'react', 'react-dom': 'react-dom', 'react/jsx-runtime': 'react/jsx-runtime', '@wordpress/element': '@wordpress/element', '@wordpress/components': '@wordpress/components', + '@wordpress/dataviews': '@wordpress/dataviews', + '@wordpress/dataviews/wp': '@wordpress/dataviews/wp', '@wordpress/block-editor': '@wordpress/block-editor', '@wordpress/date': '@wordpress/date', '@wordpress/hooks': '@wordpress/hooks', '@wordpress/i18n': '@wordpress/i18n', quill: 'quill', },As per coding guidelines,
package.json: Ensure React, ReactDOM, and WordPress packages (@wordpress/components,@wordpress/dataviews,@wordpress/hooks,@wordpress/i18n,@wordpress/date) are externalized as they must be provided by consumers.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@webpack.config.js` around lines 24 - 35, The externals map is missing `@wordpress/dataviews` so the new DataForm (which imports '@wordpress/dataviews/wp') gets bundled; update the externals object (the externals key in webpack.config.js) to include '@wordpress/dataviews': '@wordpress/dataviews' alongside the existing WordPress packages (e.g., '@wordpress/components', '@wordpress/hooks', '@wordpress/i18n', '@wordpress/date') and ensure package.json peerDependencies list React, ReactDOM and these `@wordpress` packages so consumers provide them.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/ui/index.ts`:
- Around line 292-306: The UI barrel currently exports DataForm and
useFormValidity from '@wordpress/dataviews/wp' (symbols: DataForm,
useFormValidity in src/components/ui/index.ts) which introduces a WordPress API
dependency into the pure UI entrypoint; remove or relocate that export to a
WordPress-specific barrel/entrypoint (e.g., a new src/components/wp-ui/index.ts)
or alternatively update the allowed-exceptions list if you intend DataForm to be
a sanctioned UI exception—ensure the src/components/ui/index.ts only exports
non-WordPress UI modules and move the type re-exports for DataForm
(DataFormProps, DataFormSchema, DataFormField, etc.) out of this UI barrel as
well.
---
Outside diff comments:
In `@webpack.config.js`:
- Around line 24-35: The externals map is missing `@wordpress/dataviews` so the
new DataForm (which imports '@wordpress/dataviews/wp') gets bundled; update the
externals object (the externals key in webpack.config.js) to include
'@wordpress/dataviews': '@wordpress/dataviews' alongside the existing WordPress
packages (e.g., '@wordpress/components', '@wordpress/hooks', '@wordpress/i18n',
'@wordpress/date') and ensure package.json peerDependencies list React, ReactDOM
and these `@wordpress` packages so consumers provide them.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1c7149b7-9e5b-4998-80b9-090175e0aecc
📒 Files selected for processing (6)
.gitignorepackage.jsonsrc/components/ui/index.tssrc/components/wordpress/DataForm.stories.tsxsrc/index.tswebpack.config.js
…ebpack config for module output
Summary by CodeRabbit
New Features
Documentation
Style
Chores