Skip to content
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 CoBlocks for Gutenberg 7.2.0: replace legacy editor- classes with block-editor- #1242

Merged

Conversation

mmtr
Copy link
Contributor

@mmtr mmtr commented Jan 9, 2020

Gutenberg 7.2.0 has removed the legacy editor- classes in WordPress/gutenberg#19050 breaking the CoBlocks styles. This PR updates all those classes to use the block-editor- prefix.

Screenshots

Before After
Screenshot 2020-01-09 at 14 35 24 Screenshot 2020-01-09 at 14 34 06
Screenshot 2020-01-09 at 14 35 29 Screenshot 2020-01-09 at 14 34 10
Screenshot 2020-01-09 at 14 35 33 Screenshot 2020-01-09 at 14 34 14

How to test

  • Activate Gutenberg 7.2.0
  • Generate a new build of CoBlocks using this branch and activate it.
  • Verify the blocks look correct.

@gwwar
Copy link

gwwar commented Jan 9, 2020

@mmtr if CoBlocks supports multiple Block Editor versions, we'll want to have additive css selectors instead of updating them. Eg styling would support both .editor and .block-editor

@aduth did we have a migration warning for this? Other block builders might run into this.

@aduth
Copy link

aduth commented Jan 9, 2020

It is marked as "Needs Dev Note", which by the backwards compatibility guidelines is meant as an indication of needing to publish an associated dev-notes-tagged post on the Make/Core blog.

In other words: It is expected that a migration guide would be authored as part of an upcoming major WordPress release in which it's expected to land.

As to how this relates to interoperability between the Gutenberg plugin and other plugins... I'm not sure there are guidelines or expectations around this. The Gutenberg plugin is tended to be considered as being more unstable in its changing APIs, but even then it's typically tended to have some deprecation period (at least for breaking API changes).

I can see how this might be an area for workflow improvement. I might imagine it could be something where the dev-notes associated with a "Needs Dev Notes" pull request should be authored at the time of the pull request, and should ideally be shared as part of a plugin release post and/or the tagging of the plugin release candidate. Third-party integrators may also consider using "Needs Dev Note" as a label filter for potential future compatibility issues.

cc @youknowriad

@aduth
Copy link

aduth commented Jan 9, 2020

There was also this note published for dev-notes of WordPress 5.2:

The components that moved from the editor module to the block-editor module are internally using CSS class names that follow the package they’re declared in. For example, the editor-inserter__toggle class name is now renamed block-editor-inserter__toggle. The old class names have been retained to minimize any backward compatibility concern, but the CSS styles are now targeting the new class names. Ideally, you should rely on components in your own code instead of the internal class names used in the WordPress admin. But if you do use those classes, make sure to rename them accordingly.

https://make.wordpress.org/core/2019/04/09/the-block-editor-javascript-module-in-5-2/

(emphasis mine)

@richtabor richtabor added this to the Next Release milestone Jan 9, 2020
@richtabor richtabor self-assigned this Jan 9, 2020
@richtabor richtabor merged commit 3247288 into godaddy-wordpress:master Jan 9, 2020
@aduth
Copy link

aduth commented Jan 9, 2020

Worth noting there are a few more of these set to land as part of WordPress/gutenberg#19489 . It shouldn't be a problem if this pull request captured all of those legacy class names.

@richtabor
Copy link
Contributor

richtabor commented Jan 9, 2020

Appreciate it @aduth, I double-checked against that PR. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants