Skip to content

feat: cache local Expo builds on disk - #46

Merged
MounirDhahri merged 1 commit into
mainfrom
claude/expo-build-cache
Jul 10, 2026
Merged

feat: cache local Expo builds on disk#46
MounirDhahri merged 1 commit into
mainfrom
claude/expo-build-cache

Conversation

@MounirDhahri

Copy link
Copy Markdown
Member

This PR resolves [making local native builds fast by caching them]

Description

Adds an Expo build cache provider so yarn ios / yarn android reuse a previously built native binary instead of recompiling from scratch when nothing native changed — mirroring the approach in Energy.

  • app.json — adds expo.buildCacheProvider using expo-build-disk-cache, caching to node_modules/.expo-build-disk-cache.
  • package.json — adds expo-build-disk-cache (devDependency).
  • Docs — AGENTS.md (Expo Prebuild) and docs/getting-started.md document 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 or app.json and 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-cache also supports a remotePlugin (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 (not expo run), so the provider isn't exercised there; type-check/test/lint are unaffected.

PR Checklist

  • I have tested my changes on iOS and Android.
  • I have included screenshots or videos, or I have not changed the UI. (build tooling only)
  • I have added tests, or my changes don't require any.
  • I added an [app state migration], or my changes do not require one.
  • I have documented any follow-up work that this PR will require, or it does not require any. (optional remote cache provider later)

To the reviewers 👀

  • I would like at least one of the reviewers to run this PR on the simulator or device. (worth a local yarn ios/yarn android twice to see the cache hit)

🤖 Generated with Claude Code

https://claude.ai/code/session_01KPWjhmaeq8DnsiiFD9Eg7A


Generated by Claude Code

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
@MounirDhahri
MounirDhahri merged commit 9c2e05d into main Jul 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants