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

Loading time improvements #61

Merged
merged 6 commits into from
Apr 12, 2024
Merged

Loading time improvements #61

merged 6 commits into from
Apr 12, 2024

Conversation

Bo-Duke
Copy link
Member

@Bo-Duke Bo-Duke commented Apr 10, 2024

All loadings of the app have been significantly reduced :

  • Limited number of requests made on each actions, only make request if necessary for the next UI change
  • GeoJSON files are now fetched separetely from the settings and the list of layers, meaning the UI is usable while the files are still fetched
  • Activating / deactivating a layer changes the state of the switch instantly, the timing of side-effects don't affect it
  • MapContext fetches settings itself, meaning the UI can render before the request is finished

Loading indicators on some UI elements :

  • Map is rendered as soon as possible, the sidebar has "skeleton" layers while waiting for the settings to be fetched
  • When a layer is activated but its GeoJSON is still loading, the switch displays a loader
  • Details page has a spinner

Results :
Clicking on "streams" from the homepage

Before : 6 seconds until usable UI and map, with streams displayed
Now : < 1 second until usable UI and map, streams are displayed at 6 seconds

Clicking on a river on the map

Before : 6 seconds until details are shown
Now : 0.9 second until details are shown

Todo:

  • Activating layers in the url on first load

@Bo-Duke Bo-Duke requested a review from dtrucs April 11, 2024 14:50
@Bo-Duke Bo-Duke marked this pull request as ready for review April 11, 2024 14:50
src/app/[locale]/map/[details]/[id]/loading.tsx Outdated Show resolved Hide resolved
src/components/map-filters.tsx Show resolved Hide resolved
src/components/map-filters.tsx Outdated Show resolved Hide resolved
src/components/map-filters.tsx Outdated Show resolved Hide resolved
src/context/map.tsx Show resolved Hide resolved
src/components/ui/switch.tsx Outdated Show resolved Hide resolved
src/context/map.tsx Show resolved Hide resolved
@Bo-Duke Bo-Duke merged commit 1f4a1c8 into main Apr 12, 2024
2 checks passed
@Bo-Duke Bo-Duke deleted the perf_upgrades branch April 12, 2024 12:52
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.

2 participants