mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #1010] Support non-standard directives in robots.ts via other field #224
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#224
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @github-actions[bot] on GitHub (May 2, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/1010
Upstream change
Next.js extended
MetadataRoute.Robotsso each rule can carry anothermap of non-standard per-user-agent directives (e.g. SeznamRequest-Rate, YandexClean-param) alongside the existingallow/disallow/crawlDelayfields.emits:
Array values expand into repeated lines and
null/undefinedentries are skipped. The new directives are scoped to theirUser-Agentblock and emitted betweenCrawl-delayand the trailing blank line.github.com/vercel/next.js@65340b2772Serializer change (
packages/next/src/build/webpack/loaders/metadata/resolve-route-data.ts):Why this matters for vinext
vinext implements
app/robots.{ts,js}resolution as part of its metadata route handling. To match Next.js parity we should:rule.other?: Record<string, string | number | Array<string | number>>on each rule.Crawl-delayand before the blank line separating user-agent blocks, with array values expanded into repeated lines andnull/undefinedskipped.MetadataRoute.Robotstype re-exported from ournext/*shims so users get type-safe access to the new field.Suggested work
packages/next/src/lib/metadata/types/metadata-interface.ts(factor out aRobotsRuleBasecontaining the optional fields plusother).otherdirectives in the correct position.resolveRobotstest cases (fromresolve-route-data.test.ts) coveringRequest-Rate, array-valuedClean-param, andnull/undefinedhandling.next/compat/routershim #403