jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

WordPress.com Block Editor Deprecate and move functionality to mu wpcom

Open darssen opened this issue 1 year ago • 3 comments

Proposed changes:

  • Deprecate WordPress.com Block Editor for self-hosted
  • Move the functionality to jetpack-mu-wpcom package
  • Fixed Unit Tests while moving them

Regarding deprecation notices and removal of the code, I took a different approach to https://github.com/Automattic/jetpack/pull/37260 or https://github.com/Automattic/jetpack/pull/37189 since the jetpack-mu-wpcom package is not available for the jetpack plugin. The steps I take are as follows. After removing the loading of the file from the module-extras.php I decided to mark the file as deprecated as well as the init and the constructor. But leave the file as is since I cannot replace the functionality with the one in the mu-wpcom package due to being out of reach.

Other information:

  • [ ] Have you written new tests for your changes, if applicable?
  • [ ] Have you checked the E2E test CI results, and verified that your changes do not break them?
  • [ ] Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

pfwV0U-9G-p2

Does this pull request change what data or activity we track or use?

No

Testing instructions:

  • Check in self-hosted and see that Justify and Underline formatting Tools are no longer available. image

  • Make sure deprecation notices are not present unless the Class is declared explicitly.

  • Check that Simple and WoA still keep the justify and Underline formatting Tools

darssen avatar May 09 '24 16:05 darssen

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WordPress.com Simple site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin, and enable the update/move-wpcom-block-editor-to-jetpack-mu-wpcom branch.

    • For jetpack-mu-wpcom changes, also add define( 'JETPACK_MU_WPCOM_LOAD_VIA_BETA_PLUGIN', true ); to your wp-config.php file.
  • To test on Simple, run the following command on your sandbox:

    bin/jetpack-downloader test jetpack update/move-wpcom-block-editor-to-jetpack-mu-wpcom
    
    bin/jetpack-downloader test jetpack-mu-wpcom-plugin update/move-wpcom-block-editor-to-jetpack-mu-wpcom
    

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

github-actions[bot] avatar May 09 '24 17:05 github-actions[bot]

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • :white_check_mark: Include a description of your PR changes.
  • :white_check_mark: Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • :white_check_mark: Add testing instructions.
  • :white_check_mark: Specify whether this PR includes any changes to data or privacy.
  • :white_check_mark: Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation :robot:


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped. Then, add the "[Status] Needs Team Review" label and ask someone from your team review the code. Once reviewed, it can then be merged. If you need an extra review from someone familiar with the codebase, you can update the labels from "[Status] Needs Team Review" to "[Status] Needs Review", and in that case Jetpack Approvers will do a final review of your PR.


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen daily.
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly. The next release is scheduled for July 2, 2024 (scheduled code freeze on July 1, 2024).

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Mu Wpcom plugin:

  • Next scheduled release: July 2, 2024.
  • Scheduled code freeze: June 24, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

github-actions[bot] avatar May 09 '24 17:05 github-actions[bot]

This tests well for me on self-hosted. On Atomic it also tests well.

Simple also works - however I'm not sure we need to consider Simple as from what I can see the same code is loaded via the gutenberg-wpcom plugin. Whether it's related to being loaded twice or not, I also seem to be getting ongoing console errors on Simple related to the gutenberg-wpcom plugin (Uncaught TypeError: Cannot read properties of undefined (reading 'apiFetchUnknown')) - moving back to production those are gone. I wonder if it is worth adding a check in the jetpack-mu-wpcom package to make sure a site is Atomic before requiring the files?

Thanks for reviewing!

Nice catch on the console log for Simple. I've been investigating and seems that the issue was coming because wp_localize_script with same object_name wpcomGutenberg was being used in both places ( gutenberg-wpcom plugin code as well as the code introduced in this PR). This was creating some issues since the wpcomGutenberg variable in Gutenberg is actually storing more info. I decided to change the name for the code in this PR.

darssen avatar May 22 '24 12:05 darssen