Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make series tree-shakable #1714

Merged
merged 35 commits into from
Nov 13, 2024
Merged

Conversation

illetid
Copy link
Contributor

@illetid illetid commented Oct 23, 2024

Type of PR: enhancement
To achieve tree-shaking on series, removed add<SeriesType>Series methods, added generic addSeries method instead that expects series definition with internal createPaneView. To prevent exposing IChartModel to public I used @internal jsdoc tag to remove them from .d.ts.

Tests will be added in separate PR #1720 that will be merge into this after we fully agree with the implementation details, as not to bloat this PR to make it reviewable.
PR checklist:

  • Addresses an existing issue: fixes #
  • Includes tests
  • Documentation update

Overview of change:

Is there anything you'd like reviewers to focus on?

Copy link

github-actions bot commented Oct 23, 2024

size-limit report 📦

Path Size
ESM 42.33 KB (+0.06% 🔺)
ESM createChart 36.27 KB (-7.59% 🔽)
ESM createChartEx 35.06 KB (-7.73% 🔽)
ESM Standalone 43.79 KB (-0.11% 🔽)
Standalone 43.72 KB (-0.2% 🔽)
Plugin: Text Watermark 1.86 KB (0%)
Plugin: Image Watermark 1.68 KB (-0.18% 🔽)
Plugin: Series Markers 3.89 KB (-0.16% 🔽)
Series: LineSeries 2.54 KB (+100% 🔺)
Series: BaselineSeries 3.05 KB (+100% 🔺)
Series: AreaSeries 2.98 KB (+100% 🔺)
Series: BarSeries 2.14 KB (+100% 🔺)
Series: CandlestickSeries 2.43 KB (+100% 🔺)
Series: HistogramSeries 2.2 KB (+100% 🔺)

@illetid illetid marked this pull request as ready for review November 4, 2024 17:02
@illetid illetid requested a review from SlicedSilver November 4, 2024 17:02
@SlicedSilver SlicedSilver added this to the 5.0 milestone Nov 4, 2024
@SlicedSilver SlicedSilver added enhancement Feature requests, and general improvements. breaking change Changes the API in a non backwards compatible way. labels Nov 4, 2024
.size-limit.js Outdated Show resolved Hide resolved
src/gui/chart-widget.ts Outdated Show resolved Hide resolved
src/model/series/area-pane-view.ts Outdated Show resolved Hide resolved
src/model/series/area-series.ts Outdated Show resolved Hide resolved
src/index.ts Show resolved Hide resolved
tests/type-checks/series.ts Outdated Show resolved Hide resolved
src/model/series/create-custom-series.ts Outdated Show resolved Hide resolved
src/model/series/series-def.ts Outdated Show resolved Hide resolved
src/model/series/series-def.ts Outdated Show resolved Hide resolved
src/api/ichart-api.ts Outdated Show resolved Hide resolved
@illetid illetid requested a review from SlicedSilver November 6, 2024 09:24
Copy link
Contributor

@SlicedSilver SlicedSilver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In principle this looks good and we can proceed with a PR to merge the updated tests and documentation into this branch.

Once that PR is merged into this branch then we can add approval to this PR.

src/model/series/series-def.ts Outdated Show resolved Hide resolved
@illetid illetid force-pushed the feature/add-series-tree-shakable branch from 7c7015f to 140a653 Compare November 11, 2024 13:13
@illetid illetid merged commit 40c8cc5 into v5-candidate Nov 13, 2024
32 of 48 checks passed
@illetid illetid deleted the feature/add-series-tree-shakable branch November 13, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Changes the API in a non backwards compatible way. enhancement Feature requests, and general improvements.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants