From fe81eb89bf89aaca0945359739ea846d37d466fc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 13:08:56 +0000 Subject: [PATCH] Version Packages (next) --- .changeset/pre.json | 6 ++++ packages/layerchart/CHANGELOG.md | 49 ++++++++++++++++++++++++++++++++ packages/layerchart/package.json | 2 +- 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/.changeset/pre.json b/.changeset/pre.json index 93d338d7d..74763b399 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -53,6 +53,7 @@ "calm-jars-mix", "canvas-group-opacity", "chart-data-precedence", + "chart-props-no-spread", "chatty-flies-bet", "chatty-shirts-rule", "chilly-games-hide", @@ -116,9 +117,11 @@ "fix-pattern-canvas", "fix-pie-arc-xrange", "fix-scale-band-invert", + "fix-series-state-effect-root", "fix-spline-series-props-opacity", "fix-text-negative-string-position", "fix-transform-projection-reactivity", + "fix-tween-on-mount", "fix-x1-y1-domain-filter-without-series", "flat-arcs-heal", "flat-cases-enter", @@ -169,6 +172,7 @@ "legal-parrots-beam", "legend-tooltip-indicator", "lemon-bats-change", + "little-flowers-drop", "loud-lies-film", "loud-paws-allow", "lovely-loops-ring", @@ -197,6 +201,7 @@ "open-bushes-run", "open-houses-vanish", "orientation-to-valueaxis", + "path-lazy-feature-allocation", "pattern-html-layer", "per-layer-primitive-variants", "piechart-arcchart-labels-prop", @@ -240,6 +245,7 @@ "shiny-mails-hug", "silver-baboons-smile", "silver-mugs-leave", + "skip-empty-markinfo-effect", "slow-hounds-hide", "slow-streets-look", "small-moles-jog", diff --git a/packages/layerchart/CHANGELOG.md b/packages/layerchart/CHANGELOG.md index de8892c55..6589ff458 100644 --- a/packages/layerchart/CHANGELOG.md +++ b/packages/layerchart/CHANGELOG.md @@ -1,5 +1,54 @@ # LayerChart +## 2.0.0-next.62 + +### Minor Changes + +- feat(Blur): Add Canvas support ([#449](https://github.com/techniq/layerchart/pull/449)) + +### Patch Changes + +- perf(Chart): Eliminate per-instance props spread in `ChartState` ([#857](https://github.com/techniq/layerchart/pull/857)) + +- fix(SeriesState): Avoid `derived_inert` crash when chart unmounts under a `` ([#855](https://github.com/techniq/layerchart/pull/855)) + + The `selectedKeys` sync effect was wrapped in `$effect.root`, creating an isolated scope that survived chart unmount. When the parent chart was destroyed (e.g. an example reloading inside the docs `` after an async `$derived` re-evaluated), the `#series` derived became inert while the orphaned effect kept reading it — producing `Reading a derived belonging to a now-destroyed effect may result in stale values` warnings followed by `TypeError: e.some is not a function`. The effect now lives in the constructor, scoped to the component that instantiated `SeriesState`, so it is torn down with the chart. + +- fix(Arc, RectClipPath, ChartClipPath): Restore on-mount tween animations ([#855](https://github.com/techniq/layerchart/pull/855)) + + Two related regressions introduced in the layer-component split (#848) prevented `motion` + `initial*` props from animating on mount. + + **`Arc`** — `motion`, `value`, `initialValue` and the rest of Arc's geometry props (`domain`, `range`, `startAngle`, `endAngle`, `innerRadius`, `outerRadius`, `cornerRadius`, `padAngle`, `track*`, `offset`) were not destructured in `Arc.base.svelte`, so they leaked through `{...restProps}` onto the inner ``. The forwarded `motion` made `Path` _also_ tween the path-string on top of the end-angle tween that `ArcState` already drives, producing visibly wrong arcs (NaN coordinates, runaway radii). They are now extracted and passed explicitly to `ArcState`. + + **`RectClipPath` / `ChartClipPath`** — `motion`, `initialX`, `initialY`, `initialWidth`, `initialHeight` were declared on the type but never consumed: the path was a plain `$derived` of the static `x`/`y`/`width`/`height` props, so passing `` rendered the final width on mount with no animation. Each dimension now flows through its own `createMotion` (using the corresponding `initial*` value as the animation start), and the path is built from the animated values. + +- perf: Reduce per-tick reactive overhead in `Path` / `Link` (force-simulation graphs) ([#855](https://github.com/techniq/layerchart/pull/855)) + + In mark-heavy scenes (force simulations with hundreds of links flowing through `Link → Path`) several reactive structures unconditionally subscribed every `` template updater to props that don't change on a tick, causing per-frame work to scale with the number of props × the number of marks. Each fix below is independent; together they take the lattice (n=20, 760 links) example from ~5–6 fps to ~9 fps during simulation. + + **`PathState.tweenedPathData` now reads only `pathData`, not all Path props.** + Pre-fix, the getter resolved `pathData` via `getProps()`, a function that constructs an object literal of every reactive Path prop. Each read of `tweenedPathData` (i.e. each per-tick `` update) therefore subscribed the updater to every Path prop and re-read all of them. `PathState` now takes a dedicated `getPathData` getter alongside `getProps`, and the hot-path tween / DOM read only touches `pathData`. `Path.svg.svelte` and `Path.canvas.svelte` pass them as separate getters. + + **`Link.base.svelte` passes a stable `getPathData` function rather than `motionPath.current` directly.** + Reading `motionPath.current` from `Link.base.svelte`'s template subscribed the entire `` block to every tick, forcing the parent's prop spread (`{...restProps}`) and `cls(...)` evaluation to re-run on every change. Passing a stable function reference moves the per-tick read inside ``'s own template, keeping `Link.base.svelte` stable. Requires the new `pathData?: string | (() => string)` form on `Path`. + + **`Path.svg.svelte` allocates `draw`-related state lazily.** + - `endPoint = createControlledMotion(..., { type: 'none' })` was created for every `Path`, even when no `draw` transition was configured. Now only created when `draw` is set. + - The `$effect` that tracked `tweenedPathData` for `startContent` / `endContent` positioning ran on every `Path`, even when neither prop was provided. Now only registered when at least one is set. + - `drawKey` is only ever set when `draw` is configured, so the `{#key c.drawKey}` block is a no-op for paths without a draw transition. The block stays unconditional — splitting it behind `{#if draw}` showed no measurable benefit over leaving the inert subscription in place. + + **`Path.svg.svelte` extracts styling props out of `...rest`.** + `pathData`, `class`, `fill` / `fillOpacity` / `stroke` / `strokeOpacity` / `strokeWidth` / `opacity` and `motion` are now destructured out of `$props()` rather than left in `...rest`, so the `` element's `{...rest}` spread doesn't re-evaluate every frame when those props change (`pathData` changes on every force-sim tick; `class` is typically a fresh `cls(...)` string per parent render). + + **`Link.base.svelte` drops a redundant prop spread.** + Removed `{...extractLayerProps(restProps, 'lc-link')}` before `{...restProps}` — the call's only contribution (`class`) was being immediately overridden by the explicit `class={cls('lc-link', …)}` that follows, making the spread pure overhead. + +- perf: Skip mark-info `$effect` for pixel-mode primitives ([#855](https://github.com/techniq/layerchart/pull/855)) + + `registerComponent` now probes `markInfo()` once at construction; if the result is initially empty (pixel-mode primitives where `cx`/`cy`/`r`/etc. are numbers rather than string/function accessors), it skips creating the tracking `$effect` entirely. Saves one effect frame per primitive — adds up in mark-heavy scenes (force simulations, scatter plots with hundreds of nodes). + + Trade-off: a primitive that starts in pixel mode and later flips to data mode at runtime (e.g. `cx` mutates from a number to a string) will not register a mark. Mark mode is typically static; if a chart needs runtime data-mode marks, define an explicit `series` on the chart instead. + ## 2.0.0-next.61 ### Minor Changes diff --git a/packages/layerchart/package.json b/packages/layerchart/package.json index 984e25522..2bd2c89e1 100644 --- a/packages/layerchart/package.json +++ b/packages/layerchart/package.json @@ -5,7 +5,7 @@ "license": "MIT", "repository": "techniq/layerchart", "homepage": "https://layerchart.com", - "version": "2.0.0-next.61", + "version": "2.0.0-next.62", "scripts": { "dev": "pnpm package:watch", "build": "svelte-package",