-
Notifications
You must be signed in to change notification settings - Fork 33
Update data, core-data and editor WordPress packages #2540
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
Update data, core-data and editor WordPress packages #2540
Conversation
WalkthroughWalkthroughThe updates primarily involve upgrading the versions of several Changes
Assessment against linked issues
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 as PR comments)
Additionally, you can add CodeRabbit Configration 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: 2
Outside diff range and nitpick comments (1)
src/js/telemetry/block-change.tsx (1)
Line range hint
63-88: The addition of type annotations enhances type safety. Consider using an optional chain for theremovedBlockcheck to further improve code robustness.- if (removedBlock && removedBlock.name.startsWith(parselyBlockPrefix)) { + if (removedBlock?.name.startsWith(parselyBlockPrefix)) {
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files ignored due to path filters (5)
build/content-helper/editor-sidebar.asset.phpis excluded by!build/**build/content-helper/editor-sidebar.jsis excluded by!build/**build/content-helper/excerpt-generator.asset.phpis excluded by!build/**build/content-helper/excerpt-generator.jsis excluded by!build/**package-lock.jsonis excluded by!**/package-lock.json
Files selected for processing (10)
- package.json (1 hunks)
- src/@types/gutenberg/types.ts (2 hunks)
- src/content-helper/editor-sidebar/related-posts/component.tsx (1 hunks)
- src/content-helper/editor-sidebar/related-posts/hooks.ts (2 hunks)
- src/content-helper/editor-sidebar/smart-linking/component-block-overlay.tsx (3 hunks)
- src/content-helper/editor-sidebar/smart-linking/component.tsx (5 hunks)
- src/content-helper/editor-sidebar/title-suggestions/component-title-suggestion.tsx (3 hunks)
- src/content-helper/editor-sidebar/title-suggestions/component.tsx (3 hunks)
- src/content-helper/excerpt-generator/excerpt-generator.tsx (2 hunks)
- src/js/telemetry/block-change.tsx (3 hunks)
Files skipped from review due to trivial changes (1)
- package.json
Additional context used
Path-based instructions (9)
src/@types/gutenberg/types.ts (1)
Pattern
**/*.{js,ts,tsx,jsx}: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the code to ensure it is well-structured and adheres to best practices.
- Verify compliance with WordPress coding standards.
- Ensure the code is well-documented.
- Check for security vulnerabilities and confirm the code is secure.
- Optimize the code for performance, removing any unnecessary elements.
- Validate JSDoc comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Confirm every JSDoc comment includes a @SInCE tag indicating the next version of the plugin to include the code.
- Guarantee compatibility with the latest version of WordPress, avoiding deprecated functions or features."
src/content-helper/excerpt-generator/excerpt-generator.tsx (1)
Pattern
**/*.{js,ts,tsx,jsx}: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the code to ensure it is well-structured and adheres to best practices.
- Verify compliance with WordPress coding standards.
- Ensure the code is well-documented.
- Check for security vulnerabilities and confirm the code is secure.
- Optimize the code for performance, removing any unnecessary elements.
- Validate JSDoc comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Confirm every JSDoc comment includes a @SInCE tag indicating the next version of the plugin to include the code.
- Guarantee compatibility with the latest version of WordPress, avoiding deprecated functions or features."
src/content-helper/editor-sidebar/related-posts/hooks.ts (1)
Pattern
**/*.{js,ts,tsx,jsx}: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the code to ensure it is well-structured and adheres to best practices.
- Verify compliance with WordPress coding standards.
- Ensure the code is well-documented.
- Check for security vulnerabilities and confirm the code is secure.
- Optimize the code for performance, removing any unnecessary elements.
- Validate JSDoc comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Confirm every JSDoc comment includes a @SInCE tag indicating the next version of the plugin to include the code.
- Guarantee compatibility with the latest version of WordPress, avoiding deprecated functions or features."
src/js/telemetry/block-change.tsx (1)
Pattern
**/*.{js,ts,tsx,jsx}: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the code to ensure it is well-structured and adheres to best practices.
- Verify compliance with WordPress coding standards.
- Ensure the code is well-documented.
- Check for security vulnerabilities and confirm the code is secure.
- Optimize the code for performance, removing any unnecessary elements.
- Validate JSDoc comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Confirm every JSDoc comment includes a @SInCE tag indicating the next version of the plugin to include the code.
- Guarantee compatibility with the latest version of WordPress, avoiding deprecated functions or features."
src/content-helper/editor-sidebar/title-suggestions/component-title-suggestion.tsx (1)
Pattern
**/*.{js,ts,tsx,jsx}: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the code to ensure it is well-structured and adheres to best practices.
- Verify compliance with WordPress coding standards.
- Ensure the code is well-documented.
- Check for security vulnerabilities and confirm the code is secure.
- Optimize the code for performance, removing any unnecessary elements.
- Validate JSDoc comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Confirm every JSDoc comment includes a @SInCE tag indicating the next version of the plugin to include the code.
- Guarantee compatibility with the latest version of WordPress, avoiding deprecated functions or features."
src/content-helper/editor-sidebar/smart-linking/component-block-overlay.tsx (1)
Pattern
**/*.{js,ts,tsx,jsx}: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the code to ensure it is well-structured and adheres to best practices.
- Verify compliance with WordPress coding standards.
- Ensure the code is well-documented.
- Check for security vulnerabilities and confirm the code is secure.
- Optimize the code for performance, removing any unnecessary elements.
- Validate JSDoc comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Confirm every JSDoc comment includes a @SInCE tag indicating the next version of the plugin to include the code.
- Guarantee compatibility with the latest version of WordPress, avoiding deprecated functions or features."
src/content-helper/editor-sidebar/title-suggestions/component.tsx (1)
Pattern
**/*.{js,ts,tsx,jsx}: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the code to ensure it is well-structured and adheres to best practices.
- Verify compliance with WordPress coding standards.
- Ensure the code is well-documented.
- Check for security vulnerabilities and confirm the code is secure.
- Optimize the code for performance, removing any unnecessary elements.
- Validate JSDoc comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Confirm every JSDoc comment includes a @SInCE tag indicating the next version of the plugin to include the code.
- Guarantee compatibility with the latest version of WordPress, avoiding deprecated functions or features."
src/content-helper/editor-sidebar/related-posts/component.tsx (1)
Pattern
**/*.{js,ts,tsx,jsx}: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the code to ensure it is well-structured and adheres to best practices.
- Verify compliance with WordPress coding standards.
- Ensure the code is well-documented.
- Check for security vulnerabilities and confirm the code is secure.
- Optimize the code for performance, removing any unnecessary elements.
- Validate JSDoc comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Confirm every JSDoc comment includes a @SInCE tag indicating the next version of the plugin to include the code.
- Guarantee compatibility with the latest version of WordPress, avoiding deprecated functions or features."
src/content-helper/editor-sidebar/smart-linking/component.tsx (1)
Pattern
**/*.{js,ts,tsx,jsx}: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the code to ensure it is well-structured and adheres to best practices.
- Verify compliance with WordPress coding standards.
- Ensure the code is well-documented.
- Check for security vulnerabilities and confirm the code is secure.
- Optimize the code for performance, removing any unnecessary elements.
- Validate JSDoc comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Confirm every JSDoc comment includes a @SInCE tag indicating the next version of the plugin to include the code.
- Guarantee compatibility with the latest version of WordPress, avoiding deprecated functions or features."
Biome
src/js/telemetry/block-change.tsx
[error] 89-89: Change to an optional chain. (lint/complexity/useOptionalChain)
Unsafe fix: Change to an optional chain.
src/content-helper/editor-sidebar/smart-linking/component.tsx
[error] 435-435: Change to an optional chain. (lint/complexity/useOptionalChain)
Unsafe fix: Change to an optional chain.
Additional comments not posted (16)
src/@types/gutenberg/types.ts (4)
14-26: The additions to theGutenbergFunctioninterface align well with the PR's objectives to enhance TypeScript support.
35-36: The aliasdispatchCoreBlockEditoris well-defined and will help prevent intellisense errors.
42-42: The aliasdispatchCoreEditoris correctly implemented to simplify dispatch calls.
50-50: The aliasdispatchCoreEditPostis appropriately defined and will aid in preventing intellisense errors.src/content-helper/excerpt-generator/excerpt-generator.tsx (1)
53-53: The replacement ofdispatch('core/editor')withdispatchCoreEditPostis a good application of the new TypeScript aliases introduced in the PR.src/content-helper/editor-sidebar/related-posts/hooks.ts (1)
51-54: The use ofGutenbergFunctionfor theeditorvariable and its method calls correctly utilize the enhanced TypeScript definitions.src/content-helper/editor-sidebar/title-suggestions/component-title-suggestion.tsx (2)
25-25: Updated import to usedispatchCoreEditorfor better type safety and clarity.
167-167: Usage ofdispatchCoreEditor.editPostaligns with enhanced dispatch specificity and type safety.src/content-helper/editor-sidebar/smart-linking/component-block-overlay.tsx (2)
15-15: Updated import to usedispatchCoreBlockEditorfor better type safety and clarity.
75-75: Usage ofdispatchCoreBlockEditor.selectBlockaligns with enhanced dispatch specificity and type safety.src/content-helper/editor-sidebar/title-suggestions/component.tsx (2)
13-13: Updated import to usedispatchCoreEditorfor better type safety and clarity.
153-153: Usage ofdispatchCoreEditor.editPostaligns with enhanced dispatch specificity and type safety.Also applies to: 180-180
src/content-helper/editor-sidebar/related-posts/component.tsx (1)
138-145: Conditional logic for settingpostContenthandles test environments effectively by using a mock value.src/content-helper/editor-sidebar/smart-linking/component.tsx (3)
16-16: Update imports to use specific dispatch functions.This change aligns with the PR's objective to refine dispatch usage by utilizing specific module dispatch functions, enhancing clarity and maintainability.
604-604: Ensure proper locking mechanism for post saving.This change correctly implements the locking of post saving, which is crucial for preventing data loss or corruption during the editing process.
626-626: Ensure proper unlocking mechanism for post saving.This change correctly implements the unlocking of post saving, which is essential for resuming normal operations after edits are completed.
|
@coderabbitai resolve |
Actions performedComments resolved and changes approved. |
vaurdan
left a comment
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.
Thank you so much for working on this!
Description
Attempting to update
@wordpress/data,@wordpress/core-dataand@wordpress/editorto their latest versions has brought a handful of problems to our automated testing and builds. I consider these to be package typing issues, but it's unknown to us when these will be resolved.This PR updates the above dependencies through an
npm updateand implements workarounds for allowing tests to pass and builds to succeed.Motivation and context
How has this been tested?
Tests pass, builds succeed, and a quick manual test was conducted for affected PCH features.
Summary by CodeRabbit
New Features
editPost,lockPostSaving,removeEditorPanel,selectBlock,unlockPostSaving, andupdateBlockAttributes.Improvements
RelatedPostsPanelto conditionally set post content for testing environments.usePostDatafunction to directly usecore/editorfor accessing post attributes.SmartLinkingPanelandTitleSuggestionsPanelcomponents with more specific dispatch calls and restructured imports.Bug Fixes
@wordpresspackages.Chores
@wordpress/core-data,@wordpress/data, and@wordpress/editorpackages for better performance and security.