fix(seo): define a bounded canonical URL strategy for NPM Stats
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- typescript
調査の方向性
src/routes/stats/npm/index.tsx から始め、特にルートのバリデーションと staticData.includeSearchInCanonical を確認してから、canonical、構造化データ、内部リンク、sitemap の挙動を追跡します。実装前に、意味論と表示を分離した範囲限定の URL モデルを定義し、デフォルト、パッケージ、スコープ付きパッケージ、比較、UI のみ、無効な組み合わせについてテストを追加します。完了の定義は、安定した意味のある URL だけがインデックス可能で、そのメタデータが一致することです。
索引モデルが 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
- フォーク
- 401
- 平均マージ
- 18時間 44分
- マージ済み PR(30日)
- 55
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/tanstack.com のほかの issue
-
source-audit
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
TanStack/tanstack.com#1195 ·
-
source-audit
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
TanStack/tanstack.com#1194 · コメント 2 件 ·
-
source-audit
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
TanStack/tanstack.com#1177 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
TanStack/tanstack.com#1059 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
TanStack/tanstack.com#1047 ·
TanStack/tanstack.com の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
0xMiden/bridge-portal#132 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
area:tools bug good first issue help wanted priority:P2
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
TaewoooPark/Motifcode#14 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
newrelic-experimental/preflight#793 · コメント 1 件 ·