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(compass-components): do not keep fallback content when not needed COMPASS-7417 #5111

Merged

Conversation

himanshusinghs
Copy link
Contributor

Description

The fallback content kept rendering css keyframes with opacity 0 which ended up consuming a lot of CPU as seen in the Activity monitor. As I understand, we probably wanted to workaround the inability to animate css display property here and although with the change in place, there is a slight difference in the output, it is probably worth getting to normal CPU usage.

Checklist

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@himanshusinghs himanshusinghs marked this pull request as ready for review November 14, 2023 13:15
@github-actions github-actions bot added the fix label Nov 14, 2023
@himanshusinghs himanshusinghs marked this pull request as draft November 14, 2023 13:16
@himanshusinghs himanshusinghs marked this pull request as ready for review November 14, 2023 14:23
@@ -114,12 +114,14 @@ const fallbackContainer = css({
bottom: 0,
left: 0,
opacity: 0,
transition: 'opacity .16s ease-out',
transition: 'opacity display .16s ease-out',
Copy link
Collaborator

Choose a reason for hiding this comment

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

i almost feel this can just be confusing at this point, should we just drop it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

unless i'm missing something ..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this has a nice side-effect that the visibility(coming into view) of fallback content still gets animated nicely.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually there very little difference (just checked again), maybe i will just remove it to cut down any confusion here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done 👍

@himanshusinghs himanshusinghs changed the title fix(compass-components): avoids rendering fallback content when not needed COMPASS-7417 fix(compass-components): do not keep fallback content when not needed COMPASS-7417 Nov 14, 2023
@himanshusinghs himanshusinghs linked an issue Nov 14, 2023 that may be closed by this pull request
@himanshusinghs himanshusinghs merged commit 560bcae into main Nov 14, 2023
@himanshusinghs himanshusinghs deleted the COMPASS-7417-do-not-render-fallback-svg-when-not-needed branch November 14, 2023 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants