-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Problem
The data loading layer is currently scoped to the data page only. It is initialized when the user navigates to /data and loads the full dataset before rendering begins.
This tight coupling to a single page means that any component outside of the data page such as the header cannot access the loaded data.
This is a prerequisite for placing the search bar in the global header, but also a general improvement for any future feature that needs data access outside the data page.
Proposed Solution
Move data initialization earlier in the component tree so it is available at the app level. To avoid increasing the app's initial load time, the data should be loaded lazily/deferred, meaning it starts loading early but does not block the initial render.
A future improvement could include a partial preloaded dataset for common anticipated queries (e.g. the most commonly searched languages), so results can appear before the full dataset finishes loading.
Required Changes
- Move the data provider higher in the component tree so it is accessible outside the data page
- Ensure data loading remains deferred so it does not add blocking I/O costs before the app renders
- Keep the bundle size impact minimal, the data loading code should not be included in the initial JS bundle