Repository navigation
feat(docs): update docs about fonts + proguard rules - #1479
Merged
Merged
Conversation
|
@CristiCeban is attempting to deploy a commit to the Callstack Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 65ed637 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
dannyhw
reviewed
Oct 8, 2026
dannyhw
approved these changes
Oct 9, 2026
dannyhw
approved these changes
Oct 9, 2026
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.
Follow-up to #1473. Two small changes found while testing
5.4.1-canary-20261005140324on a React Native 0.87 app that uses React Native Skia:1. Docs: Android asset output and fonts
api/loaders/assets-loader.mdsaid Android assets go only todrawable-*. In release builds they actually go todrawable-*,fontorrawdepending on type. Since fix: support Android font assets in Skia #1473, font files are written to bothfontandraw, andraw/keep.xmlis generated. I added a table of where each asset type goes, explained why fonts are written twice and whatkeep.xmlis for, and noted that dev-server builds and remote assets don't use this layout.docs/guides/fonts.md:useFont(require(...))): works without setup.<Text fontFamily>: React Native doesn't look up fonts inres/fontby itself. Link fonts natively (recommended), or register the Re.Pack-emitted resource withReactFontManager.addCustomFont(release builds only)..ttc: not in the default asset extensions, so it needs an extra loader rule.2. Android: consumer R8 rules
With
minifyEnabled true, release builds of apps using Re.Pack fail:The Gson copy bundled inside
nimbus-jose-jwt(used for code signing, bumped to 10.8 in #1358) references Error Prone annotations, which are only needed at compile time. Re.Pack ships no consumer R8 rules, so each app currently has to add a-dontwarnitself. This PR addsandroid/consumer-rules.prowith-dontwarn com.google.errorprone.annotations.**and wires it up throughconsumerProguardFiles, so R8 builds work without app changes.Alternative: document the rule for users to add (as requested in #1198). Shipping it with the library seemed better because it fixes the build for everyone without extra setup.
Not included: the Gson
TypeTokenkeep rules for code signing from #1198. They weren't tested with R8 here, and they would need to target the shaded package (com.nimbusds.jose.shaded.gson).Test plan
Test app: RN 0.87.1,
@callstack/repack@5.4.1-canary-20261005140324,@shopify/react-native-skia@2.14.0, with TTF, OTF and TTC fonts loaded through SkiauseFont(require(...))and native<Text fontFamily>.R8 consumer rules (Android release,
minifyEnabled true+shrinkResources true)android/build.gradleMissing class com.google.errorprone.annotations.CanIgnoreReturnValueconsumerProguardFiles "consumer-rules.pro"The app had no
-dontwarnrules of its own in either run.Docs
pnpm buildinwebsite/succeeds with no broken-link warnings./docs/guides/fontsrenders and appears in the Guides sidebar./api/loaders/assets-loader#android-resource-directories, and to/api/utils/constants#asset_extensions, resolve.<Text>: natively linked fonts render in all builds;addCustomFontwith the Re.Packfontresource works in Android release only.