-
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
EditorRegions: Move to block-editor package, rename to __experimentalEditorSkeleton #20050
EditorRegions: Move to block-editor package, rename to __experimentalEditorSkeleton #20050
Conversation
@youknowriad is your friend, he has a better idea of why this component is in |
{ !! header && ( | ||
<div | ||
className="edit-post-editor-regions__header" | ||
className="components-editor-regions__header edit-post-editor-regions__header" | ||
role="region" | ||
/* translators: accessibility text for the top bar landmark region. */ | ||
aria-label={ __( 'Editor top bar' ) } |
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.
I was wondering whether the aria-label are too opinionated and should be made customizable or not. Potentially, they couuld work for any "editor".
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.
Yeah, maybe 🤔 I'd go with YAGNI here -- don't make it customizable until needed?
I moved the component to the |
className={ classnames( | ||
className, | ||
'block-editor-editor-skeleton', | ||
'edit-post-editor-regions' |
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.
I think we can drop this className tbh. Did you leave it for BC? This seems to be ready to land before beta1 so there shouldn't be any problem to remove the classname.
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.
Yeah, I left it in for backwards compat. I know of at least one instance in Calypso where we're referring to this class name, and since we were having quite some trouble with class name changes in the past (specifically with the .editor-
-> .block-editor-
change, see Automattic/wp-calypso#38857, #14420, and #19050), I wanted at least to give a grace period before dropping the old class name.
(Then again, a point can be made that this was never part of a public interface, and that that grace period didn't help in updating the affected Calypso selectors in time before they were dropped in the past either, so 🤷♂️ )
Whatever you think is best, that said, I think it's important to validate that this component is generic enough to be shared properly. |
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.
Thanks 👍
I'll file a follow-up; if there are any changes needed to |
you can merge since it's approved. I figured you might be waiting for me? |
Thanks for merging! I was considering dropping the BC stuff we discussed here as part of this PR but didn't get to that on Friday 😅 |
* Update `@wordpress/*` dependencies * Add externalized dependencies to FSE package.json * Update z-index classname WordPress/gutenberg#20050 * Add webpack alias to deduplicate `@wordpress/data` * Remove selected block outlines Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com> Co-authored-by: Jon Surrell <jon.surrell@automattic.com>
Description
Move the
EditorRegions
component frompackages/post-editor
topackages/block-editor
, and rename to__experimentalEditorSkeleton
. This component is generic enough that it might come in handy for other consumers -- e.g.packages/edit-site
, and 3rd parties. (The specifically intended use case will be a 'custom' build of Gutenberg, with some added UI controls etc.) If this is approved, I hope to continue to extract other reusable components similarly.How has this been tested?
Rebuild Gutenberg (
npm run build
), and start it (npx wp-env start
). Verify that the editor styling isn't broken (specifically regions like header or sidebar).Types of changes
Move a component from one package to another. Update style selectors, but retain old class names along new ones for backwards compat.
Checklist: