fix: source island hash from Nuxt#641
Merged
Merged
Conversation
Nuxt 4.5 exposes getIslandHash (nuxt/nuxt#35583) so modules stop replicating the island hash algorithm. Add a #og-image/island-hash virtual that re-exports it on >=4.5, adapts computeIslandHash on 4.4.x and keeps the ohash replication only for older Nuxt. Cache keys, etags and component hashes now use fnv1a-64 + object-identity (same pair Nuxt adopted). URL signing keeps SHA-256 via ohash/crypto since a fast hash would be forgeable.
commit: |
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.
🔗 Linked issue
Related to nuxt/nuxt#35583
❓ Type of change
📚 Description
fetchIslandreplicated Nuxt's internal island hash with its own ohash call. Nuxt 4.5 exposesgetIslandHash(nuxt/nuxt#35583) specifically so this module stops doing that: once Nuxt changes the algorithm, the replication would 400 every island fetch withInvalid island request hash.A new
#og-image/island-hashnitro virtual picks the implementation from the installed Nuxt: re-exportgetIslandHashon >= 4.5, adaptcomputeIslandHashfromnuxt/dist/app/island-hash.json 4.4.x, ohash replication only for anything older.Non-crypto hashing (cache keys, etags, build-time component hashes) moves to
fnv1a-64+object-identity, the pair Nuxt adopted in the same PR. URL signing stays SHA-256 but now imports onlydigestfromohash/crypto, so full ohash only ships on pre-4.4 Nuxt. Signatures and cache keys regenerate on next build; nothing persists across builds that would break.