-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 misc type compilation errors in editor and block editor packages #67410
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,10 @@ import { GLOBAL_POST_TYPES } from '../../store/constants'; | |
/** | ||
* Wrapper component that renders its children only if the post can trashed. | ||
* | ||
* @param {Object} props - The component props. | ||
* @param {React.ReactEl} props.children - The child components to render. | ||
* @param {Object} props - The component props. | ||
* @param {React.ReactNode} props.children - The child components to render. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was probably a typo. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't have the whole context around these changes, but do we actually need Just asking in case the right choice here was If we go for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure, but I'm sure ReactElement is a good substitute here 👍🏻 I'll do a follow up. |
||
* | ||
* @return {React.ReactElement} The rendered child components or null if the post can not trashed. | ||
* @return {React.ReactNode} The rendered child components or null if the post can not trashed. | ||
*/ | ||
export default function PostTrashCheck( { children } ) { | ||
const { canTrashPost } = useSelect( ( select ) => { | ||
|
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.
@ciampo
The
WPCompleter
type is being used in block-editor/autocompleters three times, e.g.,gutenberg/packages/block-editor/src/autocompleters/link.js
Line 13 in 8e42a74
/** @typedef {import('@wordpress/components').WPCompleter} WPCompleter */
I was wondering whether files that import the type should be doing it at all?
In which case the JS Docs in
block-editor/autocompleters
could be updated and this export removed.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.
Hey Ramon, thank you for the ping! For future instances, using the @WordPress/gutenberg-components group handle may be better in case one of us can't reply straight away (that was me last week 😅 )
In general, we haven't really exported types from the package, so my first instinct would be to revert this change, and then consider the best course of action — which is to probably fix those type imports across Gutenberg
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.
Will do, thank you!
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.
Revert/update PR: