-
Notifications
You must be signed in to change notification settings - Fork 798
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 @wordpress/editor and remove @types/wordpress__editor #40291
Conversation
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Follow this PR Review Process:
Still unsure? Reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
<PostTypeSupportCheck supportKeys="excerpt"> | ||
<PluginDocumentSettingPanel | ||
className={ isBetaExtension( 'ai-content-lens' ) ? 'is-beta-extension inset-shadow' : '' } | ||
name="ai-content-lens-plugin" | ||
title={ __( 'Excerpt', 'jetpack' ) } | ||
> | ||
<AiPostExcerpt /> | ||
</PluginDocumentSettingPanel> | ||
</PostTypeSupportCheck> | ||
<PostTypeSupportCheck | ||
supportKeys="excerpt" | ||
// @ts-expect-error Types for PostTypeSupportCheck children are not correct. It's `Element` instead of `ReactElement`. | ||
children={ | ||
<PluginDocumentSettingPanel | ||
className={ isBetaExtension( 'ai-content-lens' ) ? 'is-beta-extension inset-shadow' : '' } | ||
name="ai-content-lens-plugin" | ||
title={ __( 'Excerpt', 'jetpack' ) } | ||
> | ||
<AiPostExcerpt /> | ||
</PluginDocumentSettingPanel> | ||
} | ||
/> | ||
); |
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.
There are many such issues in various components from @wordpress/editor
package. I have created a PR in Gutenberg to fix those - WordPress/gutenberg#67196
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.
Is the switch here from <Parent><Child/></Parent>
syntax to <Parent children={ <Child /> } />
just to give it a place to add the @ts-expect-error
comment, or is there a greater significance?
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.
Is the switch here from
<Parent><Child/></Parent>
syntax to<Parent children={ <Child /> } />
just to give it a place to add the@ts-expect-error
comment
Yes, that is correct. There is no other reason.
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.
Nice, glad to get rid of the @types/
package. One more and we can lose the hack for their outdated deps too.
<PostTypeSupportCheck supportKeys="excerpt"> | ||
<PluginDocumentSettingPanel | ||
className={ isBetaExtension( 'ai-content-lens' ) ? 'is-beta-extension inset-shadow' : '' } | ||
name="ai-content-lens-plugin" | ||
title={ __( 'Excerpt', 'jetpack' ) } | ||
> | ||
<AiPostExcerpt /> | ||
</PluginDocumentSettingPanel> | ||
</PostTypeSupportCheck> | ||
<PostTypeSupportCheck | ||
supportKeys="excerpt" | ||
// @ts-expect-error Types for PostTypeSupportCheck children are not correct. It's `Element` instead of `ReactElement`. | ||
children={ | ||
<PluginDocumentSettingPanel | ||
className={ isBetaExtension( 'ai-content-lens' ) ? 'is-beta-extension inset-shadow' : '' } | ||
name="ai-content-lens-plugin" | ||
title={ __( 'Excerpt', 'jetpack' ) } | ||
> | ||
<AiPostExcerpt /> | ||
</PluginDocumentSettingPanel> | ||
} | ||
/> | ||
); |
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.
Is the switch here from <Parent><Child/></Parent>
syntax to <Parent children={ <Child /> } />
just to give it a place to add the @ts-expect-error
comment, or is there a greater significance?
Following the PR I created in Gutenberg (Fix TS types for editor package), we no longer need buggy assertions in TS code.
Proposed changes:
@wordpress/editor
to the latest version@types/wordpress__editor
which is no longer neededOther information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
What is next?
Following this PR we should replace the string selector (
'core/editor'
) withstore
from@wordpress/editor
to ensure that the types work correctly. For example, inprojects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/ai-image/featured-image.tsx
.CC: @Automattic/jetpack-agora