Repository navigation
fix(cli): the web build fingerprint hashes file content, so an identical rewrite keeps the cache - #575
Merged
Conversation
…cal rewrite keeps the cache
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.
fingerprint(), the web build cache key used byrun/build, hashed each file's path + size + mtime. A step that rewrites a file with identical bytes gives it a fresh mtime, so the cache was thrown away for nothing.nativeFingerprint()already hashes content for exactly this reason (generateAssetsre-stamps byte-identical files, and an mtime hash there never hit).This switches
fingerprint()to path + content. The walk,SKIP_DIRS(.outputincluded) andSKIP_FILESare unchanged. The measured cost (2026-09-02, playground app, 422 files / 11.0 MB) is 11.3 ms by content against 3.0 ms by mtime, in a 29 s build. CLI output does not change.docs/roadmap/dev-loop-debt.mddrops §B into its "discharged" table, and the roadmap README count moves from four items to three. The old suggested-order note tied §B to the "framework-only change reports✓ web build · cached" bug indocs/DEVELOPMENT.md. This change does not fix that bug: neither fingerprint hashes framework source. The note now sits under "Known-unfixed" with that explanation.Reproduce:
Verify:
npx vitest run bin/lib/fingerprint.test.mjs. On main without the fix: 1 failed | 12 passed. Fails onfingerprint — did anything the web bundle is built FROM change? > holds when a step rewrites a file with identical bytes and a fresh mtime — what it contains, not when it was touched. With the fix: 13 passed.pnpm gate: exit 0. Biome checked 739 + 403 files with no fixes. Test Files 344 passed | 1 skipped (345), Tests 5108 passed | 17 skipped (5125). publint, attw and the dist checks passed.Tested on: Linux (WSL2), Node 22, unit suite + full gate.
Not tested: a real
adaptv build ios/runcache hit on a device. Only the hash function changes, and the existing callers compare it as before.