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: Memoize Highlight so it does not re-render on line click #3123

Merged

Conversation

nicholas-codecov
Copy link
Contributor

Description

Small tweak to the virtual file renderer so that it doesn't re-tokenize and slow down the highlight process. This happens because the parent component (raw file viewer) also access the router location so it renders because the router context is updated.

Notable Changes

  • Memo'ize the Highlight component

@nicholas-codecov nicholas-codecov changed the title fix: Memoize Highlight so it does not re-render fix: Memoize Highlight so it does not re-render on line click Aug 13, 2024
@codecov-staging
Copy link

Bundle Report

Bundle size has no change ✅

@codecov-staging
Copy link

codecov-staging bot commented Aug 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3123   +/-   ##
=======================================
  Coverage   98.29%   98.29%           
=======================================
  Files         917      917           
  Lines       14149    14151    +2     
  Branches     3923     3918    -5     
=======================================
+ Hits        13908    13910    +2     
  Misses        236      236           
  Partials        5        5           
Files Coverage Δ
src/ui/VirtualFileRenderer/VirtualFileRenderer.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 54.05% <ø> (ø)
Layouts 98.78% <ø> (ø)
Pages 99.01% <ø> (ø)
Services 99.51% <ø> (ø)
Shared 99.71% <ø> (ø)
UI 94.50% <100.00%> (+<0.01%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 05123c9...31bdc12. Read the comment docs.

@codecov-qa
Copy link

codecov-qa bot commented Aug 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.29%. Comparing base (05123c9) to head (31bdc12).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3123   +/-   ##
=======================================
  Coverage   98.29%   98.29%           
=======================================
  Files         917      917           
  Lines       14149    14151    +2     
  Branches     3893     3893           
=======================================
+ Hits        13908    13910    +2     
  Misses        236      236           
  Partials        5        5           
Files Coverage Δ
src/ui/VirtualFileRenderer/VirtualFileRenderer.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 54.05% <ø> (ø)
Layouts 98.78% <ø> (ø)
Pages 99.01% <ø> (ø)
Services 99.51% <ø> (ø)
Shared 99.71% <ø> (ø)
UI 94.50% <100.00%> (+<0.01%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 05123c9...31bdc12. Read the comment docs.

Copy link

codecov-public-qa bot commented Aug 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.29%. Comparing base (05123c9) to head (31bdc12).

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3123   +/-   ##
=======================================
  Coverage   98.29%   98.29%           
=======================================
  Files         917      917           
  Lines       14149    14151    +2     
  Branches     3918     3893   -25     
=======================================
+ Hits        13908    13910    +2     
  Misses        236      236           
  Partials        5        5           
Files Coverage Δ
src/ui/VirtualFileRenderer/VirtualFileRenderer.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 54.05% <ø> (ø)
Layouts 98.78% <ø> (ø)
Pages 99.01% <ø> (ø)
Services 99.51% <ø> (ø)
Shared 99.71% <ø> (ø)
UI 94.50% <100.00%> (+<0.01%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 05123c9...31bdc12. Read the comment docs.

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Aug 13, 2024

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
34cc8e8 Tue, 13 Aug 2024 21:38:34 GMT Expired Expired
31bdc12 Thu, 15 Aug 2024 00:07:06 GMT Cloud Enterprise

Copy link

codecov bot commented Aug 13, 2024

Bundle Report

Changes will increase total bundle size by 164 bytes ⬆️

Bundle name Size Change
gazebo-production-array-push 5.85MB 164 bytes ⬆️

Copy link

codecov bot commented Aug 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.29%. Comparing base (05123c9) to head (31bdc12).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##               main      #3123   +/-   ##
===========================================
  Coverage   98.29000   98.29000           
===========================================
  Files           917        917           
  Lines         14149      14151    +2     
  Branches       3923       3923           
===========================================
+ Hits          13908      13910    +2     
  Misses          236        236           
  Partials          5          5           
Files Coverage Δ
src/ui/VirtualFileRenderer/VirtualFileRenderer.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 54.05% <ø> (ø)
Layouts 98.78% <ø> (ø)
Pages 99.01% <ø> (ø)
Services 99.51% <ø> (ø)
Shared 99.71% <ø> (ø)
UI 94.50% <100.00%> (+<0.01%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 05123c9...31bdc12. Read the comment docs.

Copy link
Contributor

@suejung-sentry suejung-sentry left a comment

Choose a reason for hiding this comment

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

nice!

@nicholas-codecov nicholas-codecov added this pull request to the merge queue Aug 15, 2024
Merged via the queue into main with commit e748312 Aug 15, 2024
61 checks passed
@nicholas-codecov nicholas-codecov deleted the fix-slow-line-highlighting-in-new-code-renderer branch August 15, 2024 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants