fix(seo): define a bounded canonical URL strategy for NPM Stats
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- typescript
Direção de pesquisa
Comece com src/routes/stats/npm/index.tsx, especialmente com a validação de rotas e staticData.includeSearchInCanonical, e depois rastreie o comportamento de URLs canônicas, dados estruturados, links internos e sitemap. Defina o modelo limitado de URL semântica versus apresentação antes de implementá-lo e adicione testes para combinações padrão, de pacote, de pacote com escopo, de comparação, apenas de UI e inválidas. Está concluído quando apenas URLs estáveis e significativas puderem ser indexadas e seus metadados corresponderem.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- TypeScript
- Estrelas
- 1.1k
- Forks
- 401
- Merge médio
- 16h 8min
- PRs com merge (30d)
- 58
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de TanStack/tanstack.com
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
TanStack/tanstack.com#1293 ·
-
source-audit
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 84/100
TanStack/tanstack.com#1195 ·
-
source-audit
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
TanStack/tanstack.com#1194 · 2 comentários ·
-
source-audit
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
TanStack/tanstack.com#1177 · 1 comentário ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
TanStack/tanstack.com#1059 ·
Todas as issues de TanStack/tanstack.com
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
vercel-labs/just-bash#464 ·
-
looksLikeSlug() is ASCII-only, so non-Latin entity slugs (e.g. Korean) skip exact match and collapse Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100