Repository navigation
feat: add opt-in lightweight SVG motion - #232
Conversation
🦋 Changeset detectedLatest commit: 7b6322c The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
View your CI Pipeline Execution ↗ for commit 7b6322c
☁️ Nx Cloud last updated this comment at |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
What changed
Adds
motionLite()from@tanstack/charts/motion/litefor a whole-chart fade entrance and basic keyed SVG updates. Existingmotion()imports, behavior, and tooltip motion inheritance are unchanged.This is a smaller opt-in contract for #205, reported by @toomingos. It does not include springs, definition-local timing, rolling paths, specialized bar/arc entrances, or interpolated interaction points. The reference explains those limits and when to keep full motion.
The new entry adopts server SVG without replaying entrance, respects reduced motion, commits resize immediately by default, continues its entrance across data updates, and cancels animation on destruction. It uses the existing SVG renderer and reconciler without adding runtime dependencies.
Evidence
All 114 existing consumer bundles are byte-identical to main.
All 60 comparison size records are unchanged. Only the source fingerprint/revision refresh is approved.
Standalone export: 25.713 kB minified, 9.541 kB gzip, 8.720 kB Brotli. Full motion: 69.396 / 23.192 / 20.534 kB.
Same bar-chart consumer: 120.186 / 43.752 / 38.641 kB, compared with full motion at 168.856 / 59.250 / 51.411 kB. Different feature contracts, not functional parity.
Chromium, Firefox, and WebKit cover interruption, entrance continuity, hydration, resize, reduced motion, line/pie endpoints, authored opacity, and cleanup.
Packed consumer checks exclude full motion, springs, tooltip implementation, and D3 from the lightweight export.
Required
pnpm validatepasses all 19 tasks, including 2,249 unit tests, adapter/type/packed/documentation checks and both bundle gates. Maintainedpnpm buildpasses.All 188 normally regenerated catalog SVGs are unchanged; only the source manifest hash changed.
React Strict Mode passes interrupted updates and unmount cleanup in all three browsers.
Seven paired Chromium trials of 20 synchronous updates of 1,000 points: median 83.2 ms with existing SVG tweening, 80.5 ms with the lightweight renderer. This measures update work, not frame rate or full motion parity.
Includes a minor Changeset. The fixed package group plans 1.2.0 for the 12 public packages. No CI jobs, runtime dependencies, existing bundle ceilings, or default interaction policies change.
Summary by CodeRabbit
New Features
motionLiterenderer for whole-chart fade entrances and basic transitions between keyed SVG updates. It supports configurable duration and easing, respects reduced-motion preferences, and skips animations in specified resize scenarios.Documentation