GCTC-NTGC / gc-digital-talent

GC Digital Talent is the new recruitment platform for digital and tech jobs in the Government of Canada. // Talents numériques du GC est la nouvelle plateforme de recrutement pour les emplois numériques et technologiques au gouvernement du Canada.
https://talent.canada.ca
GNU Affero General Public License v3.0
20 stars 8 forks source link

♻️ Implement data loaders #9545

Open esizer opened 6 months ago

esizer commented 6 months ago

✨ Feature

Start using react-router data loaders.

🕵️ Details

We would like to start utilizing more functionality of react-router. The first step of this includes the use of data loading. Once we have this in, we can start looking at lazy loading our routes. Meaning, our data can be loaded in parallel with our data so we no longer need to wait until the component is loaded and mounted to fetch our data 🎉

In addition to this, we can actually start checking auth in the loaders so we should no longer need to wrap everything in RequireAuth.

🙋‍♀️ Proposed Implementation

You can follow the documentation for the data library integration. This uses react-query but the concept is easily translatable to urql.

I think we could keep the scope small on this to start and just get it working on an authenticated page and then expand on that in additional tickets?

✅ Acceptance Criteria

A set of assumptions which, when tested, verify that the feature was properly implemented.

petertgiles commented 3 months ago

Possibly blocked on graphcache.

vd1992 commented 3 weeks ago

Waiting on graphcache