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

fix: TypeScript performance of BarPercent.tsx #11076

Conversation

bnussman-akamai
Copy link
Member

@bnussman-akamai bnussman-akamai commented Oct 9, 2024

Description πŸ“

  • Improves the TypeScript type-checking performance on the BarPercent.tsx component 🏎️

Preview πŸ“·

Before After
Screenshot 2024-10-09 at 1 58 53β€―PM Screenshot 2024-10-09 at 1 54 17β€―PM
takes 16 seconds to typecheck takes 14ms to type check 😦

How to test πŸ§ͺ

  • Verify type checking passes in Github Actions
  • Verify there are no regressions with the component, it's types, and it's behavior
  • Profile this if you want to (yarn tsc --generateTrace ./trace --incremental false and inspect with chrome://tracing)

As an Author I have considered πŸ€”

  • πŸ‘€ Doing a self review
  • ❔ Our contribution guidelines
  • 🀏 Splitting feature into small PRs
  • βž• Adding a changeset
  • πŸ§ͺ Providing/Improving test coverage
  • πŸ” Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • πŸ‘£ Providing comprehensive reproduction steps
  • πŸ“‘ Providing or updating our documentation
  • πŸ•› Scheduling a pair reviewing session
  • πŸ“± Providing mobile support
  • β™Ώ Providing accessibility support

@bnussman-akamai bnussman-akamai added the Performance Increase performance of CM label Oct 9, 2024
@bnussman-akamai bnussman-akamai self-assigned this Oct 9, 2024
@@ -1,10 +1,11 @@
import { styled } from '@mui/material/styles';
import { SxProps } from '@mui/system';
Copy link
Member Author

Choose a reason for hiding this comment

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

This is another win for pnpm (#11000). By nature it won't allow imports from a package that are not an explicit dependency.

Here, we are importing from @mui/system which is not defined in our package.json

Copy link
Member Author

@bnussman-akamai bnussman-akamai Oct 9, 2024

Choose a reason for hiding this comment

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

We could use eslint to prevent imports but having a more solid foundation (a better package manager) would be a better fix

Copy link
Contributor

Choose a reason for hiding this comment

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

By nature it won't allow imports from a package that are not an explicit dependency.

music to my ears

Copy link
Contributor

Choose a reason for hiding this comment

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

Should these changes be applied to other instances where we are importing @mui/system as well?

Screenshot 2024-10-09 at 12 17 02β€―PM

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 believe so. I'll do a follow up PR for this!

@bnussman-akamai bnussman-akamai marked this pull request as ready for review October 9, 2024 18:25
@bnussman-akamai bnussman-akamai requested a review from a team as a code owner October 9, 2024 18:25
@bnussman-akamai bnussman-akamai requested review from carrillo-erik and abailly-akamai and removed request for a team October 9, 2024 18:25
@bnussman-akamai bnussman-akamai changed the title fix: TypeScript Performance of BarPercent.tsx fix: TypeScript performance of BarPercent.tsx Oct 9, 2024
Copy link

github-actions bot commented Oct 9, 2024

Coverage Report: βœ…
Base Coverage: 86.96%
Current Coverage: 86.96%

@@ -1,10 +1,11 @@
import { styled } from '@mui/material/styles';
import { SxProps } from '@mui/system';
Copy link
Contributor

Choose a reason for hiding this comment

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

Should these changes be applied to other instances where we are importing @mui/system as well?

Screenshot 2024-10-09 at 12 17 02β€―PM

@bnussman-akamai bnussman-akamai merged commit 8cd0333 into linode:develop Oct 9, 2024
18 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Performance Increase performance of CM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants