feat: cache local Expo builds on disk - #46
Merged
Conversation
Add a buildCacheProvider in app.json using expo-build-disk-cache so `yarn ios`/`yarn android` reuse a previously built binary from node_modules/.expo-build-disk-cache when the native fingerprint is unchanged, skipping a full native rebuild. Disk-only for now; a remote provider can be added later via the provider's remotePlugin option. Docs updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KPWjhmaeq8DnsiiFD9Eg7A
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.
This PR resolves [making local native builds fast by caching them]
Description
Adds an Expo build cache provider so
yarn ios/yarn androidreuse a previously built native binary instead of recompiling from scratch when nothing native changed — mirroring the approach in Energy.app.json— addsexpo.buildCacheProviderusingexpo-build-disk-cache, caching tonode_modules/.expo-build-disk-cache.package.json— addsexpo-build-disk-cache(devDependency).AGENTS.md(Expo Prebuild) anddocs/getting-started.mddocument the disk cache.How it works:
expo run:*computes a fingerprint of the native project; if a cached build with the same fingerprint exists on disk, it's installed directly, skipping the Gradle/Xcode build. Change a native dependency orapp.jsonand the fingerprint changes, triggering a fresh build.Disk-only for now, per the request — the cache lives under
node_modules/(already gitignored).expo-build-disk-cachealso supports aremotePlugin(e.g. an S3 provider, as Energy uses) which can be layered on later without changing call sites.CI impact: none — CI builds via
expo prebuild+ Gradle directly (notexpo run), so the provider isn't exercised there;type-check/test/lintare unaffected.PR Checklist
To the reviewers 👀
yarn ios/yarn androidtwice to see the cache hit)🤖 Generated with Claude Code
https://claude.ai/code/session_01KPWjhmaeq8DnsiiFD9Eg7A
Generated by Claude Code