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

refactor(component): Review component to improve performance #2628

Merged
merged 4 commits into from
Dec 5, 2024

Conversation

jolevesq
Copy link
Member

@jolevesq jolevesq commented Dec 2, 2024

Closes #2626

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Refactor style
Refactor component structure to reduce rendering (see list in issue)

Fixes #2626

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

hosted Dec 3rd, 15:30: https://jolevesq.github.io/geoview

You can check in console and there is less rendering. Component are simple so not much overall improvement

If you look at components/scale/scale you will see it is re render every time we switch tabs even if scale is not affected... This is not the case anymore with the fix. The component is re render only when modified.

Checklist:

  • I have build (rush build) and deploy (rush host) my PR
  • I have connected the issues(s) to this PR
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have created new issue(s) related to the outcome of this PR is needed
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

This change is Reviewable

@jolevesq jolevesq marked this pull request as ready for review December 3, 2024 20:24
Copy link
Member

@DamonU2 DamonU2 left a comment

Choose a reason for hiding this comment

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

Reviewed 73 of 73 files at r1, 9 of 9 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Alex-NRCan, @jolevesq, and @PVautour)


packages/geoview-core/src/core/components/details/details-style.ts line 4 at r1 (raw file):

import { SxProps } from '@mui/system';

type SxStyles = Record<string, SxProps<Theme>>;

Should we set this up once somewhere and import it instead of SxProps? Used in a lot of files

Copy link
Member Author

@jolevesq jolevesq left a comment

Choose a reason for hiding this comment

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

Reviewed 72 of 73 files at r1, 9 of 9 files at r2, 46 of 46 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Alex-NRCan, @DamonU2, and @PVautour)


packages/geoview-core/src/core/components/details/details-style.ts line 4 at r1 (raw file):

Previously, DamonU2 (Damon Ulmi) wrote…

Should we set this up once somewhere and import it instead of SxProps? Used in a lot of files

Done.

Copy link
Member

@DamonU2 DamonU2 left a comment

Choose a reason for hiding this comment

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

Reviewed 46 of 46 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Alex-NRCan and @PVautour)

@jolevesq jolevesq merged commit 7f0d0b4 into Canadian-Geospatial-Platform:develop Dec 5, 2024
6 checks passed
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.

Performance for simple component
2 participants