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

The Lesser Migration #2470

Merged
merged 68 commits into from
Feb 27, 2023
Merged

The Lesser Migration #2470

merged 68 commits into from
Feb 27, 2023

Conversation

AnthonyLedesma
Copy link
Member

@AnthonyLedesma AnthonyLedesma commented Jan 20, 2023

Description

The Great Migration POC demonstrated a successful approach for migrating CoBlocks blocks into Core blocks, providing users with a more consistent and unified experience. The Lesser Migration builds on this success by implementing a staged approach, allowing us to gradually introduce this experience starting with a smaller audience.

As the Gutenberg landscape has evolved, it has become clear that Core blocks offer quality user experience, consistent controls, and regular updates. While it is possible to align CoBlocks with Core, it has proven to be a challenging task to back-port features and functionalities. Additionally, migrations to new features and functionality often require deprecating blocks, adding to bloat and load times.

In summary, The Lesser Migration aims to streamline the user experience by migrating select blocks to Core, reducing maintenance and update overhead, and allowing us to focus on unique and user-enhancing features in CoBlocks.

Also requires a Go branch for proper Go-specific styling.
godaddy-wordpress/go#838

Screenshots

Alert Block
migrateAlertBlock

Author Block
migrateAuthorBlock

Types of changes

Major changes intended for CoBlocks 3.0 release.
PHP and JS changes introducing block migrations.

How has this been tested?

Manually tested minor CoBlocks versions back to 2.20.0 all able to successfully migrate.
PHPUnit tests in place. Unit tests cover:

  • functionality of core migration logic.
  • block parser attribute validation
  • e2e test covering JavaScript logic of migration - Handled in Cypress in GHA.

To test this manually:
First, you must set up a 'master' branch of CoBlocks locally. You want to create two new posts. One post is to test the Author block and another is to test the Alert block. When running the block editor and 'master' branch you should insert blocks into the post. We should use features of the block as well. For example, we should have a block with custom colors. A block with custom alignment. Block with a custom class name. A Block using any and all features such as block animation or typography controls like bold and italics.

Once we have a test post for each block, and each test post is filled with configured blocks, we are ready to test!

Next, we need to check out this branch cb-30-base and build. After building these changes, the next time we load one of the test posts, it will migrate the CoBlocks blocks into Core blocks.

For reference:
Alert Block -> Paragraph styled as an alert.
Author Block -> Columns block layout as author.

Acceptance criteria

  • Blocks should migrate.
  • Tests should provide confidence of functionality.

Checklist:

  • My code is tested
  • My code follows accessibility standards
  • My code has proper inline documentation
  • I've included any necessary tests
  • I've included developer documentation
  • I've added proper labels to this pull request

@godaddy-wordpress-bot
Copy link
Contributor

godaddy-wordpress-bot commented Jan 20, 2023

@cypress
Copy link

cypress bot commented Jan 20, 2023

Passing run #3913 ↗︎

0 387 2 0 Flakiness 0

Details:

Merge branch 'master' into cb-30-base
Project: CoBlocks Commit: f38e43674c
Status: Passed Duration: 06:09 💡
Started: Jan 27, 2023 10:52 PM Ended: Jan 27, 2023 10:58 PM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@godaddy-wordpress-bot
Copy link
Contributor

godaddy-wordpress-bot commented Jan 20, 2023

Performance Test Results:

index master cb-30-base change %
focus 144.06 133.52 -7.32%
inserterHover 78.83 78.2 -0.8%
inserterOpen 89.7 92.27 2.87%
inserterSearch 106.68 94.05 -11.84%
load 53658.1 56145.1 4.63%
maxFocus 302.02 197.05 -34.76%
maxInserterHover 100.66 97.26 -3.38%
maxInserterOpen 211.1 219.17 3.82%
maxInserterSearch 262.77 143.15 -45.52%
maxType 130.58 129.25 -1.02%
minFocus 111.94 114.73 2.49%
minInserterHover 73.02 71.07 -2.67%
minInserterOpen 73.38 74.68 1.77%
minInserterSearch 72.5 75.31 3.88%
minType 63.91 62.43 -2.32%
type 72.17 74.4 3.09%

@AnthonyLedesma AnthonyLedesma self-assigned this Jan 24, 2023
@AnthonyLedesma AnthonyLedesma merged commit c43889e into master Feb 27, 2023
@AnthonyLedesma AnthonyLedesma deleted the cb-30-base branch February 27, 2023 17:20
AnthonyLedesma added a commit that referenced this pull request Feb 28, 2023
@AnthonyLedesma AnthonyLedesma added this to the 3.0.1 milestone Mar 27, 2023
@GenieTim
Copy link

At least the migration from alert to paragraph does not work well with UTF-8 characters (e.g., Umlaute as often used on German sites, sucha as ä, ö or ü) and is currently destroying one page after another on my sites, whenever I want to change anything else on the page, leading to much extra work of changing the butchered characters back. The list of changes is unfortunately very extensive in this PR, making it hard for me to find an entry point to submit a fix – could you kindly give an indication on where to start, dear @AnthonyLedesma ?

@AnthonyLedesma
Copy link
Member Author

Hi @GenieTim,

I am so sorry to hear about that fact with UTF8 chars. This fix I think has to do with how the content is loaded into PHP and parsed locally. It seems like the content is being imported in a way that does not handle some characters.

I took a quick look and tested it out with special characters, made some modifications to the migrate logic, and have a PR that is close to ready. I hope to have this fix out soon.

@AnthonyLedesma
Copy link
Member Author

PR up to resolve special characters bug.
#2526

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs Review Tracking pull requests that need another set of eyes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants