WordPress-iOS icon indicating copy to clipboard operation
WordPress-iOS copied to clipboard

Reduce App Size – Assets (2)

Open kean opened this issue 1 year ago • 2 comments

I made a mistake in the previous PR where I added compressed JPBackground pngs but completely forgot about Xcode compression – it was inflating them back to around 1.9 MBs. I don't think there is any good way of disabling it, so I re-implemented Jeremy's solution from https://github.com/wordpress-mobile/WordPress-iOS/pull/23261 since it's an even better option, reducing the size down to 35 KB as .svg files gets included in the .car bundle as is.

The new size of the compressed universal .ipa is 116.2 MB down from 122.3 MB (-6.1 MB).

Compressing other assets manually is pointless because Xcode will re-compress them again at build time, leading to a loss in quality unless we disable compression globally and manage it fully ourselves.

Screenshot 2024-06-28 at 3 43 22 PM Screenshot 2024-06-28 at 3 43 27 PM

Regression Notes

  1. Potential unintended areas of impact

  2. What I did to test those areas of impact (or what existing automated tests I relied on)

  3. What automated tests I added (or what prevented me from doing so)

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)

kean avatar Jun 28 '24 18:06 kean

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 Numberpr23396-22c4c39
Version25.1
Bundle IDorg.wordpress.alpha
Commit22c4c3984e47eed73c4f4f382e3f39bc6bf4ee2f
App Center BuildWPiOS - One-Offs #10263
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

wpmobilebot avatar Jun 28 '24 19:06 wpmobilebot

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 Numberpr23396-22c4c39
Version25.1
Bundle IDcom.jetpack.alpha
Commit22c4c3984e47eed73c4f4f382e3f39bc6bf4ee2f
App Center Buildjetpack-installable-builds #9310
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

wpmobilebot avatar Jun 28 '24 19:06 wpmobilebot

Hi @kean, I'm curios and I want to understand more about your PR.

For example, I have a Figma design, and I download some icons in 3 different formats: PNG, SVG, and PDF. The icon sizes in 3 formats are:

  • PNG: 356 bytes 1x, 614 bytes 2x, 872 bytes 3x
  • SVG: 663 bytes
  • PDF: 2KB.

After some measures, using 3 PNGs has a smaller Assets.car file size compared to using SVG and PDF. With that conclusion, in your case, using 3 PNGs for JPBackground should be better than using 1 SVG.

My question is: How did you generate the SVG that is so small (only 2KB) compared to 3 PNGs and 1 PDF format?

Screenshot 2024-07-06 at 18 30 49

hoangatuan avatar Jul 06 '24 10:07 hoangatuan