Reconciler removes host-added attributes; cartesian marks lack a documented class hook
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- data-visualization
Línea de trabajo
Start with the failing repro in packages/charts-core/test-repro/11-renderer-dom.test.ts and the syncAttributes removal loop in src/reconcile.ts (around lines 165-167); the animated path is in src/motion.ts (around lines 2204-2214), and focus layers re-render near line 1209. Done means the repro passes on both paths, with the design choice (reserved prefix versus a preserveAttributes option) settled by maintainers first. Part B, the missing className option on cartesian marks, is a separate docs-and-options change.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
An app cannot keep its own per-node state (a data-* marker, a CSS custom property) on renderer nodes, because the reconciler strips it on the next rebuild. Cartesian marks also have no documented class hook.
A. Reconciler removes host-added attributes
syncAttributesruns for every retained element and removes each attribute the next scene element does not emit, includingstyle,data-*andclass: reconcile.ts:165-167.- The animated path does the same, exempting only
data-ts-motion-role,transformandopacity: motion.ts:2204-2214. - Focus layers are re-rendered through the same reconciler on each focus change, so a host write there is lost: motion.ts:1209-1211.
- The docs mention
data-ts-keymatching but not host attributes: rendering-and-export.md:130.
Repro: packages/charts-core/test-repro/11-renderer-dom.test.ts (vitest + jsdom)
import { expect, it } from 'vitest'
import { reconcileChartSvg } from '../src/reconcile'
const svg = (extra = '') =>
`<svg xmlns="http://www.w3.org/2000/svg"><circle data-ts-key="a" class="ts-chart__dot" cx="1" cy="1" r="2"${extra}/></svg>`
it('keeps host-added attributes on a retained node across a rebuild', () => {
const container = document.createElement('div')
reconcileChartSvg(container, svg())
const node = container.querySelector('circle')!
node.setAttribute('data-x-active', '1')
node.style.setProperty('--x-glow', '1')
reconcileChartSvg(container, svg(' cx="5"')) // same key, cx changes
expect(container.querySelector('circle')).toBe(node) // node is retained
expect(node.getAttribute('data-x-active')).toBe('1')
expect(node.style.getPropertyValue('--x-glow')).toBe('1')
})
Actual (pnpm vitest run packages/charts-core/test-repro/11-renderer-dom.test.ts): AssertionError: expected null to be '1' at the data-x-active assertion. The test covers the non-animated reconciler only.
Expected: attributes the scene never emits (a documented prefix such as data-x-*, or custom properties inside style) are left alone on retained nodes. Preferred: skip removal for a reserved prefix in both syncAttributes loops. Alternative: a reconcile.preserveAttributes: string[] host option.
B. Cartesian marks: no documented class hook
- Polar, sunburst and geo marks document
className(polar.md:42); line, area, dot, rule, text and bar marks do not. - Their
ts-chart__*classes exist in source (line.ts:356, bar.ts:399) but are undocumented. - A workaround exists:
ChartMark.initializeis public (types.ts:1199), andwhenFocusedwraps it (focus-mark.ts:33-35). No doc shows this recipe, and it cannot reach axis or focus-guide nodes.
Expected: add className to cartesian mark options (and axis / focus-guide options), matching polar. Alternative: document the wrapper recipe and which ts-chart__* names are stable. A class hook does not replace A for per-node dynamic state.
- Lenguaje dominante
- TypeScript
- Estrellas
- 819
- Forks
- 49
- Merge medio
- 12 h 9 min
- PR fusionados (30 d)
- 6
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TanStack/charts
-
Renderer treats a sub-pixel width difference as a resize, which cancels the `motion()` entranceAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
TanStack/charts#182 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
brushX with `values` can shorten the selection range when it’s dragged to the plot edgePosiblemente ocupada @andersk la tomó hace 5 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Grid and axis lines have no `shape-rendering` option, so hairlines anti-alias across two device rowsAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
Todos los issues de TanStack/charts
Issues similares
-
area:tui enhancement platform:macos
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
anthropics/claude-code#101490 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
netlify/netlify-mcp#75 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
atlassian-labs/compiled#1960 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
pnp/cli-microsoft365#7639 ·
Los mantenedores suelen responder en 2 días
-
nextjs-tracking
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
cloudflare/vinext#3887 ·
Los mantenedores suelen responder en 1 día