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

Improve performance of File block processor #22897

Conversation

fluiddot
Copy link
Contributor

@fluiddot fluiddot commented Mar 25, 2024

This PR follows the same approach taken in #22896 to improve the performance of Gutenberg processors. The overall improvement will be less significant in this case (that's why the PR is marked as Enhancement instead of Bug) mainly because the File block is used by fewer users than Image/Gallery blocks. Nevertheless, it will speed up the post-saving process.

To test:

Follow the testing instructions to cover the functionality related to the processors for the block:

Regression Notes

  1. Potential unintended areas of impact
    The block processors are only used when saving a post. No other area should be impacted.

  2. What I did to test those areas of impact (or what existing automated tests I relied on)
    Manually tested saving a post with File blocks.

  3. What automated tests I added (or what prevented me from doing so)
    I added a new unit test to cover the content parsing of File blocks.

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Testing checklist:

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • VoiceOver.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • iPhone and iPad.
  • Multi-tasking: Split view and Slide over. (iPad)

@fluiddot fluiddot added [Type] Enhancement Gutenberg Editing and display of Gutenberg blocks. labels Mar 25, 2024
@fluiddot fluiddot added this to the 24.6 milestone Mar 25, 2024
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 25, 2024

WordPress Alpha📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App NameWordPress Alpha WordPress Alpha
ConfigurationRelease-Alpha
Build Numberpr22897-a9c30fb
Version24.9
Bundle IDorg.wordpress.alpha
Commita9c30fb
App Center BuildWPiOS - One-Offs #9943
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 25, 2024

Jetpack Alpha📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App NameJetpack Alpha Jetpack Alpha
ConfigurationRelease-Alpha
Build Numberpr22897-a9c30fb
Version24.9
Bundle IDcom.jetpack.alpha
Commita9c30fb
App Center Buildjetpack-installable-builds #8993
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@fluiddot fluiddot marked this pull request as ready for review March 26, 2024 11:14
@@ -1,7 +1,6 @@
import Foundation
import Aztec
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Aztec was imported in this file to use HTMLProcessor. Now the HTML processing is performed by using SwiftSoup.

@irfano
Copy link
Member

irfano commented Apr 1, 2024

I'm moving this to the next milestone since this is not a blocker, and the code freeze will be completed today.

@irfano irfano modified the milestones: 24.6, 24.7 Apr 1, 2024
@twstokes twstokes self-requested a review April 3, 2024 18:27
@momo-ozawa momo-ozawa modified the milestones: 24.7, 24.8 Apr 15, 2024
@momo-ozawa
Copy link
Contributor

momo-ozawa commented Apr 15, 2024

👋 Hey @fluiddot, I'm bumping this PR to 24.8 since it's code freeze day. If this PR needs to target 24.7, please target the release branch once it's been cut. Thanks!

@dvdchr
Copy link
Contributor

dvdchr commented Apr 29, 2024

Hi @fluiddot 👋 , I'm bumping this PR's milestone to 24.9 since I'm starting code freeze. Feel free to re-target this to the release branch if this is a blocker or intended for 24.8.

@dvdchr dvdchr modified the milestones: 24.8, 24.9 Apr 29, 2024
@salimbraksa
Copy link
Contributor

Hey @fluiddot, I'm bumping the milestone for this PR to 25.0 as I'm starting the code freeze. If this PR needs to go into 24.9, please go ahead and re-target it to the release branch.

@salimbraksa salimbraksa modified the milestones: 24.9, 25.0 May 13, 2024
@twstokes twstokes force-pushed the update/improve-file-block-processor branch from 8d56982 to 5612643 Compare May 16, 2024 18:27
Copy link
Contributor

@twstokes twstokes left a comment

Choose a reason for hiding this comment

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

LGTM @fluiddot! Thanks for adding the tests. 🚀

@twstokes twstokes merged commit 5733b49 into update/improve-image-blocks-processor May 20, 2024
24 checks passed
@twstokes twstokes deleted the update/improve-file-block-processor branch May 20, 2024 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Editing and display of Gutenberg blocks. [Type] Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants