Reconciler removes host-added attributes; cartesian marks lack a documented class hook
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 819
- フォーク
- 49
- 平均マージ
- 12時間 9分
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/charts のほかの issue
-
Renderer treats a sub-pixel width difference as a resize, which cancels the `motion()` entranceオープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
TanStack/charts#182 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
brushX with `values` can shorten the selection range when it’s dragged to the plot edge対応中かも @andersk が 5 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
Grid and axis lines have no `shape-rendering` option, so hairlines anti-alias across two device rowsオープン
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
TanStack/charts の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
openwatersio/slackwater-database#281 ·
メンテナーはふだん 1 日以内に返信
-
accepted bug via-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
pingdotgg/t3code#18690 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Bayern feature:Application ready web
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
digitalfabrik/entitlementcard#3176 ·
メンテナーはふだん 7 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NanmiCoder/cc-haha#1533 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信