Shrink release APK 68% and fix broken release bundling#59
Merged
Conversation
The release JS bundle could not build at all: graphql v17 ships .mjs using `export * as Kind from ...`, which the RN Babel preset doesn't transform. CI only runs assembleDebug (Metro serves JS live, no bundling), so it never surfaced — but any v* release tag would have failed. Add the export-namespace-from Babel plugin to fix it. Also cut the shipped APK ~68% (110 MB -> 35 MB) with no product-code changes: ship arm64-v8a only (every target device is 64-bit ARM; the other three ABIs are dead weight and also 4x the build time), and enable R8 + resource shrinking on release builds. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Three small config changes (no product code), measured with real
assembleReleasebuilds.Fixes a broken release build. The release JS bundle could not build at all:
graphqlv17 ships.mjsusingexport * as Kind from ...(export-namespace-from), which the RN Babel preset doesn't transform. CI only runsassembleDebug— Metro serves JS live and skips bundling — so it never surfaced, but anyv*release tag would have failed. Adding@babel/plugin-transform-export-namespace-from(already a transitive dep) fixes it.Shrinks the shipped APK ~68%: 110 MB → 35 MB.
-PreactNativeArchitectures=x86_64.Notes / risk
enableProguardInReleaseBuilds = falseand you're still at 39 MB.tsc, biome, jest all pass; release APK builds and is structurally correct (single ABI, all expected libs + bundle present). Not runtime-verified — no arm64 device/emulator available in this environment.