feat: Use URL-safe base64 for auto-generated message keys of useExtracted#2330
Merged
Merged
Conversation
Standard base64 uses `+/` which produces keys like `/qP5M+`. When these keys appear in serialised page data, Googlebot treats the `/`-prefixed ones as relative URL paths and reports them as 404s in Search Console. The reporter in amannn#2250 observed ~56 of 3361 keys starting with `/`. Switch the encoder to URL_SAFE_NO_PAD which uses `-_` instead. The hash input is unchanged, so keys deriving from the same message remain stable shape (still 6 chars, still SHA-512 prefix), but no longer collide with URL-significant characters. useExtracted is still flagged experimental, so the maintainer noted on amannn#2250 that the key hash is open to change. Auto-extracted keys are regenerated from the canonical messages on every build, so consumers who haven't pinned key strings will see them refresh on next build. Fixture snapshots regenerated; all 28 cargo tests pass. Fixes amannn#2250
|
Someone is attempting to deploy a commit to the next-intl Team on Vercel. A member of the Team first needs to authorize it. |
Closed
3 tasks
Owner
|
Hey @spokodev, thanks for opening this PR! Yes, I think this is the right approach and that we should go with this. Let me see when we can release this, I'll get back to you … |
Contributor
Author
|
Thanks for the quick look, @amannn — appreciated. Happy to rebase if anything drifts before the release window. Flipping out of draft. |
|
Deployment failed with the following error: |
78fe5d0 to
7f0bc19
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
useExtracted
7f0bc19 to
78fe5d0
Compare
spokodev
added a commit
to spokodev/spoko-studio
that referenced
this pull request
Jun 4, 2026
Activates /upstream page in header nav (gate publishedCount >= 3 now satisfied): - amannn/next-intl#2330 — URL-safe base64 for auto-generated message keys - raycast/extensions#28425 — Hong Kong and Macau ISO codes for own flags - firefox-devtools/profiler#6085 — clip flame-graph filter bar overflow EN + UK summaries hand-authored; six other locales seeded as EN stubs pending pnpm translate polish.
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.
Auto-generated
useExtractedmessage keys now use URL-safe base64 (-_) instead of standard base64 (+/).Standard base64 can produce keys starting with
/(e.g./qP5M+). When those keys appear in serialized page data, Googlebot treats/-prefixed values as relative URL paths and reports 404s in Search Console (#2250).The hash input is unchanged (still SHA-512, first 6 characters). Only the alphabet differs—keys no longer contain URL-significant
+or/characters.// messages/en.json (example) { - "+YJVTi": "Hey!", + "-YJVTi": "Hey!", "NhX4DJ": "Hello" }Breaking change
Keys for messages whose hash previously encoded
+or/in the first 6 characters get a new ID (e.g.+YJVTi→-YJVTi,nm/7yQ→nm_7yQ). Most keys are unaffected.To migrate, in all locale catalogs, search & replace message keys only (JSON keys /
msgidvalues—notmsgstrcontent):+→-/→_Only keys that previously contained
+or/need updating, most keys are unchanged.Fixes #2250