[Bug] taro-vchart misses function-only spec updates and throws on cyclic specs
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- frontend
Direzione di ricerca
Inizia da componentDidUpdate in packages/taro-vchart/src/components/general-chart/index.tsx e packages/taro-vchart/src/components/web-chart/index.tsx, quindi esamina come viene chiamato updateSpec. Aggiungi test per le modifiche limitate alle funzioni e per gli spec ciclici, scegliendo e documentando la semantica di confronto e il costo di aggiornamento previsti. Il lavoro è completato quando le modifiche valide ai callback attivano updateSpec e l'input ciclico non genera più errori.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Version
@visactor/taro-vchart on develop at 0750d74cd6ea734e66897876506c78ca12680676
Link to Minimal Reproduction
The update guards in both of these components reproduce the comparison behavior directly:
packages/taro-vchart/src/components/general-chart/index.tsxpackages/taro-vchart/src/components/web-chart/index.tsx
For example, JSON.stringify({ formatter: () => 'old' }) and JSON.stringify({ formatter: () => 'new' }) are both {}. A cyclic object throws from JSON.stringify.
Steps to Reproduce
- Render a Taro VChart with a spec containing a formatter or another supported callback.
- Update the component with a new callback while leaving the serializable fields unchanged.
- Alternatively, update with a spec containing a circular reference.
Current Behavior
Both componentDidUpdate implementations use JSON.stringify to decide whether the spec changed. Function-only changes compare equal, so updateSpec is not called. Circular specs throw during the lifecycle method instead of reaching VChart.
Expected Behavior
Spec updates should use a comparison strategy that supports VChart's valid function-valued options and does not throw on cyclic input.
Environment
- OS: Windows 11
- Node.js: 20.20.2 and 24.14.1
- Package:
@visactor/taro-vchart
Any additional comments?
The comparison has existed since the component's initial implementation, and this package currently has no unit tests covering update behavior. A fix should choose and test the intended function-diff and cyclic-object semantics rather than replacing the guard without measuring update cost.
Related: #4254 reports that serializable spec updates do not refresh under Taro 4.x. This report isolates two comparator behaviors that are present in the wrapper code independent of Taro version: function-only changes compare equal and cyclic input throws. #4254 has no linked PR or commit and does not mention either comparator case.
I searched all 4,627 open/closed issues and pull requests locally after fetching their current metadata, including Taro spec updates, JSON.stringify, function specs, circular specs, and general-chart; I also reviewed the file history and repository Discussions (none). Apart from the broader #4254 above, I did not find an existing report or fix for these two cases.
- Lingua principale
- TypeScript
- Stelle
- 1.8k
- Fork
- 221
- Merge medio
- 1g 5h
- PR unite (30g)
- 27
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di VisActor/VChart
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
Tutte le issue di VisActor/VChart
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
motiondivision/motion#3849 ·
-
Add: S Play Event HD Apertacheck:passed streams:add
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
LiteLLM proxy response_cost (x-litellm-response-cost) is never applied to ChatModelOutput.cost Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
i-am-bee/beeai-framework#1697 · 1 reazione ·
-
Support bun dedupe Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
antfu/node-modules-inspector#214 ·