Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
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.