-
-
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
Open
mtopo27
wants to merge
64
commits into
master
Choose a base branch
from
mtopo27/size-analysis-docs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,046
−1
Open
Changes from 4 commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
defc5a6
init emerge docs
mtopo27 0a0fbaa
delete feature pages (for now)
mtopo27 a3fc8eb
throwing stuff down
mtopo27 6c472be
comments
mtopo27 e136a63
insight
mtopo27 935e91d
cross platform insights
mtopo27 84c69b6
iOS changes
trevor-e 4bb7e6f
update insights
trevor-e 87195c4
oops
trevor-e 896c120
Update to alpha.6
runningcode abde456
Incorporate comments
runningcode 633261f
big refactor to formatting
mtopo27 b74e732
add some todos
mtopo27 97371a3
Add links to authenticate
runningcode a447287
docs(size-analysis): Add best practices and vcsInfo documentation
runningcode 269f074
docs(size-analysis): Add Fastlane metadata override documentation
runningcode 589f484
noah comments
mtopo27 f5591b1
ios insights
trevor-e a7827d7
ios insights
trevor-e 5694751
ios setup
trevor-e 07faf8d
docs(size-analysis): Refine CI integration and upload docs
runningcode 9d4d068
docs(size-analysis): Improve installation steps and status check clarity
runningcode b5759eb
reword intro paragraphs on sdk pages
mtopo27 a0d62d7
alex comments
mtopo27 8ca5b1b
Apply suggestion from @coolguyzone
mtopo27 64a1819
app thinning
trevor-e 467176b
status check image
mtopo27 4d0d075
compress
mtopo27 80c7a04
add some pics, delete the insights page
mtopo27 823a889
typo
mtopo27 a833c9f
smallstrings
trevor-e 75beead
large images
trevor-e bd7ffbd
upload metadata
trevor-e ee1015c
oops
trevor-e b9a68f6
CI
trevor-e 5485800
rebasing
mtopo27 9a42ad1
compress images
mtopo27 1db4298
ci
trevor-e 1244081
remove some todos
mtopo27 df9ee14
ci
trevor-e 6a331fd
nit
trevor-e 992f405
what's next
trevor-e 31d9785
rework minify insight
mtopo27 fa0ed6c
debug symbol image
mtopo27 6cedc29
remove crashlytics reference
mtopo27 97cf608
small copy
mtopo27 f0559e1
Merge branch 'master' into mtopo27/size-analysis-docs
mtopo27 e0f91ce
Merge branch 'master' into mtopo27/size-analysis-docs
mtopo27 b91ef9b
duplicate file android copy
mtopo27 161c795
Apply suggestions from code review
mtopo27 c12af86
match up script
mtopo27 cd9a844
remove todo
mtopo27 bcab471
removing some todos
mtopo27 653bca6
app store connect + thinning
trevor-e 68bfd75
bitrate
mtopo27 3da246e
final todo
mtopo27 ba378f7
update image scripts
NicoHinderling 691e7b9
update the dsyms input file value
NicoHinderling 579ca3a
lints
NicoHinderling 5b84ef2
Apply suggestions from code review
mtopo27 c0432b7
more image info
NicoHinderling e180436
CI permissions
trevor-e 838e5f3
Apply suggestions from code review
mtopo27 ff1a6ad
Merge branch 'master' into mtopo27/size-analysis-docs
mtopo27 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| --- | ||
| title: Size Analysis | ||
| sidebar_title: Size Analysis | ||
| sidebar_order: 5200 | ||
| description: Upload Android builds to Sentry for size analysis. | ||
| --- | ||
|
|
||
| Size Analysis uploads your Android builds so you can catch size regressions before they reach production. | ||
|
|
||
| <Include name="size-analysis/github-only" /> | ||
|
|
||
| ## Quick Start | ||
|
|
||
| <Include name="size-analysis/quickstart-intro" /> | ||
|
|
||
| <Include name="size-analysis/quickstart-gradle" /> | ||
|
|
||
| <Include name="size-analysis/quickstart-cli" /> | ||
|
|
||
| ## More Upload Basics | ||
|
|
||
| See [Uploading Builds](/product/size-analysis/uploading-builds/) for supported formats and required metadata. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| --- | ||
| title: Size Analysis | ||
| sidebar_order: 5200 | ||
| description: Upload iOS builds to Sentry for size analysis. | ||
| --- | ||
|
|
||
| Size Analysis uploads your release builds so you can spot app-size regressions before shipping. | ||
|
|
||
| <Include name="size-analysis/github-only" /> | ||
|
|
||
| ## Quick Start | ||
|
|
||
| <Include name="size-analysis/quickstart-intro" /> | ||
|
|
||
| <Include name="size-analysis/quickstart-fastlane" /> | ||
|
|
||
| <Include name="size-analysis/quickstart-cli" /> | ||
|
|
||
| ## More Upload Basics | ||
|
|
||
| See [Uploading Builds](/product/size-analysis/uploading-builds/) for supported formats and required metadata. |
23 changes: 23 additions & 0 deletions
23
docs/platforms/dart/guides/flutter/size-analysis/index.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| --- | ||
| title: Size Analysis | ||
| sidebar_order: 5200 | ||
| description: Upload Flutter builds to Sentry for size analysis. | ||
| --- | ||
|
|
||
| Use Size Analysis to monitor how your Flutter app size changes across iOS and Android builds. | ||
|
|
||
| <Include name="size-analysis/github-only" /> | ||
|
|
||
| ## Quick Start | ||
|
|
||
| <Include name="size-analysis/quickstart-intro" /> | ||
|
|
||
| <Include name="size-analysis/quickstart-fastlane" /> | ||
|
|
||
| <Include name="size-analysis/quickstart-gradle" /> | ||
|
|
||
| <Include name="size-analysis/quickstart-cli" /> | ||
|
|
||
| ## More Upload Basics | ||
|
|
||
| See [Uploading Builds](/product/size-analysis/uploading-builds/) for supported formats and required metadata. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| --- | ||
| title: Size Analysis | ||
| sidebar_title: Size Analysis | ||
| sidebar_order: 5200 | ||
| description: Upload React Native iOS and Android builds to Sentry for size analysis. | ||
| --- | ||
|
|
||
| Size Analysis helps React Native teams compare app size across iOS and Android builds from the same pull request. | ||
|
|
||
| <Include name="size-analysis/github-only" /> | ||
|
|
||
| ## Quick Start | ||
|
|
||
| <Include name="size-analysis/quickstart-intro" /> | ||
|
|
||
| <Include name="size-analysis/quickstart-fastlane" /> | ||
|
|
||
| <Include name="size-analysis/quickstart-gradle" /> | ||
|
|
||
| <Include name="size-analysis/quickstart-cli" /> | ||
|
|
||
| ## More Upload Basics | ||
|
|
||
| See [Uploading Builds](/product/size-analysis/uploading-builds/) for supported formats and required metadata. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| --- | ||
| title: GitHub Integration | ||
| sidebar_order: 40 | ||
| description: Set up the GitHub integration to receive size change notifications as PR comments and status checks. | ||
| --- | ||
|
|
||
| The GitHub integration brings Size Analysis directly into your pull request workflow by posting size change summaries as PR comments and status checks. | ||
|
|
||
| <Alert level="info"> | ||
| GitHub is currently the only supported VCS provider for Size Analysis. | ||
| </Alert> | ||
|
|
||
| ## Benefits | ||
|
|
||
| With the GitHub integration enabled, you get: | ||
|
|
||
| - **PR comments**: Automatic comments on pull requests showing size changes | ||
| - **Status checks**: Pass/fail checks based on size thresholds (coming soon) | ||
| - **Inline notifications**: See size impacts without leaving GitHub | ||
| - **Historical tracking**: Links to detailed comparisons in [sentry.io](https://sentry.io) | ||
|
|
||
| ## Installation | ||
|
|
||
| ### Install the Sentry GitHub App | ||
|
|
||
| The GitHub integration requires the Sentry GitHub App to be installed on your repository: | ||
|
|
||
| 1. Navigate to **Organization Settings > Integrations** in [sentry.io](https://sentry.io) | ||
| 2. Find the **GitHub** integration and click **Install** | ||
| 3. Follow the prompts to authorize the app for your GitHub organization | ||
| 4. Select the repositories where you want to enable Size Analysis | ||
|
|
||
| For detailed installation instructions, see the [GitHub integration documentation](https://docs.sentry.io/organization/integrations/source-code-mgmt/github/). | ||
|
|
||
| ### Configure Repository Access | ||
|
|
||
| Ensure the Sentry GitHub App has access to the repositories where you're uploading builds: | ||
|
|
||
| 1. Go to your GitHub organization settings | ||
| 2. Navigate to **Integrations > Applications** | ||
| 3. Click on **Sentry** | ||
| 4. Under **Repository access**, grant access to your repositories | ||
|
|
||
| ## How It Works | ||
|
|
||
| Once the integration is set up and you're uploading builds from your CI: | ||
|
|
||
| ### On Pull Requests | ||
|
|
||
| 1. **You open a PR**: Your CI builds the app and uploads it to Sentry | ||
| 2. **Base branch build**: Sentry finds the corresponding build from your base branch | ||
| 3. **Comparison**: Sentry compares the two builds | ||
| 4. **PR comment**: A comment is posted with the size change summary | ||
|
|
||
| ### Comment Content | ||
|
|
||
| The PR comment includes: | ||
|
|
||
| - **Total size change**: How much the app grew or shrank (for example, `+142 KB` or `-23 KB`) | ||
| - **Percentage change**: The relative impact (for example, `+2.3%`) | ||
| - **Component highlights**: The components that changed the most | ||
| - **Link to details**: A link to view the full comparison in [sentry.io](https://sentry.io) | ||
|
|
||
| ### Example PR Comment | ||
|
|
||
| ``` | ||
| ## 📊 Size Analysis | ||
|
|
||
| **App size changed by +142 KB (+2.3%)** | ||
|
|
||
| ### Largest Changes | ||
| - `Frameworks/MyFramework.framework`: +98 KB | ||
| - `Resources/Assets.car`: +52 KB | ||
| - `Binary`: -8 KB | ||
|
|
||
| [View detailed comparison →](https://sentry.io/...) | ||
| ``` | ||
|
|
||
| ## Requirements | ||
|
|
||
| For the GitHub integration to work with Size Analysis: | ||
|
|
||
| 1. **GitHub App installed**: The Sentry GitHub App must be installed on your repository | ||
| 2. **Builds from PRs**: You must upload builds from pull request CI runs | ||
| 3. **Base branch builds**: You must also upload builds from your main/base branch | ||
| 4. **Metadata**: Your build uploads must include PR metadata (auto-detected in GitHub Actions) | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Not Seeing PR Comments? | ||
|
|
||
| Check that: | ||
|
|
||
| - The Sentry GitHub App is installed and has access to your repository | ||
| - You're uploading builds from both PR branches and the base branch | ||
| - Your CI is running on pull request events | ||
| - The `SENTRY_AUTH_TOKEN` is set correctly in your CI environment | ||
| - Your builds have the same build configuration (for example, both are `Release` builds) | ||
|
|
||
| ### Comments Not Updating? | ||
|
|
||
| - Make sure you're uploading a new build after each code change | ||
| - Check that the build configuration matches between PR and base builds | ||
| - Verify that the PR metadata (PR number, base SHA) is being detected correctly | ||
|
|
||
| ### Missing Base Build? | ||
|
|
||
| The first time you set up Size Analysis, your main branch may not have any builds yet: | ||
|
|
||
| 1. Merge a PR or push to your main branch to trigger a build | ||
| 2. Future PRs will be able to compare against this base build | ||
|
|
||
| ## Permissions | ||
|
|
||
| The GitHub App requires these permissions: | ||
|
|
||
| - **Read access to code**: To identify the repository and branches | ||
| - **Write access to pull requests**: To post comments on PRs | ||
| - **Write access to checks**: To create status checks (coming soon) | ||
|
|
||
| These permissions are requested during the GitHub App installation flow. | ||
|
|
||
| ## Next Steps | ||
|
|
||
| - [Upload your first build](/product/size-analysis/uploading-builds/) to start seeing size analysis |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| --- | ||
| title: Size Analysis (Mobile) | ||
| sidebar_order: 136 | ||
| description: Track and optimize your mobile app's binary size with automated uploads, detailed breakdowns, and build comparisons. | ||
| --- | ||
|
|
||
| <Include name="size-analysis/ea" /> | ||
|
|
||
| Size Analysis helps you monitor and optimize your mobile application's binary size. By tracking your app size across builds and releases, you can catch unexpected size increases, understand what's contributing to your app's footprint, and deliver faster downloads for your users. | ||
|
|
||
| ## Why Track App Size? | ||
|
|
||
| Mobile app size directly impacts user acquisition and retention. Smaller apps: | ||
|
|
||
| - Download faster, reducing user drop-off during installation | ||
| - Take up less storage space on user devices | ||
| - Are more likely to be downloaded on slower networks | ||
| - Update more quickly, improving user experience | ||
|
|
||
| Size Analysis gives you visibility into your app's size trends and helps you catch regressions before they reach production. | ||
|
|
||
| ## How Size Analysis Works | ||
|
|
||
| ### Track Size Across Builds | ||
|
|
||
| Upload your iOS (`.xcarchive`, `.ipa`) or Android (`.aab`, `.apk`) builds to Sentry as part of your CI pipeline. Size Analysis automatically extracts size metrics and tracks changes over time. [Get started with automated uploads](/product/size-analysis/uploading-builds/). | ||
|
|
||
| ### Compare Builds | ||
|
|
||
| When you open a pull request, Size Analysis automatically compares your PR build against the base branch, showing you exactly how your changes impact app size. View the results directly in [sentry.io](https://sentry.io) or receive status checks in GitHub. | ||
|
|
||
| ### Understand Size Contributors | ||
|
|
||
| Use the treemap and breakdown views in Sentry to see which components, frameworks, and resources contribute most to your app size so you can identify optimization opportunities quickly. | ||
|
|
||
| ### Integrate with Your Workflow | ||
|
|
||
| Set up the [GitHub integration](/product/size-analysis/github-integration/) to receive size change notifications as PR comments and status checks, making size considerations a natural part of your code review process. | ||
|
|
||
| ## Supported Platforms | ||
|
|
||
| - **iOS**: XCArchive (`.xcarchive`) and IPA (`.ipa`) files | ||
| - **Android**: Android App Bundle (`.aab`, preferred) and APK (`.apk`) files | ||
|
|
||
| ## Requirements | ||
|
|
||
| To use Size Analysis, you need: | ||
|
|
||
| - A Sentry account with access to any [core plan](https://sentry.io/pricing/) | ||
| - A Sentry auth token for uploading builds | ||
| - GitHub as your VCS provider (currently the only supported provider) | ||
|
|
||
| ## Learn More | ||
|
|
||
| <PageGrid /> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| --- | ||
| title: CLI Uploads | ||
| sidebar_order: 30 | ||
| description: Upload builds to Size Analysis with the Sentry CLI. | ||
| --- | ||
|
|
||
| The Sentry CLI can be used to upload any [accepted mobile build type](/product/size-analysis/uploading-builds/#supported-build-formats). | ||
|
|
||
| <Alert level="info"> | ||
| This guide assumes `sentry-cli` is already installed and authenticated. See | ||
| the [installation guide](/cli/installation/) and [configuration | ||
| steps](/cli/configuration/) for initial setup. | ||
| </Alert> | ||
|
|
||
| ## Upload iOS builds | ||
|
|
||
| ```bash | ||
| sentry-cli build upload app.xcarchive.zip \ | ||
| --org your-org \ | ||
| --project your-project \ | ||
| --build-configuration Release | ||
| ``` | ||
|
|
||
| ## Upload Android builds | ||
|
|
||
| ```bash | ||
| sentry-cli build upload app.aab \ | ||
| --org your-org \ | ||
| --project your-project \ | ||
| --build-configuration freeRelease # Adjust to your build flavor | ||
| ``` | ||
|
|
||
| ## Required metadata | ||
|
|
||
| When you run the CLI in GitHub Actions, metadata like `--repo-name`, `--vcs-provider`, `--pr-number`, `--head-sha`, `--base-sha`, `--head-ref`, and `--base-ref` is filled in automatically. Provide the same flags manually if you upload from another environment. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| --- | ||
| title: Fastlane Uploads | ||
| sidebar_order: 10 | ||
| description: Configure Size Analysis uploads for iOS projects using Fastlane. | ||
| --- | ||
|
|
||
| The Sentry Fastlane plugin can be used to upload any [accepted iOS mobile build type](/product/size-analysis/uploading-builds/#supported-build-formats). | ||
|
|
||
| <Alert level="info"> | ||
| This guide assumes you already have the Sentry Fastlane plugin in your project | ||
| (version `1.34.0` or higher). See the [Fastlane integration | ||
| guide](https://docs.sentry.io/platforms/apple/guides/ios/upload-debug-symbols/fastlane/) | ||
| for initial setup. | ||
| </Alert> | ||
|
|
||
| ## Configure a lane | ||
|
|
||
| ```ruby | ||
| lane :upload_to_sentry do | ||
| sentry_upload_build( | ||
| org_slug: 'your-org', | ||
| project_slug: 'your-project', | ||
| build_configuration: 'Release' # Adjust to your configuration | ||
| ) | ||
| end | ||
| ``` | ||
|
|
||
| If you already have a lane, add the `sentry_upload_build` action to it. | ||
|
|
||
| ## Run the lane | ||
|
|
||
| ```bash | ||
| bundle exec fastlane upload_to_sentry | ||
| ``` | ||
|
|
||
| ## Next steps | ||
|
|
||
| - View the [Sentry Fastlane plugin documentation](https://github.com/getsentry/sentry-fastlane-plugin) for advanced options | ||
| - Return to the [Size Analysis upload overview](/product/size-analysis/uploading-builds/) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Shall we mention something about the hybrids (RN, Flutter) that they also work through the native uploaded bundles?