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] Type improvements & warnOnce usage #14792

Merged
merged 8 commits into from
Oct 1, 2024
Merged

Conversation

JCQuintas
Copy link
Member

Just some improvements and consistency I've found when working on another PR

  • Improve some types
  • Add default curve used in line charts for clarity
  • Use warnOnce in more places

@JCQuintas JCQuintas added docs Improvements or additions to the documentation enhancement This is not a bug, nor a new feature component: charts This is the name of the generic UI component, not the React module! labels Oct 1, 2024
@JCQuintas JCQuintas self-assigned this Oct 1, 2024
@mui-bot
Copy link

mui-bot commented Oct 1, 2024

Deploy preview: https://deploy-preview-14792--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 50ded05

packages/x-charts/src/models/seriesType/line.ts Outdated Show resolved Hide resolved
Comment on lines 62 to 63
if (process.env.NODE_ENV !== 'production' && value !== null) {
warnOnce([
Copy link
Member

Choose a reason for hiding this comment

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

Codebase convention. The idea was to make those ease to spot.

Suggested change
if (process.env.NODE_ENV !== 'production' && value !== null) {
warnOnce([
if (process.env.NODE_ENV !== 'production') {
if (value !== null) {
warnOnce([

If we implement mui/mui-public#207, we might not need this convention as much, not sure.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I thought about dividing the checks too, but IIRC bundlers should remove it regardless of a second condition. Will divide it up 😅

Copy link

codspeed-hq bot commented Oct 1, 2024

CodSpeed Performance Report

Merging #14792 will not alter performance

Comparing JCQuintas:warnonce (50ded05) with master (fccf14a)

Summary

✅ 3 untouched benchmarks

Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

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

Nice refinement. 👏

packages/x-charts/src/models/seriesType/line.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: charts This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation enhancement This is not a bug, nor a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants