Skip to content

feat: improve Metro caching support#74

Merged
V3RON merged 5 commits intomainfrom
feat/improve-caching
Mar 18, 2026
Merged

feat: improve Metro caching support#74
V3RON merged 5 commits intomainfrom
feat/improve-caching

Conversation

@V3RON
Copy link
Copy Markdown
Contributor

@V3RON V3RON commented Mar 17, 2026

Description

Metro cache and manifest now live under the project root at .harness/ (e.g. .harness/metro-cache) instead of node_modules/.cache/rn-harness/. When cache is enabled and an existing cache is found, the harness logs that it is reusing the Metro cache for the current platform. @react-native-harness/metro exports path helpers (getHarnessRootPath, getHarnessManifestPath, getHarnessMetroCachePath, isMetroCacheReusable) that accept an optional project root for monorepos. E2E workflows cache .harness/metro-cache and use a content-based key (lockfiles + Metro/Babel configs) with an OS prefix for more reliable CI cache restore.

Context

A single .harness/ location survives reinstalls and is easier to cache in CI. Content-based cache keys improve cache hits when unrelated files change. The reuse log makes it clear when cache is used. Path helpers support correct cache paths in monorepos.

Testing

Run packages/metro path tests (paths resolve under project root; isMetroCacheReusable is false when dir is missing/empty, true when it has entries) and packages/jest harness-cache tests (reuse is logged only when unstable__enableMetroCache is true and cache exists). Manually: enable Metro cache, run harness twice and confirm the “Reusing Metro cache for ” message on the second run; in CI, confirm cache is stored under .harness/metro-cache and restored on the next run.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-native-harness Ready Ready Preview, Comment Mar 18, 2026 11:48am

Request Review

@V3RON V3RON merged commit 5cc5afc into main Mar 18, 2026
3 checks passed
@V3RON V3RON deleted the feat/improve-caching branch March 18, 2026 11:51
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.

1 participant