fix(seo): define a bounded canonical URL strategy for NPM Stats
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 冷清
- 技術堆疊
- typescript
研究方向
從 src/routes/stats/npm/index.tsx 開始,特別檢查路由驗證和 staticData.includeSearchInCanonical,接著追蹤 canonical、結構化資料、內部連結和 sitemap 的行為。在實作之前,先定義有界的語義與呈現 URL 模型,並為預設、套件、具 scope 的套件、比較、僅 UI 和無效組合新增測試。完成的標準是,只有穩定且有意義的 URL 可被索引,且其 metadata 相符。
由索引模型根據 Issue 內容生成。
描述
Problem
The clean /stats/npm URL currently redirects to a URL that serializes the complete default chart state. In a live audit, the resulting canonical URL was 2,355 characters long.
The route validates defaults for packageGroups, range, chart type, transforms, playback controls, legend state, dimensions, and other UI settings, then staticData.includeSearchInCanonical causes all of those values to become canonical. Each user interaction can therefore create another indexable URL.
Relevant route: src/routes/stats/npm/index.tsx
Google warns that parameter-driven faceted navigation can generate effectively infinite crawl spaces and slow discovery of useful pages: https://developers.google.com/crawling/docs/faceted-navigation
Goals
- Keep NPM Stats URLs shareable.
- Index only clean, stable pages with meaningful search intent.
- Prevent display and playback controls from creating indexable canonical variants.
Proposed direction
- Make /stats/npm a stable 200 URL with a clean self-canonical, or normalize to another intentionally short canonical URL.
- Omit default values from serialized search parameters.
- Separate semantic state from presentation state.
- Treat parameters such as range, transform, bin type, view mode, chart type, sorting, dimensions, playback, legend visibility, and similar controls as non-indexable UI state.
- Define a bounded format for package or package-comparison pages that should be indexable, potentially using stable path-based package identifiers rather than encoded JSON.
- Canonicalize or noindex non-semantic variants according to the chosen model.
- Ensure scoped package paths resolve correctly and have one canonical encoding.
- Make WebApplication JSON-LD url and any BreadcrumbList URLs match the selected canonical.
- Review FAQPage JSON-LD. Google does not normally show FAQ rich results for non-government and non-health sites, so retain it only if another consumer justifies the maintenance.
Acceptance criteria
- Loading /stats/npm does not redirect to a URL containing the full default chart configuration.
- The default canonical is short, stable, and self-referencing.
- Default values are omitted from generated links.
- Presentation-only variants do not self-canonicalize as independently indexable pages.
- Any intentionally indexable comparison page has unique SSR title, description, H1, canonical, and structured data based on the compared packages.
- Nonsensical or empty package combinations return an appropriate 404 or noindex response rather than another indexable state.
- Tests cover default state, one package, scoped packages, multi-package comparison, UI-only controls, and invalid combinations.
- Internal links and sitemap entries expose only the bounded set of indexable URLs.
- 主要語言
- TypeScript
- 星號
- 1.1k
- 分支
- 400
- 平均合併
- 9 小時 56 分鐘
- 30 天內合併 PR
- 81
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
TanStack/tanstack.com 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
TanStack/tanstack.com#1353 ·
維護者通常 1 天內回覆
-
Checkbox in dropdown doesn't scroll with items可能已有人在做 @6TELOIV 於 10 天前認領。 未關閉
難度 1/5 1 小時以內 新手友好度 92/100
TanStack/tanstack.com#1304 ·
維護者通常 1 天內回覆
-
"bundle report" link navigates to 404 on Markdown docs可能已有人在做 @lukonik 於 40 天前認領。 未關閉source-audit
難度 1/5 1 小時以內 新手友好度 84/100
TanStack/tanstack.com#1195 ·
維護者通常 1 天內回覆
-
source-audit
難度 2/5 1-3 小時 新手友好度 68/100
TanStack/tanstack.com#1194 · 2 則留言 ·
維護者通常 1 天內回覆
-
source-audit
難度 2/5 1-3 小時 新手友好度 72/100
TanStack/tanstack.com#1177 · 1 則留言 ·
維護者通常 1 天內回覆
查看 TanStack/tanstack.com 的全部 Issue
相似的 Issue
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:other issue-rating: 🦞 diamond lobster no-stale P2
難度 2/5 1-3 小時 新手友好度 72/100
openclaw/openclaw#168089 · 2 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆
-
✨ enhancement needs-discussion
難度 1/5 1 小時以內 新手友好度 85/100
-
[Bug]: [MCP/CLI] Bare loopback IP addresses (127.0.0.1:port) and hosts with ports fail to navigate due to erroneous scheme inference可能已有人在做 @alok-108 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
microsoft/playwright#43263 ·
維護者通常 1 天內回覆
-
area:studio type:security
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
enhancement good first issue Stellar Wave trivial
難度 2/5 1-3 小時 新手友好度 85/100
StellarCanary/ProtocolCanary-Action#331 ·
維護者通常 1 天內回覆