-
Notifications
You must be signed in to change notification settings - Fork 18
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 blocks categories #110
Conversation
a2d9148
to
3e26b94
Compare
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 @fullofcaffeine!
I left some notes suggesting ways that we can apparently align more with this project's setup. I say "apparently" because I'm not familiar with this project myself 🙂
2d96341
to
6cf4b5b
Compare
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.
Tested with pre- & post-category-update Gutenberg versions - Layout Grid
blocks appear under correct categories. Thanks!
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 left one suggestion. With this already approved by @WunderBart's, let's get this shipped! 🚀
blocks/_helpers/index.js
Outdated
@@ -0,0 +1 @@ | |||
export * from './helpers'; |
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.
We could probably do with a bit less indirection here 🙂
Effectively, we have _helpers
proxied to _helpers/helpers.js
by way of _helpers/index.js
. I appreciate re-exporting small, related modules from an index file, but this seems like YAGNI.
I'd propose these alternatives we put the contents of blocks/_helpers/helpers.js
directly in blocks/_helpers.js
and remove directory (YAGNI, this is simplest).
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, good points 👍
I'm not sure of the context to this change, but what old environment is this referring to? |
@johngodley Gutenberg 8.3 removes some block categories and introduces some new ones. There is some built-in handling that maps legacy categories to new ones (blocks using older categories won't break), there is no protection in the other direction (blocks using new categories either without Gutenberg installed or with an out-of-date version will break). The purpose of this change is to define the category for each block in both contexts, whether new categories or old categories are present. The "old environment" refers to:
|
Thanks. If it makes things easier we can tie the release of this to minimum WP 5.5? |
I'm not familiar with this project, but I don't think it's necessary to wait. There's a relatively straightforward helper function added. I think this can move ahead without restricting the version to WP 5.5 unless you disagree. |
The plugin gets bundled up for .org and for .com, and this change will require modifying that bundling process to also include the helper file (sadly it's in a different location). This isn't a problem as such. However we don't really need a lot of backwards compatibility, and we generally set the minimum to the latest version of WP. We'll do this for some upcoming changes anyway. Based on what you said about WP 5.5 we could simplify the change to a straight Happy to go either way though. |
What's the timeline like for a WP 5.5–only release? I'd be happy to drop the legacy category handling and just update to the new categories. Would you take over merging this when appropriate for that release? |
6cf4b5b
to
0a6027a
Compare
0a6027a
to
c905db4
Compare
WP 5.5 seems scheduled for 11th August. In terms of the layout grid we'll be releasing a minor fix in the next day or two (1.2.4), and a more substantial release in the next week or two (1.3). Both of these should make it out before WP 5.5. There's a big release coming up (1.4), which will be ready after 5.5 is released, and will definitely require 5.5 as a minimum. In the meantime, assuming that the existing category continues to work with 5.5, then I can include this PR as part of the bigger 1.4 release. If something does happen in the meantime then we can just include this PR anyway. |
I'm happy to let you decide when the tradeoffs to land this sooner or later make the most sense for this project. |
Should we abandon this PR? |
Yeah, sorry, Layout Grid 1.3 hasn't been released yet so this was left untouched. Based on the above conversation, and that 5.5 is now released, I don't think we need the back-compat helpers anymore and as such I'll close this PR. I'll ensure that the category changes is applied to all the blocks in this repo, and they'll be included in the next releases. I'll also bump the minimum supported WP to 5.5. |
Changes proposed in this Pull Request:
block-experiments
.Related PRs
Testing instructions:
Atomated tests
yarn test
To manually test the changes
wp-env
)block-experiments
in its READMECategories
a8c/bauhaus-centenary
inwidgets
a8c/event
inwidgets
jetpack/layout-grid
fromlayout
->design
jetpack/layout-grid-column
fromlayout
->design
a8c/motion-background-container
inwidgets
a8c/starscape
inwidgets
a8c/waves
inwidgets
Note: If this PR gets approved and merged, then I'll remove the helper function and tests from here (including the installation/configuration of jest).