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

Revert SVG image optimizations from #38573 and #38750 #38981

Merged
merged 2 commits into from
Aug 20, 2024

Conversation

anomiex
Copy link
Contributor

@anomiex anomiex commented Aug 20, 2024

Proposed changes:

There are many interesting ways SVGs can be used. The optimizations broke some of these (see #38966). To be safe, let's revert them all.

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?

Testing instructions:

  • Go to '..'

There are many interesting ways SVGs can be used. The optimizations
broke some of these (see #38966). To be safe, let's revert them all.
@anomiex anomiex added [Type] Bug When a feature is broken and / or not performing as intended [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. [Pri] Normal labels Aug 20, 2024
@anomiex anomiex requested review from danluu, jeherve and a team August 20, 2024 20:39
@anomiex anomiex self-assigned this Aug 20, 2024
@anomiex anomiex enabled auto-merge (squash) August 20, 2024 20:39
Copy link
Contributor

github-actions bot commented Aug 20, 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 revert/svg-image-optimizations 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 revert/svg-image-optimizations
    
    bin/jetpack-downloader test jetpack-mu-wpcom-plugin revert/svg-image-optimizations
    

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 github-actions bot added [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] CRM Issues about the Jetpack CRM plugin [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Migration [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Super Cache A fast caching plugin for WordPress. [Plugin] VaultPress [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. [Plugin] Wpcomsh [Type] Revert Admin Page React-powered dashboard under the Jetpack menu RNA labels Aug 20, 2024
Copy link
Contributor

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.


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Choose a review path based on your changes:
    • A. Team Review: add the "[Status] Needs Team Review" label
      • For most changes, including minor cross-team impacts.
      • Example: Updating a team-specific component or a small change to a shared library.
    • B. Crew Review: add the "[Status] Needs Review" label
      • For significant changes to core functionality.
      • Example: Major updates to a shared library or complex features.
    • C. Both: Start with Team, then request Crew
      • For complex changes or when you need extra confidence.
      • Example: Refactor affecting multiple systems.
  3. Get at least one approval before merging.

Still unsure? 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 daily.
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly. The next release is scheduled for September 3, 2024 (scheduled code freeze on September 2, 2024).

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


Backup plugin:

  • Next scheduled release: none scheduled.

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


Vaultpress plugin:

  • Next scheduled release: none scheduled.

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


Boost plugin:

  • Next scheduled release: none scheduled.

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


Search plugin:

  • Next scheduled release: none scheduled.

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


Social plugin:

  • Next scheduled release: none scheduled.

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


Protect plugin:

  • Next scheduled release: none scheduled.

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


Videopress plugin:

  • Next scheduled release: none scheduled.

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


Super Cache plugin:

  • Next scheduled release: none scheduled.

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


Migration plugin:

  • Next scheduled release: none scheduled.

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


Wpcomsh plugin:

  • Next scheduled release: on demand (usually Mondays if not sooner).

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

@danluu
Copy link
Contributor

danluu commented Aug 20, 2024

On looking at the SVGs more closely, with images like

projects/js-packages/social-logos/src/svg/patreon.svg
projects/plugins/jetpack/_inc/fonts/automatticons/automatticons.svg
projects/plugins/jetpack/_inc/genericons/genericons/Genericons.svg
projects/plugins/jetpack/images/stars-left.svg
projects/plugins/jetpack/images/stars-right.svg
projects/plugins/jetpack/modules/theme-tools/social-menu/social-menu.svg
projects/plugins/protect/assets/fonts/jetpack-protect.svg
projects/plugins/vaultpress/fonts/vaultpress-regular.svg

If I pull these up (including if I grab an old version before the optimization changes), the images look blank? This is true when looking at it in the github diff view or when opening in Chrome or FF.

I don't think that's a problem for this commit since they look the same before and after, but it's a sign that I don't understand what these are used for. I also opened one of them up in an SVG editor and it doesn't appear to have anything in it?

Copy link
Contributor

@danluu danluu left a comment

Choose a reason for hiding this comment

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

Some of these images seem to have visual changes:

image

I think we already knew this caused problems the social icon breakage, but this is another example of svgcleaner causing visual changes in images. Sorry for causing all of this breakage!

@anomiex
Copy link
Contributor Author

anomiex commented Aug 20, 2024

  • projects/js-packages/social-logos/src/svg/patreon.svg

Looks like this is "blank" because it sets no fill or stroke on the path it contains. Presumably wherever it's used supplies overriding CSS.

  • projects/plugins/jetpack/_inc/fonts/automatticons/automatticons.svg
  • projects/plugins/jetpack/_inc/genericons/genericons/Genericons.svg

These are fonts. The first, for example, is used at

url('../_inc/fonts/automatticons/automatticons.svg#automatticonsregular') format('svg');

  • projects/plugins/jetpack/images/stars-left.svg
  • projects/plugins/jetpack/images/stars-right.svg

These do have visible content when I look at them. The content is a light grey, though, so depending on the background color you're viewing them against they might be hard to see. Looks like GitHub's preview uses a very similar grey (#f6f8fa vs #f6f6f6).

  • projects/plugins/jetpack/modules/theme-tools/social-menu/social-menu.svg

This is output into the page HTML (here). Then other inline SVGs in the page can refer to the <symbol>s included (see code here for the building of such an SVG).

@anomiex anomiex merged commit 7d77b83 into trunk Aug 20, 2024
72 of 73 checks passed
@anomiex anomiex deleted the revert/svg-image-optimizations branch August 20, 2024 21:04
@github-actions github-actions bot removed the [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. label Aug 20, 2024
pkuliga pushed a commit that referenced this pull request Aug 23, 2024
There are many interesting ways SVGs can be used. The optimizations
broke some of these (see #38966). To be safe, let's revert them all.
gogdzl pushed a commit that referenced this pull request Oct 25, 2024
There are many interesting ways SVGs can be used. The optimizations
broke some of these (see #38966). To be safe, let's revert them all.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Admin Page React-powered dashboard under the Jetpack menu [Block] Blogging Prompt [Block] Blogroll [Block] Map [Block] Subscriptions [Extension] AI Assistant Plugin [Feature] Masterbar WordPress.com Toolbar and Dashboard customizations [Feature] Plugin Search [Feature] Theme Tools [JS Package] AI Client [JS Package] Components [JS Package] Social Logos [mu wpcom Feature] Wpcom Global Styles [mu wpcom Feature] Wpcom Plugins [mu wpcom Feature] Wpcom Themes [Package] Backup [Package] Classic Theme Helper [Package] Jetpack mu wpcom WordPress.com Features [Package] Masterbar [Package] My Jetpack [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] CRM Issues about the Jetpack CRM plugin [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Migration [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Super Cache A fast caching plugin for WordPress. [Plugin] VaultPress [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. [Plugin] Wpcomsh [Pri] Normal RNA [Type] Bug When a feature is broken and / or not performing as intended [Type] Revert
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants