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

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

Merged
merged 41 commits into from
Jun 10, 2024

Conversation

darssen
Copy link
Contributor

@darssen darssen commented May 9, 2024

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 #37260 or #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 darssen added [Feature] WordPress.com Block Editor [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Package] Jetpack mu wpcom WordPress.com Features [Plugin] mu wpcom jetpack-mu-wpcom plugin [Focus] Jetstream labels May 9, 2024
@darssen darssen self-assigned this May 9, 2024
Copy link
Contributor

github-actions bot commented May 9, 2024

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

Copy link
Contributor

github-actions bot commented May 9, 2024

Thank you for your PR!

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

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ 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 🤖


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.

@darssen darssen marked this pull request as ready for review May 10, 2024 07:53
@darssen darssen requested a review from a team May 10, 2024 07:53
monsieur-z
monsieur-z previously approved these changes May 28, 2024
Copy link
Contributor

@monsieur-z monsieur-z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All instructions tested as expected. Tested with self-hosted, simple and WoA sites.

Copy link
Contributor

@fgiannar fgiannar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While testing on a Simple site with Gutenframe (iframed block editor), I noticed the following warnings (not reproducible on trunk):

  • Warning: Undefined array key 1 in [REDACTED]/mu-plugins/jetpack-mu-wpcom-plugin/sun/vendor/automattic/jetpack-mu-wpcom/src/features/wpcom-block-editor/class-jetpack-wpcom-block-editor.php on line 256

  • Warning: Undefined array key 2 in [REDACTED]/mu-plugins/jetpack-mu-wpcom-plugin/sun/vendor/automattic/jetpack-mu-wpcom/src/features/wpcom-block-editor/class-jetpack-wpcom-block-editor.php on line 256

About Gutenframe: PCYsg-lwV-p2

@bindlegirl bindlegirl added [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Jun 3, 2024
Copy link
Contributor

@fgiannar fgiannar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected for self-hosted and Simple sites 👍

On WoA though, the Justify option is missing, plus getting the following error in the console:

Screenshot 2024-06-04 at 16 12 57


wp_localize_script(
'wpcom-block-editor-default-editor-script',
'jetpackMuWpcomGutenberg',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we could change the variable back to wpcomGutenberg from jetpackMuWpcomGutenberg, but only on Atomic sites, as I know that it was changed because of a Simple issue: #37324 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I noticed that too, trying to come with an idea that serves for the different environments.

@darssen darssen requested a review from fgiannar June 7, 2024 12:26
@darssen darssen added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels Jun 7, 2024
Copy link
Contributor

@coder-karen coder-karen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests well for me on self-hosted, Atomic and Simple.

@darssen darssen dismissed fgiannar’s stale review June 10, 2024 11:01

Issue has been addressed

@darssen darssen merged commit 40c1f14 into trunk Jun 10, 2024
56 checks passed
@darssen darssen deleted the update/move-wpcom-block-editor-to-jetpack-mu-wpcom branch June 10, 2024 11:07
@github-actions github-actions bot removed the [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. label Jun 10, 2024
@@ -53,6 +54,8 @@
'src/features/marketplace-products-updater/class-marketplace-products-updater.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchReturn'],
'src/features/media/heif-support.php' => ['PhanPluginSimplifyExpressionBool'],
'src/features/verbum-comments/class-verbum-comments.php' => ['PhanImpossibleTypeComparison', 'PhanNoopNew', 'PhanParamTooMany', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredFunction'],
'src/features/wpcom-block-editor/class-jetpack-wpcom-block-editor.php' => ['PhanUndeclaredFunctionInCallable'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably shouldn't have ignored this. It was flagging a legitimate issue, see p1718019341602329-slack-C034JEXD1RD

dilirity pushed a commit that referenced this pull request Jun 11, 2024
…om (#37324)

* Move code to package. Deprecate code in modules and not call it.

* Fix bugs

* Move tests to the mu-wpcom package

* Update test

* Phan updates for the mu-wpcom package

* Phan updates for the jetpack plugin

* Changelogger

* Fix typos

* Updated version

* Fixed Unit Tests

* Bump version mu-wpcom-plugin

* Updated @SInCE  references to indicate they come from jetpack

* Updated comments related to Jetpack plugin

* Autoload both files for  wpcom block editor

* Fixed typo

* Updated function to set_cookie

* Update phan baseline

* Phan update

* Version bump

* Version bump

* Marked functions file as deprecated in the module

* Changed variable name for localize script

* Remove isWoA check since it should work for simple as well

* Remove wrong require that got added from merge

* Added check for wpcom simple

* Version bump

* Added check for simple since same object is already localized there

* Phan changes

---------

Co-authored-by: Foteini Giannaropoulou <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants