Conversation
0672846 to
0a8e15f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to next, this PR will be updated.
nextis currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, runchangeset pre exitonnext.Releases
layerchart@2.0.0-next.60
Minor Changes
breaking: Move heavy-dep components into sub-path exports (#845)
The following components are no longer re-exported from
'layerchart'and must be imported from new sub-paths:'layerchart/geo'—GeoCircle,GeoClipPath,GeoEdgeFade,GeoLegend,GeoPath,GeoPoint,GeoProjection,GeoRaster,GeoSpline,GeoTile,GeoVisible,Graticule,TileImage'layerchart/hierarchy'—Tree,Treemap,Pack,Partition'layerchart/force'—ForceSimulation'layerchart/graph'—Dagre,Sankey,Chord,RibbonThis 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.Voronoi/Hullstay at root (already lazy-loaded viaTooltipContext).Contour/Density/Raster/BoxPlot/Violin/Thresholdand high-level charts (LineChart,BarChart, etc.) remain at root.Migration: update affected imports, e.g.
Patch Changes
perf: Lazy-load opt-in features in
corepath (#845)5 components/dependencies that previously sat in every
<Chart>user's sync graph are now dynamically imported only when the corresponding feature is used:BrushContextinChart— only loads when<Chart brush={...}>is set (defaultundefined)DefaultTooltipinChartChildren— only loads whentooltipContextis set and no customtooltipsnippet is providedd3-quadtreeinTooltipContext— only loads whenmodeis'quadtree','quadtree-x', or'quadtree-y'SplineinGrid— only loads when rendering radial linear grid lines (<Chart radial>withradialY="linear")BarinHighlight— only loads when<Chart highlight={{ bar: ... }}>is set (defaultfalse)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.Also switches internal
@layerstack/svelte-actionsimports 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 unusedpopover.js— but it stops the Svelte REPL/CDN from eagerly fetching@floating-ui/dom(popover's transitive dep) when consumers loadlayerchartfrom a CDN.