fix(seo): define a bounded canonical URL strategy for NPM Stats
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Calme
- Stack technique
- typescript
Piste de recherche
Commencez par src/routes/stats/npm/index.tsx, en particulier par la validation des routes et staticData.includeSearchInCanonical, puis suivez le comportement des URL canoniques, des données structurées, des liens internes et du sitemap. Définissez le modèle borné d’URL sémantique par rapport à la présentation avant de l’implémenter, et ajoutez des tests pour les combinaisons par défaut, de package, de package scoped, de comparaison, limitées à l’UI et invalides. Le travail est terminé lorsque seules les URL stables et pertinentes sont indexables et que leurs métadonnées correspondent.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- TypeScript
- Étoiles
- 1.1k
- Forks
- 401
- Merge moyen
- 18 h 44 min
- PR mergées (30 j)
- 55
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de TanStack/tanstack.com
-
source-audit
Difficulté 1/5 Moins d'une heure Accessibilité débutants 84/100
TanStack/tanstack.com#1195 ·
-
source-audit
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
TanStack/tanstack.com#1194 · 2 commentaires ·
-
source-audit
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
TanStack/tanstack.com#1177 · 1 commentaire ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
TanStack/tanstack.com#1059 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
TanStack/tanstack.com#1047 ·
Toutes les issues de TanStack/tanstack.com
Issues similaires
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
-
Mend: dependency security vulnerability untriaged
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100