Skip to content

Conversation

Mpdreamz
Copy link
Member

@Mpdreamz Mpdreamz commented Feb 18, 2025

selected-nav.mp4

Caches navigation for significantly faster build times.

Uses javascript to set the current page selected and expand its parent. Something we already do as we keep track of which nodes the user expanded.

Includes a few javascript speedups too.

  • don't iterate over all inputs to set the previously selected, instead loop over selected state.
  • when saving we only iterate over the checked inputs

We burn an overall navigation uuid into nav, if the users state does not match this we reset the users state. This prevents needlessly growing the users sessionStorage with UUID's that won't be valid anymore since the HTML is regenerated.

@Mpdreamz Mpdreamz added the fix label Feb 18, 2025
@Mpdreamz Mpdreamz requested a review from a team February 18, 2025 19:53
Copy link
Member

@reakaleek reakaleek left a comment

Choose a reason for hiding this comment

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

🚀 🚀

@Mpdreamz Mpdreamz merged commit d1bca1d into main Feb 18, 2025
5 of 6 checks passed
@Mpdreamz Mpdreamz deleted the feature/cache-navigation branch February 18, 2025 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants