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(details): Improve performance #2650

Merged
merged 6 commits into from
Dec 13, 2024

Conversation

jolevesq
Copy link
Member

@jolevesq jolevesq commented Dec 10, 2024

Closes #2639

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.

  • Remove a double query on each click
  • Remove unessacary render of all features in a query. Only render the visible one

Fixes #2639

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.

Compare with https://canadian-geospatial-platform.github.io/geoview/public/outlier-elections-2019.html and https://canadian-geospatial-platform.github.io/geoview/public/demos-navigator.html?config=./configs/navigator/28-geocore.json

https://jolevesq.github.io/geoview/demos-navigator.html?config=./configs/navigator/28-geocore.json
https://jolevesq.github.io/geoview/outlier-elections-2019.html

There is less render (and console logs)
Faster rendering
No more panel diseaper when waiting for the component to re render, better use of skeleton

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 12, 2024 15:05
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 8 of 12 files at r1, 6 of 6 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @jolevesq)


packages/geoview-core/src/core/app-start.tsx line 1 at r2 (raw file):

import { createContext, StrictMode, Suspense, useMemo } from 'react';

Do we want strict mode removed?


packages/geoview-core/src/core/components/details/feature-info-new.tsx line 1 at r2 (raw file):

import { useCallback, useEffect, useMemo, useState } from 'react';

Should this file be renamed? I think that the -new is from refactoring it ages ago.

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.

Reviewable status: 9 of 14 files reviewed, 2 unresolved discussions (waiting on @DamonU2)


packages/geoview-core/src/core/app-start.tsx line 1 at r2 (raw file):

Previously, DamonU2 (Damon Ulmi) wrote…

Do we want strict mode removed?

Forgot to re add, Done


packages/geoview-core/src/core/components/details/feature-info-new.tsx line 1 at r2 (raw file):

Previously, DamonU2 (Damon Ulmi) wrote…

Should this file be renamed? I think that the -new is from refactoring it ages ago.

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 4 of 5 files at r3, 2 of 2 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @jolevesq)

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 3 of 12 files at r1, 4 of 6 files at r2, 5 of 5 files at r3, 1 of 2 files at r4.
Reviewable status: all files reviewed (commit messages unreviewed), all discussions resolved (waiting on @jolevesq)

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 1 of 12 files at r1.
Reviewable status: all files reviewed (commit messages unreviewed), all discussions resolved (waiting on @jolevesq)

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 1 of 12 files at r1.
Reviewable status: all files reviewed (commit messages unreviewed), all discussions resolved (waiting on @jolevesq)

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 all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @jolevesq)

@jolevesq jolevesq merged commit e669a5a into Canadian-Geospatial-Platform:develop Dec 13, 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 Details
2 participants