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

[charts] Stabilize useSeries and useXxxSeries hooks #15545

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

JCQuintas
Copy link
Member

@JCQuintas JCQuintas commented Nov 21, 2024

Also added docs to all public hooks

Changelog

  • The useSeries and useXxxSeries have been stabilized and renamed accordingly. Removing the unstable_ prefix. — Learn more.

@JCQuintas JCQuintas added breaking change component: charts This is the name of the generic UI component, not the React module! v8.x labels Nov 21, 2024
@JCQuintas JCQuintas self-assigned this Nov 21, 2024
@mui-bot
Copy link

mui-bot commented Nov 21, 2024

Copy link

codspeed-hq bot commented Nov 21, 2024

CodSpeed Performance Report

Merging #15545 will degrade performances by 10.6%

Comparing JCQuintas:remove-unstable-useseries (6d2192a) with master (7914aa5)

Summary

⚡ 1 improvements
❌ 1 regressions
✅ 4 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark master JCQuintas:remove-unstable-useseries Change
BarChartPro with big data amount 325.5 ms 364.1 ms -10.6%
ScatterChartPro with big data amount 193.8 ms 174.9 ms +10.83%

@alexfauquette
Copy link
Member

I'm wondering if the current hook is the best DX. If we provide something like

useBarSeries(['seriesId1', 'seriesId2']) // Returns the config of the series
useBarSeries() // Returns all bar series in the correct order

It might be easier to use

@JCQuintas
Copy link
Member Author

Do you see a lot of value in returning an array for allowing multiple items to be returned or only allow one return per call?

const a = useSeries('a')
const b = useSeries('b')

vs

const [a,b] useSeries('a', 'b')

@alexfauquette
Copy link
Member

The array has the advantage to be easier to understand and to allow adding extra arguments later. But I'm not sure if passing an array like useBarSeries(['seriesId1', 'seriesId2']) could cause perf issue because at each render it would creat a new array 🤔

Maybe we should wait for the end of the plugin migration to see if one DX allows easier perf otpimisation than the other

@JCQuintas
Copy link
Member Author

The array has the advantage to be easier to understand and to allow adding extra arguments later. But I'm not sure if passing an array like useBarSeries(['seriesId1', 'seriesId2']) could cause perf issue because at each render it would creat a new array 🤔

Maybe we should wait for the end of the plugin migration to see if one DX allows easier perf otpimisation than the other

Optimisation-wise we can just ...args into the dep array. Though we have to disable the eslint error for exaustive deps 🙃

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Nov 26, 2024
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change component: charts This is the name of the generic UI component, not the React module! PR: out-of-date The pull request has merge conflicts and can't be merged v8.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants