-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
(WIP) Mtopo27/size analysis docs #15256
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
base: master
Are you sure you want to change the base?
Changes from 16 commits
defc5a6
0a0fbaa
a3fc8eb
6c472be
e136a63
935e91d
84c69b6
4bb7e6f
87195c4
896c120
abde456
633261f
b74e732
97371a3
a447287
269f074
589f484
f5591b1
a7827d7
5694751
07faf8d
9d4d068
b5759eb
a0d62d7
8ca5b1b
64a1819
467176b
4d0d075
80c7a04
823a889
a833c9f
75beead
bd7ffbd
ee1015c
b9a68f6
5485800
9a42ad1
1db4298
1244081
df9ee14
6a331fd
992f405
31d9785
fa0ed6c
6cedc29
97cf608
f0559e1
e0f91ce
b91ef9b
161c795
c12af86
cd9a844
bcab471
653bca6
68bfd75
3da246e
ba378f7
691e7b9
579ca3a
5b84ef2
c0432b7
e180436
838e5f3
ff1a6ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,42 @@ | ||||||||||||
| --- | ||||||||||||
| title: Size Analysis | ||||||||||||
| sidebar_title: Size Analysis | ||||||||||||
| sidebar_order: 5200 | ||||||||||||
| description: Upload Android builds to Sentry for Size Analysis. | ||||||||||||
| --- | ||||||||||||
|
|
||||||||||||
| <Include name="size-analysis/ea" /> | ||||||||||||
|
|
||||||||||||
| [Size Analysis](/product/size-analysis) helps you monitor your mobile app's size in preprod to prevent size regressions from reaching users. Aside from being courteous to your users, a smaller app size helps boost conversion and retention rates for the long-tail of customers. | ||||||||||||
|
|
||||||||||||
| ## Getting Started | ||||||||||||
|
|
||||||||||||
| **Accepted Formats**: AAB (preferred) | IPA | ||||||||||||
|
||||||||||||
| **Accepted Formats**: AAB (preferred) | IPA | |
| ### Prerequisites | |
| **Accepted Formats**: AAB (preferred) *or* IPA | |
| **Upload Mechanisms**: [Gradle](#uploading-with-gradle) version `6.0.0-alpha.6` or higher *or* [the Sentry CLI](#uploading-with-the-sentry-cli) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels a little weird calling this a "Prerequisite"
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mtopo27 marked this conversation as resolved.
Show resolved
Hide resolved
mtopo27 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
mtopo27 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - **Upload on every PR** - Set up CI to upload builds for every pull request. This enables automatic size comparisons between the PR build and the base branch, allowing you to catch size regressions during code review before merging. | |
| - **Upload on every PR** - Set up CI to upload builds for every pull request. This enables automatic size comparisons between the PR build and the base branch, allowing you to catch size regressions during code review and before merging. |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,107 @@ | ||||||||||
| --- | ||||||||||
| title: Insights | ||||||||||
| sidebar_order: 5250 | ||||||||||
| description: Preview how Size Analysis reports highlight Android build trends. | ||||||||||
| --- | ||||||||||
|
|
||||||||||
| TODO: ADD SOME PICS | ||||||||||
|
||||||||||
|
|
||||||||||
| Size Analysis Insights point out how Android app can reduce its size. They spot patterns like duplicate files, oversized media, or unneeded assets, and list exactly what to fix along with the estimated size savings. | ||||||||||
|
||||||||||
| Size Analysis Insights point out how Android app can reduce its size. They spot patterns like duplicate files, oversized media, or unneeded assets, and list exactly what to fix along with the estimated size savings. | |
| Size Analysis Insights point out good opportunities to reduce your Android app's size. They spot patterns like duplicate files, oversized media, or unneeded assets, and list exactly what to fix along with the estimated size savings. |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Below are a list of available insights for Android builds. | |
| Below are a list of available insights for Android builds: |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Below are a list of available insights for Android builds. | |
| Below are a list of available insights for Android builds, followed by more details about each insight: |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| | Insight | What it catches | | |
| | Insight | What it flags | |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| | [Duplicate files](#duplicate-files) | Flags identical payloads you can keep once and drop the copies. | | |
| | [Duplicate files](#duplicate-files) | Flags identical payloads so you can drop the duplicates. | |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ### Duplicate files | |
| ### Duplicate Files |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| **How to fix**: Keep one copy and remove or dedupe the rest. For resource folders, consolidate the asset into a shared module or asset pack so the APK bundles it once. | |
| **How to fix**: Keep one copy and remove or dedupe the rest. For resource folders, consolidate the asset into a shared module or asset pack so the APK only bundles it once. |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ### Large images | |
| ### Large Images |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| **How to fix**: Compress them with lossless WebP or resize them before bundling. Options: | |
| **How to fix**: Compress or resize the images before bundling. |
mtopo27 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These instructions are for WebP Optimization. I personally do not advocate for keeping the large images or large videos insight as they're really just not useful or actionable.
There's a fair chance these could already be WebP and then our guidance to optimize is useless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can reword to say - picked up large media files that might be better off removing / using as a dynamic feature / downloading as not part of the bundle. Not sure the lingo here, if you can take that and run with it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean I think these are just useless insights generally, so I'm more recommending we just remove them entirely. If we want to keep them, I guess the following is ok:
### Large Images
**What it is**: Flags image files larger than 10 MB.
**How to fix**: Optimize images with lossless WebP or resize/remove them before bundling.
**Options**:
- Use Android Studio: right-click an image → **Convert to WebP** → choose **Lossless**.
- Use the command line:
```bash
# Install cwebp
brew install webp
# Convert PNG to lossless WebP
cwebp -lossless input.png -o output.webp
# Convert JPEG to lossless WebP
cwebp -lossless input.jpg -o output.webp
Large images or splash screens may also load more efficiently if served over the network instead of being bundled with the app.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Large hero images or splash screens may also benefit from serving them over the network instead of bundling them. | |
| Large hero images or splash screens may also load more efficiently if served over the network instead of being bundled with the app. |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ### Large videos | |
| ### Large Videos |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Lower the `-crf` value for higher quality (and larger files) or raise it for smaller files. | |
| Lower the `-crf` value for higher quality (and larger files), or raise it for smaller files. |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ### WebP optimization | |
| ### WebP Optimization |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ### Large audio | |
| ### Large Audio |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This 'Tweak' line feels out of place, is it one of the options to fix this issue, or does it relate to the bash snippet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its related to the bash snippet - left a note for us to come back and clean up
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ### Hermes debug info (RN only) | |
| ### Hermes Debug Info (React Native Only) |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,41 @@ | ||||||
| --- | ||||||
| title: Size Analysis | ||||||
| sidebar_order: 5200 | ||||||
| description: Upload iOS builds to Sentry for size analysis. | ||||||
| --- | ||||||
|
|
||||||
| <Include name="size-analysis/ea" /> | ||||||
|
|
||||||
| [Size Analysis](/product/size-analysis) helps you monitor your mobile app's size in preprod to prevent size regressions from reaching users. Aside from being courteous to your users, a smaller app size helps boost conversion and retention rates for the long-tail of customers. | ||||||
|
||||||
| [Size Analysis](/product/size-analysis) helps you monitor your mobile app's size in preprod to prevent size regressions from reaching users. Aside from being courteous to your users, a smaller app size helps boost conversion and retention rates for the long-tail of customers. | |
| [Size Analysis](/product/size-analysis) helps you monitor your mobile app's size in pre-production to prevent unexpected size increases (regressions) from reaching users. Aside from being courteous to your users, a smaller app size helps boost installation and retention rates, especially for customers with limited storage or slower connections. |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.