Skip to content

Commit 9c074ba

Browse files
Version Packages (next) (#846)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 723889c commit 9c074ba

3 files changed

Lines changed: 45 additions & 2 deletions

File tree

.changeset/pre.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"standalone": "0.0.1",
1010
"svelteux-2": "0.0.1",
1111
"docs": "0.0.1",
12-
"skeleton4": "0.0.1"
12+
"skeleton4": "0.0.1",
13+
"@layerchart/bundle-analyzer": "0.0.0"
1314
},
1415
"changesets": [
1516
"add-boxplot-component",
@@ -164,6 +165,7 @@
164165
"large-spiders-stay",
165166
"late-glasses-itch",
166167
"layer-context-rename",
168+
"lazy-load-opt-in-features",
167169
"legal-parrots-beam",
168170
"legend-tooltip-indicator",
169171
"lemon-bats-change",
@@ -258,6 +260,7 @@
258260
"spline-reactive-motion",
259261
"spotty-plums-invite",
260262
"spotty-rules-taste",
263+
"subpath-exports",
261264
"swift-gifts-flow",
262265
"tall-mice-tap",
263266
"tall-poems-take",

packages/layerchart/CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,45 @@
11
# LayerChart
22

3+
## 2.0.0-next.60
4+
5+
### Minor Changes
6+
7+
- breaking: Move heavy-dep components into sub-path exports ([#845](https://github.com/techniq/layerchart/pull/845))
8+
9+
The following components are no longer re-exported from `'layerchart'` and must be imported from new sub-paths:
10+
- `'layerchart/geo'``GeoCircle`, `GeoClipPath`, `GeoEdgeFade`, `GeoLegend`, `GeoPath`, `GeoPoint`, `GeoProjection`, `GeoRaster`, `GeoSpline`, `GeoTile`, `GeoVisible`, `Graticule`, `TileImage`
11+
- `'layerchart/hierarchy'``Tree`, `Treemap`, `Pack`, `Partition`
12+
- `'layerchart/force'``ForceSimulation`
13+
- `'layerchart/graph'``Dagre`, `Sankey`, `Chord`, `Ribbon`
14+
15+
This isolates each group's external d3 dependency (`@dagrejs/dagre` ~22 KB, `d3-geo` ~15 KB, `d3-force` ~7 KB, `d3-hierarchy` ~6 KB, `d3-sankey` ~6 KB, `d3-chord` ~2 KB) behind an opt-in import — defending against bundlers that don't tree-shake the root barrel cleanly.
16+
17+
`Voronoi`/`Hull` stay at root (already lazy-loaded via `TooltipContext`). `Contour`/`Density`/`Raster`/`BoxPlot`/`Violin`/`Threshold` and high-level charts (`LineChart`, `BarChart`, etc.) remain at root.
18+
19+
**Migration:** update affected imports, e.g.
20+
21+
```diff
22+
-import { Tree, GeoPath, ForceSimulation } from 'layerchart';
23+
+import { Tree } from 'layerchart/hierarchy';
24+
+import { GeoPath } from 'layerchart/geo';
25+
+import { ForceSimulation } from 'layerchart/force';
26+
```
27+
28+
### Patch Changes
29+
30+
- perf: Lazy-load opt-in features in `core` path ([#845](https://github.com/techniq/layerchart/pull/845))
31+
32+
5 components/dependencies that previously sat in every `<Chart>` user's sync graph are now dynamically imported only when the corresponding feature is used:
33+
- `BrushContext` in `Chart` — only loads when `<Chart brush={...}>` is set (default `undefined`)
34+
- `DefaultTooltip` in `ChartChildren` — only loads when `tooltipContext` is set and no custom `tooltip` snippet is provided
35+
- `d3-quadtree` in `TooltipContext` — only loads when `mode` is `'quadtree'`, `'quadtree-x'`, or `'quadtree-y'`
36+
- `Spline` in `Grid` — only loads when rendering radial linear grid lines (`<Chart radial>` with `radialY="linear"`)
37+
- `Bar` in `Highlight` — only loads when `<Chart highlight={{ bar: ... }}>` is set (default `false`)
38+
39+
Result: **~10 KB gz off `core`** (115.6 → 105.25 KB) and comparable savings on every cartesian/geo/graph/hierarchy scenario, with no impact on rendered output for users who already opt into these features.
40+
41+
Also switches internal `@layerstack/svelte-actions` imports from the barrel (`@layerstack/svelte-actions`) to sub-paths (`@layerstack/svelte-actions/styles`, `@layerstack/svelte-actions/portal`). No production bundle effect — bundlers already tree-shake the unused `popover.js` — but it stops the Svelte REPL/CDN from eagerly fetching `@floating-ui/dom` (popover's transitive dep) when consumers load `layerchart` from a CDN.
42+
343
## 2.0.0-next.59
444

545
### Patch Changes

packages/layerchart/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "MIT",
66
"repository": "techniq/layerchart",
77
"homepage": "https://layerchart.com",
8-
"version": "2.0.0-next.59",
8+
"version": "2.0.0-next.60",
99
"scripts": {
1010
"dev": "pnpm package:watch",
1111
"build": "svelte-package",

0 commit comments

Comments
 (0)