Reduce App Size – Assets (2)
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.
Regression Notes
-
Potential unintended areas of impact
-
What I did to test those areas of impact (or what existing automated tests I relied on)
-
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.txtif 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)
📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
| App Name | WordPress Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr23396-22c4c39 | |
| Version | 25.1 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 22c4c3984e47eed73c4f4f382e3f39bc6bf4ee2f | |
| App Center Build | WPiOS - One-Offs #10263 |
📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
| App Name | Jetpack Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr23396-22c4c39 | |
| Version | 25.1 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 22c4c3984e47eed73c4f4f382e3f39bc6bf4ee2f | |
| App Center Build | jetpack-installable-builds #9310 |
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?