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 6.8 Compatibility: Replace ButtonGroup usage. #42627

Open
wants to merge 5 commits into
base: trunk
Choose a base branch
from

Conversation

coder-karen
Copy link
Contributor

@coder-karen coder-karen commented Mar 20, 2025

Partially fixes #42579
Remaining instances fixed here: #42636

Proposed changes:

  • This PR replaces the ButtonGroup component in the Map Block with the recommended ToggleGroupControl, and adds some adjusted styling to more closely match the previous styling.
  • This also prevents console warnings - wp.components.ButtonGroup is deprecated since version 6.8. Please use wp.components.__experimentalToggleGroupControl instead
  • It also adds a fix for an instance of __unstableIsPreviewMode, now replaced with isPreviewMode, which also existed in the Map block and is also deprecated as of WordPress 6.8.
  • For the Split Button component, it replaces the ButtonGroup with a Flex component to more easily keep the styling consistent with the previous style.

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

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

No.

Testing instructions:

On a self-hosted test site, to replicate the issue on trunk, you will need script debug enabled: define( 'SCRIPT_DEBUG', true ); in wp-config.php. Then:

  • Install the WordPress Beta Tester plugin
  • Go to Tools > Beta Testing, and set the plugin to use Beta/RC Only (in order to upgrade to WP 6.8-beta3)
  • Go to Dashboard > Updates, and update to WP 6.8-beta3.
  • Add a Map block to a post. Add token. Open sidebar, click on Mapbox Token to expand, then the deprecation notice will show in your browser console.
  • To test the __unstableIsPreviewMode console warning, open up the block selector and hover over 'Map' to view the block preview:
Screenshot 2025-03-20 at 19 22 44
  • To test the Split Button component issue, this only exists in Story Book. To view this, run cd projects/js-packages/storybook && pnpm run storybook:dev. Story book should open in a new tab in your current browser.
  • Navigate to Components > Split Button > Default. Make note of how it looks and behaves.

To test the changes, apply this PR locally.

  • Then, follow the same steps as earlier to test the Map block - you should not see any console warnings related to the ButtonGroup component, and the Mapbox Token button should look and behave as expected.
  • There also should not be a console warning related to __unstableIsPreviewMode when previewing the Map block.
  • Test the Split Button component via Story Book, and it should look the same as before as well.

On WoA and Simple:

  • The Map block changes related to the Map preview can also be tested on those sites( as there is no token section). For testing purposes, if using the beta tester plugin or on Simple the command in the generated comment below, it's only the Jetpack plugin changes that are needed.

@coder-karen coder-karen added [Type] Bug When a feature is broken and / or not performing as intended [Status] In Progress labels Mar 20, 2025
@coder-karen coder-karen self-assigned this Mar 20, 2025
@github-actions github-actions bot added [Block] Map [JS Package] Components [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ RNA labels Mar 20, 2025
Copy link
Contributor

github-actions bot commented Mar 20, 2025

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 Review, ...).
  • ✅ Add a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ 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 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Jetpack plugin:

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

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: April 1, 2025
    • Code freeze: March 30, 2025

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

Copy link
Contributor

github-actions bot commented Mar 20, 2025

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 WoA dev 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 (Jetpack or WordPress.com Site Helper), and enable the replace/buttongroup-usage branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack replace/buttongroup-usage
bin/jetpack-downloader test jetpack-mu-wpcom-plugin replace/buttongroup-usage

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

jp-launch-control bot commented Mar 20, 2025

Code Coverage Summary

This PR did not change code coverage!

That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷

Full summary · PHP report · JS report

@coder-karen coder-karen marked this pull request as ready for review March 21, 2025 08:34
@coder-karen coder-karen added [Status] Needs Review This PR is ready for review. and removed [Status] In Progress labels Mar 21, 2025
@coder-karen coder-karen requested a review from a team March 21, 2025 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Map [JS Package] Components [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ RNA [Status] Needs Review This PR is ready for review. [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WordPress 6.8 Compatibility: Replace ButtonGroup usage with ToggleGroupControl
1 participant